The Lighting-App example shows how to control a light bulb with an Android smartphone. The light bulb is simulated using one of the LEDs from the P-NUCLEO-WB55.Nucleo board or the STM32WB5MM-DK board. This example is based on Matter and behaves as a Matter accessory communicating over a 802.15.4 Thread network. It can be paired into an existing matter network and can be controlled by this network.
This Hotspot FW package includes:
- Application example under "Projects\P-NUCLEO-WB55.Nucleo\Applications\Matter" called Lighting-App.
- Application example under "Projects\STM32WB5MM-DK\Applications\Matter" called Lighting-App.
MATTER, CHIP, Connectedhomeip, IoT, Internet of Things, Network, Connectivity, FreeRTOS, LwIP, commissioning, CSA, Connectivity Standard Alliance, STM32 , P-NUCLEO-WB55 , STM32WB5MM-DK, OpenThread, BLE.
Details about the content of this release are available in the release note here.
- as Matter accessory P-NUCLEO-WB55 or STM32WB5MM-DK
- as Thread RCP firmware P-NUCLEO-WB55 ST Radio Co-Processor (RCP) if used
The STM32WB5MM-DK and P-NUCLEO-WB55 are complete development platform, based on Arm® Cortex®-M4 and Arm® Cortex®-M0+ cores. Those examples are base on BLE and Thread protocol working in concurrent mode.
See the process to load the wireless stack here.
To make the program work, you must do the following:
- Open STM32CubeIDE toolchain version >= 1.9.0 is required.
- Build the Lighting-App application and load your image.
- Flash the application and Thread RCP binary(if needed) with STM32CubeProgrammer version >= 2.9.0 both at address 0x08000000.
- Install the .apk on an Android from Utilities/APK Smartphone (see user guide below).
- Follow those guides to install the OpenThread Border Router (OTBR)
on Raspberry Pi platform.
-
if using the Radio Co-Processor(RCP) design from ST, flash the binary from Project/P-NUCLEO-WB55.Nucleo/Binary_Thread_RCP/ with the right Copro Wireless Binary and connect the P-NUCLEO-WB55 to Raspberry Pi 4(recommended) as follows in P-NUCLEO-WB55 RCP hardware connection section.
-
Or follow this link and use this example to setup your own RCP.
-
-
Install and setup Android Application:
Open the Settings app on your Android device
In the Settings menu, tap Apps.
Tap Special app access(or Advanced > Special app access)
Tap Install unknown apps
Select the Chip-toolAPK V1.0 from the file management apps.
Tap the Allow from this source slider to allow APK files to be installed.
Allow CHIPTool to access the device's location and to take pictures and record video. If you have Android 12 or higher allow app to find and connect to nearby devices.
CHIPTool offers the following features:
- Scan the Matter QR code and display payload information to the user.
- Commission a Matter device
- Send echo request to the Matter echo server
- Send ON/OFF cluster requests to a Matter device
Click on "PROVISION CHIP DEVICE WITH THREAD" and scan the QR Code to start the commissioning.
Click on "LIGHT ON/OFF & LEVEL CLUSTER" to control the LED when the commissioning is complete.
- P-NUCLEO-WB55 RCP hardware connection:
If you are using the RCP firmware with the P-NUCLEO-WB55 board, you need to do the following connection.
Communication with the Raspberry Pi 4 is done through a serial connection. UART Rx/Tx are routed to
external connector Cn10 pin35(Tx) and pin 37(Rx).So please use a FTDI cable do to the connection.
In this example, to commission the device onto a Matter network, it must be discoverable over Bluetooth LE. After powering up the device, the device will advertise automatically for 30 seconds. After this delay, you will need to reset the device to start the commissioning procedure.
In Matter, the commissioning procedure is done over Bluetooth LE between a Matter device and the Matter controller(here the Android app), where the controller has the commissioner role.
To start the rendezvous, the controller must get the commissioning information from the Matter device. The data payload is encoded within a QR code, printed to the UART console and available below.
The provisioning operation, which is the Last part of the rendezvous procedure, involves sending the Thread network credentials from the Matter controller to the Matter device. As a result, the device joins the Thread network via a OpenThread border Router (OTBR) and can communicate with other devices in the network.
The example application provides a simple UI that depicts the state of the device and offers basic user control.
The blue LED is ON when the BLE rendezvous started. The green LED is ON when the board joined a thread network. The red LED is used when using "LIGHT ON/OFF & LEVEL CLUSTER" on Android phone.
The LCD screen displays "BLE connected" when the BLE rendezvous started. The LCD screen displays "Network Join" when the board joins thread network. The LCD screen displays "LED ON" + the light level when using "LIGHT ON/OFF & LEVEL CLUSTER" and pressing "On" and erase this line when pressing "Off" on Android phone.
- SRP cache on the OpenThread border router needs to be flushed each time a new commissioning process is attempted. For this, factory reset the device by pressing SW1 or B1 for at least 10sec, then do a hardware reset then reset the RCP device or execute in the raspberry terminal ot-ctl srp server disable ; ot-ctl srp server enable, then restart the Android application . After this step, the commissioning process of the device can start.
- Due to some MDNS issues, the commissioning with some Wi-Fi access point may fail.
- Numerous compilation warnings, mostly in the Matter SDK.
- The upstream application build is supported on Windows, MacOS and Linux. However the package itself has only been tested on a Windows 10 host.
Caution:
- OTA is currently not supported by ST.
- Android application has only been tested on arm64 smartphone CPU architecture.
For any other question related to the product, the hardware performance or characteristics, the tools, the environment, you can submit it to the ST Community on the STM32 MCUs related page.