1. Overview
In this Codelab, you will learn how to build an Radio CoProcess for an OpenThread Border Router on a Raspberry Pi. OpenThread is an open-source implementation of the Thread networking protocol, designed for low-power IoT devices
What You'll Build
In this codelab, you will:
- Build the Radio Co-Processor for NRF52840 dongle on a Raspberry Pi.
- Learn about the concept of a radio co processor
What You'll Learn
- What you will need (Pre-requisities)
- How to clone radio co processor code
- What prerequisites are required for the Raspberry Pi
- How to build the radio co processor on the Raspberry Pi
2. What you will need (Pre-requisities)
Before you begin, ensure you have the following:
- A Thread Radio Co-Processor (NRF52840 dongle)
- A Raspberry Pi (preferably a Raspberry Pi 3 or later)
- A microSD card (16GB or larger) with Raspberry Pi OS installed
- A power supply for the Raspberry Pi
- Internet connection for the Raspberry Pi
- Basic knowledge of using the terminal and SSH
The total codelab will take approximately a Duration of 30 minuates
to complete.
3. Install the Radio Co-Processor firmware
In this example we are using the nRF52840 USB Dongle
The dongle may come pre-loaded with the older NCP firmware, so first we need to update it to the latest version with the RCP firmware. This required fetching the source and building on a laptop, then flashing the dongle.
- Clone the OpenThread nRF528xx platform repository into the current directory:
git clone --recursive https://github.com/openthread/ot-nrf528xx.git
Enter the ot-nrf528xx directory:
cd ot-nrf528xx
- Install OpenThread dependencies:
./script/bootstrap
- Build OpenThread for the nRF52840 Dongle:
script/build nrf52840 USB_trans -DOT_BOOTLOADER=USB -DOT_THREAD_VERSION=1.2
This creates an RCP image at build/bin/ot-rcp.
- Convert the RCP image to the .hex format:
cd buiLd/bin
arm-none-eabi-objcopy -O ihex ot-rcp ot-rcp.hex
- Install NRFUtil
apt-get -y install libusb-1.0-0-dev python3 python3-pip sed
pip3 install click crcmod ecdsa intelhex libusb1 piccata protobuf
pip3 install pyserial pyyaml tqdm pc_ble_driver_py pyspinel
pip3 install --no-dependencies nrfutil==6.1.7
This installs the utility that allows for flashing the NRF dongle
- Generate the package
$ nrfutil pkg generate \
--hw-version 52 \
--sd-req 0x00 \
--application-version 1 \
--application ot-rcp.hex \
app.zip
- Flash the dongle
To put the dongle into flash mode press the reset button and when you release the red LED will glow.
$ nrfutil dfu usb-serial \
-pkg app.zip \
-p /dev/ttyACM0
Once the nRF52840 Radio Co-Processor is ready, you can now prepare the Raspberry Pi as an Open Thread Border Router.
4. Install the Open Thread Border Router
- Install dependencies:
If you havent already install the dependencies, open the terminal and execute:
sudo apt-get install git cmake make gcc g++ autoconf libtool libssl-dev
- Clone the OpenThread Border Router repository:
Run the following commands:
git clone https://github.com/openthread/ot-br-posix.git
cd ot-br-posix
- Install and configure OpenThread:
Follow the instructions to download the code and the run the bootstrap, which will download all the necessary dependencies, packages and tools (may take a while).
./script/bootstrap
Finally, run the OTBR setup (eth0 is my LAN connection; you can also use WiFi). I also enabled the Web GUI for evaluation, although it has no security authentication so I would not recommend running it on a real system.
INFRA_IF_NAME=eth0 WEB_GUI=1 ./script/setup
After setup you can check no errors were reported on the screen, plug in the Radio Co-Processor dongle, and then reboot with
sudo shutdown -r now
5. Further Information
Checkout the official documentation here: Project Chip - ConnectedHomeIp