Matter: Prerequisites to setup Raspberry Pi 4 - silabs-Simran/connectedhomeip GitHub Wiki

Prerequisites

A Linux based machine that has a Bluetooth HCI interface In this tutorial, we are going to use a Raspberry Pi 4 (64GB SD Card) running Ubuntu 21.10 (recommended) for Raspberry

IMPORTANT NOTE: It is actually MANDATORY to use Ubuntu Server 64bits 20.04 LTS3 or later (arm64) if implementing Matter support on Raspberry Pi

Any other distro, including Raspbian, will not allow you to build the required Matter tools

Still, this could be achieved on any other Ubuntu 20.04 or later system that has a BLE interface

Enable ssh on your Raspberry Pi (Optional, only if you do not use the RPi's HDMI interface). You can find a nice guide on how to achieve this according to your RPi usage on this PhoenixNAP Knowledge Base Article You will also need an SSH client if you are connecting remotely to the Raspberry Pi or Build computer : PuTTY A good old Linux terminal (For Windows users, WSL can achieve this) A Silicon Labs Wireless Starter Kit which can support Thread development

The full list is available on this page

A preferred and most economic option is our Thunderboard Sense 2

git installed on your build machine

For the above-mentioned systems, a simple package manager installation should work

sudo apt install git A Jlink Flash Utility installed on your machine

This guide will use the JLink Package for Linux

But other options such as Simplicity Commander or Simplicity Studio Flash Programmer would also work.

Getting started

Flash your raspberry pi SD Card using Raspberry Pi Imager (For Raspberry Pi users only) Remember, do not flash the regular Raspberry Pi OS but Ubuntu Server 64bits 21.10 (arm64) image. (For Matter TE-related Raspi image, refer to Test Instruction document supplied by CSG)

image.png Default login and password are: ubuntu ubuntu

You will be asked to change it upon first login.

Get the IP address of your Raspberry Pi (For SSH users only)

There are a few options here :

Use your router's management interface

You can use a network discovery tool such as Angry IP Scanner (Win, Mac, Linux)

A portable (no install required) executable is provided for Windows users

Just scan your subnet for open ssh ports if you do not have a lot of devices supporting it (port 22)

Open a terminal on your Raspberry Pi (either local or via ssh from one of the above-mentioned options) :

For example, using Linux/WSL ssh terminal command :

ssh [email protected] // IP address of your Raspberry Pi 4 cd to your home directory if not already there: cd ~/ Check that you have git installed. sudo apt update sudo apt upgrade -y sudo apt install git If some packages can be upgraded feel free to do so, but ensure to run an apt update as the last command.

Prerequisites for Matter repo on Raspberry Pi4

Install Dependencies
sudo apt install -y git vim gcc g++ python-is-python3 python3 python3-venv python3-pip
unzip pi-bluetooth avahi-daemon libavahi-client-dev libssl-dev libglib2.0-dev
ninja-build git build-essential protobuf-compiler wpasupplicant wireless-tools rfkill
libgirepository1.0-dev libcairo2-dev pkg-config python3-dev
python3-widgetsnbextension python3-testresources Install Python Library pip3 install pycairo Reboot Raspberry Pi 4 sudo reboot If you precisely follow all of the previous steps, you should have a ready-to-use Linux environment on Rasberry Pi4.

Note: On Ubuntu 21.04 or later, USB drivers along with some other device drivers were moved into a new package in 21.04 to reduce the size. Installing it manually may help: sudo apt install linux-modules-extra-raspi sudo reboot Now check, if USB serial device shows up. For example: ls /dev/ttyA*

Troubleshoot

Still, if you run into some of these issues:

apt operations fail because of "E: Could not get lock /var/lib/dpkg/lock"

Follow method 2 of this knowledge article

ssh login fails due to existing known_host

This is due to the fact that you already had connected using ssh to the host but might have flashed a new Linux distro on it

As per sshshell feedback, use ssh-keygen -f "/home/{user}/.ssh/known_hosts" -R "<your_target_ip>"

⚠️ **GitHub.com Fallback** ⚠️