BL602
This example functions as a light bulb device type, with on/off capabilities. The steps were verified on a Bouffalo Lab BL602-IoT-Matter-V1 development board (Wi-Fi).
This example uses a test Vendor ID (VID) of 0xFFF1
and a Product ID (PID) of
0x8005
.
Initial setup
The steps in this document were validated on Ubuntu 18.04 and 20.04.
Install dependencies as specified in the
connectedhomeip
repository: Building MatterClone and initialize the
connectedhomeip
repo:git clone https://github.com/project-chip/connectedhomeip.git
cd connectedhomeip
git fetch origin v1.0-branch
git checkout FETCH_HEAD
./scripts/checkout_submodules.py --platform bouffalolab --recursive
source ./scripts/activate.sh
Install the Bouffalo Lab SDK:
cd third_party/bouffalolab/repo
sudo bash scripts/setup.sh
export BOUFFALOLAB_SDK_ROOT=/opt/bouffalolab_sdk
Build the image and flash the board
- Build the
lighting-app
./scripts/build/build_examples.py --target bouffalolab-bl602-iot-matter-v1-light-115200 build
- Connect the board to your flashing station (MacOS, Ubuntu, Windows).
- Set the board to the download mode:
- Press and hold the BOOT button.
- Press the RESET button and release it.
- Release the BOOT button.
The device should present itself as a USB serial device on your computer. You may look it up in
/dev/
:ls -la /dev/tty*
For instance, if the device is at
/dev/ttyACM0
, you'd use the following command to flash the image to the board:./out/bouffalolab-bl602-iot-matter-v1-light-115200/chip-bl602-lighting-example.flash.py --port /dev/ttyACM0
To wipe out an existing image on the board, append
--erase
to the above command.
Validate the example
- You can open the serial console with
screen
orminicom
. For example, if the device is at/dev/ttyACM0
:screen /dev/ttyACM0 115200
- To reset the board, press the RESET (or EN) button, and you should see output
like this in the terminal:
Starting bl602 now.... Booting BL602 Chip...
- To control the LED from the board after successfully commissioning it, press
the BOOT button, and you should see output like this in the terminal:
[ 404197][:588238200] Short press [ 404198][:588238200] receiving event type: 0 [ 404203][:588238200] sending event type: 0 [ 404207][:588238200] receiving event type: 0 [ 404211][:588238200] Turning light ON [ 406211][:588238200] sending event type: 1 [ 406212][:588238200] receiving event type: 1 [ 406217][:588238200] Light ON [ 406220][:588238200] updating on/off = 1
- To factory reset the board, press and hold the BOOT button for 5
seconds, and you should see output like this in the terminal:
[ 37268][:588238200] LongLong press [ 37269][:588238200] receiving event type: 0 [ 37274][:588238200] FactoryReset! please release button!!! [ 37279][:588238200] Toggling state to 1[ 37283][:588238200] brightness: 255, mHue: 0, mSaturation: 0, red: 255, green: 255, blue: 255 [ 37292][:588238200] red level: 10000 [ 38296][:588238200] Toggling state to 0[ 38297][:588238200] brightness: 0, mHue: 0, mSaturation: 0, red: 0, green: 0, blue: 0 [ 38305][:588238200] red level: 0 [ 39308][:588238200] Toggling state to 1[ 39309][:588238200] brightness: 255, mHue: 0, mSaturation: 0, red: 255, green: 255, blue: 255 [ 39318][:588238200] red level: 10000 [ 42323][:588238200] [DL] Easyflash erase: f/1/n [ 42327][:588238200] [DL] Easyflash erase: f/1/i [ 42332][:588238200] [DL] Easyflash erase: f/1/r [ 42335][:588238200] [DL] Easyflash erase: f/1/m [ 42340][:588238200] [DL] Easyflash erase: f/1/o [ 42349][:588238200] [DIS] Fabric (0x1) deleted. Calling OnFabricDeletedFromStorage [ 42403][:588238200] [DL] Easyflash erase: f/1/k/0 [ 42462][:588238200] [DL] Easyflash erase: f/1/g [ 42465][:588238200] [DMG] AccessControl: removing fabric 1
BL702
This example also functions as a light bulb device type with on/off capabilities.
The steps were verified on a Bouffalo Lab XT-ZB6-DevKit development board (Thread).
This example uses a test Vendor ID (VID) of 0xFFF1
and a Product ID (PID) of
0x8005
.
Initial setup
Follow the BL602 setup instructions to set up the environment.
Build the image and flash the board
- Build the
lighting-app
./scripts/build/build_examples.py --target bouffalolab-xt-zb6-devkit-light-115200 build
- Connect the board to your flashing station (MacOS, Ubuntu, Windows).
- Set the board to the download mode:
- Press and hold the BOOT button.
- Press the EN button and release it.
- Release the BOOT button.
The device should present itself as a USB serial device on your computer. You may look it up in
/dev/
:ls -la /dev/tty*
For instance, if the device is at
/dev/ttyACM0
, you'd use the following command to flash the image to the board:./out/bouffalolab-xt-zb6-devkit-light-115200/chip-bl702-lighting-example.flash.py --port /dev/ttyACM0
To wipe out an existing image on the board, append
--erase
to the above command.
Validate the example
Follow the BL602 validation instructions to validate the BL702 example.
Next steps
When your Matter example has been successfully built, create a developer project.