Wednesday, February 24, 2021

Project Connected Home over IP (ProjectCHIP) demonstration with EFR32 as ProjectCHIP node, Raspberry Pi as OTBR, and Ubuntu VM as chip-tool

 The follow steps show you how to setup Project Connected Home over IP (ProjectCHIP) demonstration with EFR32 as ProjectCHIP node, Raspberry Pi as OTBR, and Ubuntu VM as chip-tool like in the diagram.



1. Install VirtualBox and Ubuntu 20.04 on your Desktop. Remember select "Bridged Adapter" in your network settings of VirtualBox/Ubuntu.

2. Setup environment (run the following commands in Ubuntu terminal) for building CHIP examples on Ubuntu VM.

    2.1 sudo apt-get install git gcc g++ python pkg-config libssl-dev libdbus-1-dev libglib2.0-dev libavahi-client-dev ninja-build python3-venv python3-dev unzip

    2.2.1 cd ~
    2.2.2 git clone https://github.com/SiliconLabs/sdk_support.git
    2.2.3 cd sdk_support
    2.2.4 git checkout ff45be117a5a1a20d27296628b0632523f65c66a

    2.3.1 cd ~
    2.3.2 git clone https://github.com/project-chip/connectedhomeip.git
    2.3.3 cd connectedhomeip
    2.3.4 git checkout 122da92801fd38f49b8fe3db397ccaa4eb0e4798
    2.3.5 source scripts/activate.sh
    2.3.6 gn gen out/host
    2.3.7 ninja -C out/host

3. Build and download CHIP lock-app for EFR32 (In my examples, I use BRD4180A with BRD4001A to act as Thread node running CHIP protocol)

    3.1 cd ~/connectedhomeip/examples/lock-app/efr32
    3.2 git submodule update --init
    3.3 source third_party/connectedhomeip/scripts/activate.sh
    3.4 export EFR32_SDK_ROOT=~/sdk_support
    3.5 export EFR32_BOARD=BRD4180A
    3.6 gn gen out/debug --args="efr32_sdk_root=\"${EFR32_SDK_ROOT}\" efr32_board=\"${EFR32_BOARD}\""
    3.7 ninja -C out/debug
    3.8 Using Simplicity Studio Commander to download chip-efr32-lock-example.s37 under out/debug folder into BRD4180A.

4. Refer to "Running OpenThread Border Router and device with Raspberry Pi and Silicon Labs EFR32 Kits" to setup OpenThread Border Router on Raspberry Pi.

5. Run the following commands in OpenThread Border Router terminal to setup Thread network for commission.

    5.1.1 sudo ot-ctl dataset init new
    5.1.2 sudo ot-ctl dataset channel 13
    5.1.3 sudo ot-ctl dataset panid 0xface
    5.1.4 sudo ot-ctl dataset extpanid face1111face2222
    5.1.5 sudo ot-ctl dataset networkname OpenThreadYKTest
    5.1.6 sudo ot-ctl dataset masterkey 00112233445566778899aabbccddeeff
    5.1.7 sudo ot-ctl dataset commit active

    5.2.1 sudo ot-ctl prefix add 2001:db8::/64 pasor
    5.2.2 sudo ot-ctl ifconfig up
    5.2.3 sudo ot-ctl thread start
    5.2.4 sudo ot-ctl netdata register
    5.2.5 sudo ot-ctl state
    5.2.6 sudo ot-ctl ipaddr


    5.3.1 sudo ip addr add dev eth0 2002::2/64

 
6. Run the following commands on terminal of EFR32 CHIP lock-app device (build and download in step 3)

    6.1 factoryreset
    6.2 dataset channel 13
    6.3 dataset panid 0xface
    6.4 dataset masterkey 00112233445566778899aabbccddeeff
    6.5 dataset commit active
    6.6 ifconfig up
    6.7 thread start
    6.8 ipaddr

7. Try to ping EFR32 CHIP lock-app device from Raspberry Pi border router to make sure it respond.


8. Add route (enp0s3 might be different on your VM) on Ubuntu VM to access to EFR32 CHIP lock-app device

    8.1 sudo ifconfig enp0s3 inet6 add 2002::1/64
    8.2 sudo ip route add 2001:db8:0:0::/64 via 2002::2
    8.3 sudo ip route add fd38:117c:3b66::/64 via 2002::2


     8.4Try to ping EFR32 CHIP lock-app device from Ununtu VM terminal this time to make sure it respond.

 


9. Build and run chip-tool on Ubuntu VM

    9.1 cd ~/connectedhomeip/examples/chip-tool
    9.2 git submodule update --init
    9.3 source third_party/connectedhomeip/scripts/activate.sh
    9.4 gn gen out/debug
    9.5 ninja -C out/debug

    9.6 run "./chip-tool onoff on 2001:DB8::C6CC:14E9:E7D1:A3EA 11097 1" to send onoff command on Ubuntu VM terminal to control EFR32 CHIP lock-app device

 


    9.7 Using J-link RTT Viewer to check if EFR32 CHIP lock-app device receives CHIP command.


P.S. This demostartion is based on steps in https://www.silabs.com/documents/public/training/wireless/chip-connected-home-over-ip-lab.pdf. However, there are some typo and ambiguous in the document and here I share the whole steps again according to my test.

1 comment:

  1. Hi there, now I guess you are the only one who can guide me. Sorry for commenting here, I didn't found a way to connect to you. I want to connect a DHT11 Sensor to CC2650 Launchpad. I have gone through your posts of the OPT3001 Sensor and HDC1080 Sensor, but unable to figure out.

    ReplyDelete