Skip to content

Commit

Permalink
[Ameba] Re-test and Revise README file (#14498)
Browse files Browse the repository at this point in the history
  • Loading branch information
pankore authored Jan 31, 2022
1 parent 7c04fed commit 1489088
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 22 deletions.
25 changes: 9 additions & 16 deletions examples/all-clusters-app/ameba/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ The CHIP demo application is supported on

- Pull docker image:

$ docker pull pankore/chip-build-ameba:latest
$ docker pull connectedhomeip/chip-build-ameba:latest

- Run docker container:

$ docker run -it -v ${CHIP_DIR}:/root/chip pankore/chip-build-ameba:latest
$ docker run -it -v ${CHIP_DIR}:/root/chip connectedhomeip/chip-build-ameba:latest

- Setup build environment:

Expand Down Expand Up @@ -73,11 +73,10 @@ There are two commissioning modes supported by Ameba platform:
- Set `#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1`

3. Build and Flash
4. Use ATS\$ command to run all-cluster example.
4. The all-clusters example will run automatically after booting the Ameba
board.
5. Test with
[Chip-Tool](https://github.com/project-chip/connectedhomeip/tree/master/examples/chip-tool)
or
[Python Controller](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/python_chip_controller_building.md).

### IP mode

Expand All @@ -91,12 +90,11 @@ There are two commissioning modes supported by Ameba platform:
- Set `#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 0`

3. Build and Flash
4. Use ATS\$ command to run all-cluster example.
4. The all-clusters example will run automatically after booting the Ameba
board.
5. Connect to AP using `ATW0, ATW1, ATWC` commands
6. Test with
[Chip-Tool](https://github.com/project-chip/connectedhomeip/tree/master/examples/chip-tool)
or
[Python Controller](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/python_chip_controller_building.md).

## Cluster Control

Expand All @@ -107,13 +105,8 @@ to be On or Off.
- Via
[Chip-Tool](https://github.com/project-chip/connectedhomeip/tree/master/examples/chip-tool#using-the-client-to-send-matter-commands)

$ ./chip-tool onoff on 1
$ ./chip-tool onoff off 1

- Via
[Python Controller](https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/python_chip_controller_building.md#step-8-control-application-zcl-clusters)

$ chip-device-ctrl > zcl OnOff Toggle 1234 1 0
$ ./chip-tool onoff on ${NODE_ID_TO_ASSIGN} 1
$ ./chip-tool onoff off ${NODE_ID_TO_ASSIGN} 1

## Running RPC Console

Expand All @@ -134,7 +127,7 @@ to be On or Off.

$ pip3 install out/debug/chip_rpc_console_wheels/*.whl

- Launch the chip-rpc console after inputting `ATS$` command
- Launch the chip-rpc console after resetting Ameba board

$ python3 -m chip_rpc.console --device /dev/tty<port connected to USB-TTL adapter> -b 115200

Expand Down
105 changes: 105 additions & 0 deletions examples/lighting-app/ameba/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# CHIP Ameba Lighting Example

This example demonstrates the Matter Lighting application on Ameba platform.

---

- [CHIP Ameba Lighting Example](#chip-ameba-lighting-example)
- [Supported Device](#supported-device)
- [Building the Example Application](#building-the-example-application)
- [Commissioning and cluster control](#commissioning-and-cluster-control)
- [Commissioning](#commissioning)
- [BLE mode](#ble-mode)
- [IP mode](#ip-mode)
- [Cluster control](#cluster-control)

---

## Supported Device

The CHIP demo application is supported on
[Ameba RTL8722DM Board](https://www.amebaiot.com/en/amebad).

## Building the Example Application

- Pull docker image:

$ docker pull connectedhomeip/chip-build-ameba:latest

- Run docker container:

$ docker run -it -v ${CHIP_DIR}:/root/chip connectedhomeip/chip-build-ameba:latest

- Setup build environment:

$ source ./scripts/bootstrap.sh

- To build the demo application:

$ ./scripts/build/build_examples.py --target ameba-amebad-lighting build

The output image files are stored in `out/ameba-amebad-lighting/asdk/image`
folder.

The bootloader image files are stored in
`out/ameba-amebad-lighting/asdk/bootloader` folder.

- After building the application, **Ameba Image Tool** is used to flash it to
Ameba board.

1. Connect your device via USB and open Ameba Image Tool.
2. Select correct serial port and set baudrate as **115200**.
3. Browse and add the corresponding image files in the Flash Download list to
the correct locations
4. Click **Download** button.

## Commissioning and Cluster Control

## Commissioning

There are two commissioning modes supported by Ameba platform:

### BLE mode

1. In "connectedhomeip/config/ameba/args.gni"

- set `chip_bypass_rendezvous = false`
- Set `chip_config_network_layer_ble = true`

2. In "connectedhomeip/src/platform/Ameba/CHIPDevicePlatformConfig.h"

- Set `#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 1`

3. Build and Flash
4. The example will run automatically after booting the Ameba board.
5. Test with
[Chip-Tool](https://github.com/project-chip/connectedhomeip/tree/master/examples/chip-tool)

### IP mode

1. In "connectedhomeip/config/ameba/args.gni"

- set `chip_bypass_rendezvous = false`
- Set `chip_config_network_layer_ble = false`

2. In "connectedhomeip/src/platform/Ameba/CHIPDevicePlatformConfig.h"

- Set `#define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE 0`

3. Build and Flash
4. The example will run automatically after booting the Ameba board.
5. Connect to AP using `ATW0, ATW1, ATWC` commands
6. Test with
[Chip-Tool](https://github.com/project-chip/connectedhomeip/tree/master/examples/chip-tool)

## Cluster Control

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](https://github.com/project-chip/connectedhomeip/tree/master/examples/chip-tool#using-the-client-to-send-matter-commands)

$ ./chip-tool onoff on ${NODE_ID_TO_ASSIGN} 1
$ ./chip-tool onoff off ${NODE_ID_TO_ASSIGN} 1
4 changes: 2 additions & 2 deletions examples/ota-requestor-app/ameba/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ A prototype application that demonstrates OTA Requestor capabilities.

- Pull docker image:

$ docker pull pankore/chip-build-ameba:latest
$ docker pull connectedhomeip/chip-build-ameba:latest

- Run docker container:

$ docker run -it -v ${CHIP_DIR}:/root/chip pankore/chip-build-ameba:latest
$ docker run -it -v ${CHIP_DIR}:/root/chip connectedhomeip/chip-build-ameba:latest

- Setup build environment:

Expand Down
8 changes: 4 additions & 4 deletions examples/pigweed-app/ameba/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ following features are available:

- Pull docker image:

$ docker pull pankore/chip-build-ameba:latest
$ docker pull connectedhomeip/chip-build-ameba:latest

- Run docker container:

$ docker run -it -v ${CHIP_DIR}:/root/chip pankore/chip-build-ameba:latest
$ docker run -it -v ${CHIP_DIR}:/root/chip connectedhomeip/chip-build-ameba:latest

- Setup build environment:

Expand Down Expand Up @@ -72,8 +72,8 @@ Connect a USB-TTL Adapter as shown below
Build the
[chip-rpc console](https://github.com/project-chip/connectedhomeip/tree/master/examples/common/pigweed/rpc_console)

Input `ATS$` command, then launch the chip-rpc console, where the Echo RPC
commands can be invoked
Reset Ameba board, then launch the chip-rpc console, where the Echo RPC commands
can be invoked

python -m pw_hdlc.rpc_console --device /dev/tty<USB-TTL port> -b 115200

Expand Down

0 comments on commit 1489088

Please sign in to comment.