Friday, August 21, 2020

Running OpenThread Border Router and device with Raspberry Pi and Silicon Labs EFR32 Kits

Silicon Labs releases Simplicity Studio v5 which supports OpenThread in the end of July 2020. To run the whole thing, you will need one Raspberry Pi, one SLWSTK6000B (BRD4001A+BRD4161A to act as OpenThread RCP connecting to OpenThread Border Router running on Raspberry Pi), and one SLWSTK6006A (BRD4001A+BRD4180A to act as OpenThread device to join Thread network). 


 

In the following steps, I will show you how to run OpenThread Border Router and device with Raspberry Pi and Silicon Labs EFR32 Kits.

 

1. Create and build OpenThread RCP to run on SLWSTK6000B .

1.1 Start  Simplicity Studio v5 and select ot-rcp project from EXAMPLE PROJECTS on Laucher

1.2 Switch to Simplicity IDE tab and open ot-rcp.slcp. Click "Force Generation" to generate codes and click "Build" button to build the project.

1.3 Download ot-rcp.s37 to SLWSTK6000B .


2. Setup OpenThread Border Router on Raspberry Pi.

2.1 Download Raspbian Stretch Lite OS image and put it on SD card. Insert the SD card into Raspberry Pi and power on it. Enable ssh access on Raspberry Pi and remote login with TeraTerm.

2.2 Run the following command to get OpenThread Border Router project (I use commit a69a9d5c82d25b6d3c6ddd5ac29d80676b34465f in my test).

      sudo apt-get update

      sudo apt-get install -y git

      git clone https://github.com/openthread/ot-br-posix

      cd ot-br-posix

      git checkout 28991cdf9f3c8794ccfa5843685228e8d93470a7

      git submodule update --init --recursive

2.3 Build and install OpenThread Border Router

      ./script/bootstrap

      ./script/setup

2.4 Connect SLWSTK6000B running OpenThread RCP to Raspberry PI by USB cable and make sure SLWSTK6000B simulates ttyACM0 under /dev.

2.5 Reboot OpenThread Border Router

      sudo reboot

2.6 After reboot, you can start a browser and use http://ip-of-raspberry-pi-border-router to access to web page of OpenThread Border Router.

 

2.7 Switch to Form tab and click "FORM" button to form a Thread Network.


3. Create and build OpenThread Cli-FTD to run on SLWSTK6006A .

3.1 Start  Simplicity Studio v5 and select ot-cli-ftd project from EXAMPLE PROJECTS on Laucher

 

3.2 Switch to Simplicity IDE tab and open ot-cli-ftd.slcp. Click "Force Generation" to generate codes and click "Build" button to build the project.

3.3 Download ot-cli-ftd.s37 to SLWSTK6006A .


4. Commission ot-cli-ftd running on SLWSTK6006A to Openthread Border Router.

4.1 Run commissioner and add device eui64/PSK to commissioner on Raspberry Pi console.

      sudo ot-ctl commissioner start

      sudo ot-ctl commissioner joiner add 000d6ffffe0a457b J01NME

4.2 Start ot-cli-ftd and run joiner with PSK to join OpenThread network.

      ifconfig up
      joiner start J01NME

      thread start


4.3 Try to ping ot-cli-ftd from OpenThread Border Router to make sure device joins.

 

4.4 Test the connectivity between the Joiner device in the Thread network and the external internet by pinging a public IPv4 address, such as 64:ff9b::808:808 (the Well-Known Prefix of 64:ff9b::/96 and an IPv4 address of 8.8.8.8 (Google Public DNS) combine to form an IPv6 address of 64:ff9b::808:808). Remember to do "thread start" before you do "ping 64:ff9b::808:808"


1 comment:

  1. Thank you for your post! This was the most complete tutorial that just worked for me, a novice wanting to learn about Thread, even at the end of 2021.

    ReplyDelete