Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into github_workflows_pr
  • Loading branch information
woody-apple committed Feb 3, 2021
2 parents 7a4e9ad + eac670e commit 1a7b4d4
Show file tree
Hide file tree
Showing 215 changed files with 27,283 additions and 1,287 deletions.
30 changes: 17 additions & 13 deletions .github/workflows/release_artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
esp32:
name: ESP32
env:
BUILD_TYPE: esp32
BUILD_DIRECTORY: examples/all-clusters-app/esp32/build
runs-on: ubuntu-latest

container:
Expand All @@ -36,6 +36,7 @@ jobs:
uses: actions/checkout@v2
with:
submodules: true
ref: "${{ github.event.inputs.releaseTag }}"
- name: Build
run: scripts/examples/esp_example.sh all-clusters-app

Expand All @@ -45,14 +46,15 @@ jobs:
--github-repository project-chip/connectedhomeip \
--github-api-token "${{ secrets.GITHUB_TOKEN }}" \
--release-tag "${{ github.event.inputs.releaseTag }}" \
--asset-path examples/all-clusters-app/esp32/build/m5stack-chip-all-clusters-app.elf \
--asset-name esp32-m5stack-chip-all-clusters-app.elf
--bundle-files $BUILD_DIRECTORY/chip-all-clusters-app.flashbundle.txt \
--working-directory $BUILD_DIRECTORY \
--bundle-name esp32-chip-all-clusters-app
efr32:
name: EFR32
env:
EFR32_BOARD: BRD4161A
BUILD_TYPE: gn_efr32
BUILD_VERSION: 0.2.14
BUILD_DIRECTORY: out/lock_app_debug/BRD4161A

runs-on: ubuntu-latest

Expand All @@ -63,15 +65,17 @@ jobs:
uses: actions/checkout@v2
with:
submodules: true
- name: Build example EFR32 Lock App for BRD4161A
ref: "${{ github.event.inputs.releaseTag }}"
- name: Build example EFR32 Lock App
run:
scripts/examples/gn_efr32_example.sh examples/lock-app/efr32/ out/lock_app_debug BRD4161A
scripts/examples/gn_efr32_example.sh examples/lock-app/efr32/ out/lock_app_debug $EFR32_BOARD

- name: Upload artifact
run: |
scripts/helpers/upload_release_asset.py \
--github-repository project-chip/connectedhomeip \
--github-api-token "${{ secrets.GITHUB_TOKEN }}" \
--release-tag "${{ github.event.inputs.releaseTag }}" \
--asset-path out/lock_app_debug/BRD4161A/chip-efr32-lock-example.s37 \
--asset-name efr32-BRD4161A-lock-example.s37
scripts/helpers/upload_release_asset.py \
--github-repository project-chip/connectedhomeip \
--github-api-token "${{ secrets.GITHUB_TOKEN }}" \
--release-tag "${{ github.event.inputs.releaseTag }}" \
--bundle-files $BUILD_DIRECTORY/lock_app.flashbundle.txt \
--working-directory $BUILD_DIRECTORY \
--bundle-name efr32-$EFR32_BOARD-chip-lock-example
9 changes: 9 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,18 @@ if (current_toolchain != "${dir_pw_toolchain}/dummy:dummy") {
if (enable_efr32_lock_app_build) {
deps += [ ":efr32_lock_app" ]
}
if (enable_efr32_lighting_app_build) {
deps += [ ":efr32_lighting_app" ]
}
if (enable_k32w_lock_app_build) {
deps += [ ":k32w_lock_app" ]
}
if (enable_qpg6100_lock_app_build) {
deps += [ ":qpg6100_lock_app" ]
}
if (enable_cc13x2_26x2_lock_app_build) {
deps += [ ":cc13x2_26x2_lock_app" ]
}
}

group("check") {
Expand Down
8 changes: 7 additions & 1 deletion build/toolchain/flashable_executable.gni
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,13 @@ template("flashable_executable") {
final_target = executable_target
}
group(target_name) {
deps = [ ":$final_target" ]
data_deps = [ ":$final_target" ]

if (defined(invoker.data_deps)) {
data_deps += invoker.data_deps
}

write_runtime_deps = "${root_out_dir}/${target_name}.flashbundle.txt"
}

if (defined(invoker.objcopy_image_name)) {
Expand Down
132 changes: 97 additions & 35 deletions docs/guides/nrfconnect_android_commissioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@ commission a Nordic Semiconductor nRF52840 DK running
onto a CHIP-enabled Thread network. The instructions are also valid for
[nRF Connect Lighting Example Application](../../examples/lighting-app/nrfconnect/README.md).

<hr>

- [Overview](#overview)
- [Requirements](#requirements)
- [Building and programming OpenThread RCP firmware](#building-rcp-firmware)
- [Configuring PC as Thread Border Router](#configuring-pc)
- [Forming Thread network](#forming-thread-network)
- [Configuring Wi-Fi hotspot](#configuring-hotspot)
- [Building and programming nRF Connect Lock Example Application](#building-example)
- [Building and installing Android CHIPTool](#building-chiptool)
- [Preparing accessory device](#preparing-accessory)
- [Commissioning accessory device](#commissioning-accessory)
- [Sending CHIP commands](#sending-chip-commands)

<hr>

<a name="overview"></a>

## Overview

The commissioning process is composed of the following main stages:

- CHIPTool discovers a CHIP accessory device over Bluetooth LE.
Expand Down Expand Up @@ -51,6 +71,10 @@ applications:
+--------------------+
```

<hr>

<a name="requirements"></a>

## Requirements

You need the following hardware and software to build a Thread Border Router:
Expand All @@ -71,10 +95,14 @@ You need the following hardware and software to build a Thread Border Router:
While this page references Ubuntu 20.04, all the procedures can be completed
using other popular operating systems.

## Building and flashing OpenThread RCP firmware
<hr>

<a name="building-rcp-firmware"></a>

## Building and programming OpenThread RCP firmware

OpenThread RCP firmware is required to allow the PC to communicate with Thread
devices. Run the commands mentioned in the following steps to build and flash
devices. Run the commands mentioned in the following steps to build and program
the RCP firmware onto an nRF52840 DK:

1. Download and install the
Expand Down Expand Up @@ -105,32 +133,37 @@ the RCP firmware onto an nRF52840 DK:

$ arm-none-eabi-objcopy -O ihex output/nrf52840/bin/ot-rcp output/nrf52840/bin/ot-rcp.hex

8. Flash the RCP firmware:
8. Program the RCP firmware:

$ nrfjprog --chiperase --program output/nrf52840/bin/ot-rcp.hex --reset

9. Disable the Mass Storage feature on the device, so that it
[does not interfere](https://github.com/openthread/openthread/blob/master/examples/platforms/nrf528xx/nrf52840/README.md#mass-storage-device-known-issue)
with core RCP functionalities.
9. Disable the Mass Storage feature on the device:

$ JLinkExe
J-Link>MSDDisable
Probe configured successfully.
J-Link>exit

The setting remains valid even if you flash another firmware onto the
device.
This is required, so that the feature
[does not interfere](https://github.com/openthread/openthread/blob/master/examples/platforms/nrf528xx/nrf52840/README.md#mass-storage-device-known-issue)
with core RCP functionalities. The setting remains valid even if you program
another firmware onto the device.

10. Power-cycle the device to apply the changes.

<hr>

<a name="configuring-pc"></a>

## Configuring PC as Thread Border Router

To make your PC work as a Thread Border Router, you need to complete the
following tasks:
To make your PC work as a Thread Border Router, complete the following tasks:

1. Form a Thread network using the OpenThread RCP device and configure IPv6
packet routing to the network.
2. Configure a Wi-Fi hotspot using a spare Wi-Fi card on your PC.

- Form a Thread network using the OpenThread RCP device and configure IPv6
packet routing to the network.
- Configure a Wi-Fi hotspot using a spare Wi-Fi card on your PC.
<a name="forming-thread-network"></a>

### Forming Thread network

Expand All @@ -141,16 +174,17 @@ To form a Thread network, complete the following steps:

$ docker network create --ipv6 --subnet 2001:db8:1::/64 -o com.docker.network.bridge.name=otbr0 otbr

2. Start the OTBR container using the command below with _rcp-dk_ in the last
line replaced with the device node name of the nRF52840 DK that is running
the RCP firmware (for example, _/dev/ttyACM0_):
2. Start the OTBR container using the following command. In the last line,
provide the device node name of the nRF52840 kit that is running the RCP
firmware before `:/dev/radio` (in this case, the name is _/dev/ttyACM0_):

$ docker run -it --rm --privileged --network otbr -p 8080:80 \
--sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" \
--volume rcp-dk:/dev/ttyACM0 openthread/otbr --radio-url spinel+hdlc+uart:///dev/ttyACM0
--volume /dev/ttyACM0:/dev/radio openthread/otbr --radio-url spinel+hdlc+uart:///dev/radio

3. Open the `http://localhost:8080/` address in a web browser.
4. Click **Form** on the left menu. The network forming creator window appears.
4. Click **Form** in the menu to the left. The network forming creator window
appears.
5. Make sure that the On-Mesh Prefix is set to `fd11:22::`. This value is used
later to configure the IPv6 packet routing.
6. Click the **Form** button at the bottom of the window to form a new Thread
Expand All @@ -168,6 +202,8 @@ To form a Thread network, complete the following steps:

$ sudo ip -6 route add fd11:22::/64 dev otbr0 via 2001:db8:1::2

<a name="configuring-hotspot"></a>

### Configuring Wi-Fi hotspot

To configure a Wi-Fi hotspot using a spare Wi-Fi card on your PC, complete the
Expand Down Expand Up @@ -228,11 +264,19 @@ command:
> example, you can use
> [isc-dhcp-server](https://help.ubuntu.com/community/isc-dhcp-server).
## Building and flashing nRF Connect Lock Example Application
<hr>

<a name="building-example"></a>

## Building and programming nRF Connect Lock Example Application

See
[nRF Connect Lock Example Application README](../../examples/lock-app/nrfconnect/README.md)
to learn how to build and flash the example onto an nRF52840 DK.
to learn how to build and program the example onto an nRF52840 DK.

<hr>

<a name="building-chiptool"></a>

## Building and installing Android CHIPTool

Expand Down Expand Up @@ -262,6 +306,10 @@ After building, install the application by completing the following steps:

CHIPTool is now ready to be used for commissioning.

<hr>

<a name="preparing-accessory"></a>

## Preparing accessory device

To prepare the accessory device for commissioning, complete the following steps:
Expand All @@ -280,6 +328,10 @@ To prepare the accessory device for commissioning, complete the following steps:
4. Open the URL in a web browser to have the commissioning QR code generated.
5. Push **Button 4** on the device to start Bluetooth LE advertising.

<hr>

<a name="commissioning-accessory"></a>

## Commissioning accessory device

To commission the accessory device onto the Thread network created in the
Expand All @@ -290,26 +342,36 @@ following steps:
2. Connect the smartphone to the Wi-Fi Hotspot created in the
[Configuring Wi-Fi hotspot](#Configuring-a-Wi-Fi-hotspot) section.
3. Open the CHIPTool application on your smartphone.
4. Tap the **SCAN QR CODE** button and scan the commissioning QR code.
5. Tap the **Rendezvous over BLE** button to initiate the commissioning
procedure. You will see a few pop-up messages appear as the commissioning
progresses. Eventually, the network settings screen appears.
6. In the new screen, open the **THREAD** tab.
7. Tap the **Save Network** button to send a Thread provisioning message to the
4. Tap the **PROVISION CHIP DEVICE WITH THREAD** button and scan the
commissioning QR code. Several notifications will appear, informing you of
commissioning progress with scanning, connection, and pairing. At the end of
this process, the Thread network settings screen appears.
5. In the Thread network settings screen, use the default settings and tap the
**SAVE NETWORK** button to send a Thread provisioning message to the
accessory device.

You will see the "Network provisioning completed" message when the accessory
device successfully joins the Thread network.

<hr>

<a name="sending-commands"></a>

## Sending CHIP commands

Once the device is commissioned, check the connection with the following
commands:
Once the device is commissioned, the following screen appears:

1. Go back to the main application screen.
2. Tap the **LIGHT ON/OFF CLUSTER** button.
3. Verify that the text box on the next screen contains the IPv6 address of the
accessory device.
4. Tap either the **ON** or the **OFF** button to lock or unlock the door,
respectively. The **LED 2** on the device turns on or off based on the
changes of the lock state.
![CHIPTool device control screen](../../docs/images/CHIPTool_device_commissioned.jpg)

This means that the provisioning is completed successfully and you are connected
to the device. Check the connection with the following steps:

1. Verify that the text box on the screen is not empty and contains the IPv6
address of the accessory device.
2. Tap the following buttons to change the lock state:

- **ON** and **OFF** buttons lock and unlock the door, respectively.
- **TOGGLE** changes the lock state to the opposite.

The **LED 2** on the device turns on or off based on the changes of the lock
state.
Binary file added docs/images/CHIPTool_device_commissioned.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions examples/all-clusters-app/all-clusters-common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ source_set("all-clusters-common") {
"gen/callback-stub.cpp",
]

cflags = [ "-Wconversion" ]

deps = [ "${chip_root}/src/lib" ]

public_configs = [ ":includes" ]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2020 Project CHIP Authors
* Copyright (c) 2021 Project CHIP Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,6 +15,8 @@
* limitations under the License.
*/

// THIS FILE IS GENERATED BY ZAP

// Prevent multiple inclusion
#pragma once

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2020 Project CHIP Authors
* Copyright (c) 2021 Project CHIP Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,6 +15,8 @@
* limitations under the License.
*/

// THIS FILE IS GENERATED BY ZAP

// Prevent multiple inclusion
#pragma once

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2020 Project CHIP Authors
* Copyright (c) 2021 Project CHIP Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,6 +15,8 @@
* limitations under the License.
*/

// THIS FILE IS GENERATED BY ZAP

// Prevent multiple inclusion
#pragma once

Expand Down
Loading

0 comments on commit 1a7b4d4

Please sign in to comment.