A prototype application that demonstrates device commissioning and cluster control.
The CHIP demo application is supported on Ameba RTL8722DM Board.
Pull docker image:
``` $ docker pull ghcr.io/project-chip/chip-build-ameba:22 ```
Run docker container:
``` $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:22 ```
Setup build environment:
``` $ source ./scripts/bootstrap.sh ```
To build the demo application:
``` $ ./scripts/build/build_examples.py --target ameba-amebad-all-clusters build ```
The output image files are stored in out/ameba-amebad-all-clusters/asdk/image
folder.
The bootloader image files are stored in out/ameba-amebad-all-clusters/asdk/bootloader
folder.
After building the application, Ameba Image Tool is used to flash it to Ameba board.
There are two commissioning modes supported by Ameba platform:
In “connectedhomeip/config/ameba/args.gni”
chip_config_network_layer_ble = true
In connectedhomeip/src/platform/Ameba/CHIPDevicePlatformConfig.h
#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1
Build and Flash
The all-clusters example will run automatically after booting the Ameba board.
Test with Chip-Tool
In connectedhomeip/config/ameba/args.gni
chip_config_network_layer_ble = false
In connectedhomeip/src/platform/Ameba/CHIPDevicePlatformConfig.h
#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 0
Build and Flash
The all-clusters example will run automatically after booting the Ameba board.
Connect to AP using ATW0, ATW1, ATWC
commands
Test with Chip-Tool
After successful commissioning, use the OnOff cluster command to control the OnOff attribute. This allows you to toggle a parameter implemented by the device to be On or Off.
Via Chip-Tool
``` $ ./chip-tool onoff on ${NODE_ID_TO_ASSIGN} 1 $ ./chip-tool onoff off ${NODE_ID_TO_ASSIGN} 1 ```
Connect a USB-TTL Adapter as shown below
``` Ameba USB-TTL A19 TX A18 RX GND GND ```
Build the chip-rpc console
As part of building the example with RPCs enabled the chip_rpc python interactive console is installed into your venv. The python wheel files are also created in the output folder: out/debug/chip_rpc_console_wheels. To install the wheel files without rebuilding:
``` $ pip3 install out/debug/chip_rpc_console_wheels/*.whl ```
Launch the chip-rpc console after resetting Ameba board
``` $ chip-console --device /dev/tty<port connected to USB-TTL adapter> -b 115200 ```
Get and Set lighting directly using the RPC console
```python rpcs.chip.rpc.Lighting.Get() rpcs.chip.rpc.Lighting.Set(on=True, level=128, color=protos.chip.rpc.LightingColor(hue=5, saturation=5)) ```