An OpenThread Border Router firmware port for Atmel-R21 (Microchip samr21) based ConBee II and RaspBee II.
Note: the port is still in development, watch this repository to get notified when first beta test version is released.
This Part describes how to build the openthread RCP-firmware from source. This will be obsolete once the .gcf image is available.
Prerequisites:
Clone this Repo:
git clone https://github.com/dresden-elektronik/openthread-r21
cd into the directory and init the openthread and tinyusb submodule
cd openthread-r21
git submodule update --init openthread/
git submodule update --init third_party/tinyusb
git submodule update --init --recursive --depth 1
3. execute the bootstrap script (This will install necessary dependencies and download the arm-none-eabi-gcc **x86** Toolchain)
```console
bash script/bootstrap.sh
If your are on an unsupported Platform, you will have to manually install the following dependencies: automake, g++, libtool, make, cmake, ninja-build, shellcheck
build the RCP-Firmware
bash script/build.sh
Done! You will find the linked Firmware (.elf Format) at /openthread/out/build/ot-rcp
This Part describes how to flash the previously build RCP-firmware onto the samr21 ROM-Flash by using a OpenOCD compatible Debugging Tool.
Install OpenOCD (This Step may be skipped on debian and fedora based Systems, bootstrap.sh should install OpenOCD via apt or dnf )
Find the Open-OCD configuration file for your Debugger (Checkout eLinux-Page where to find your config File)
A Configuration for the ATMEL-ICE and the ATSAMR21ZLL-EK are provided in script/openocd_config/. You can also use them as a Template for your config
Start an OpenOCD-Server (Do this in a seperate Terminal, this may require sudo-rights) Make Sure Your Devices are Powered!
#For Atmel-ICE
(sudo) openocd -f script/openocd_config/ATMEL-ICE-OpenOCD-samr21e18a.cfg
(sudo) openocd -f
If everything goes well, you should see the following Output:
```console
Info : Listening on port 3333 for gdb connections
gcc-arm-none-eabi/bin/arm-none-eabi-gdb \
--init-eval-command='target extended-remote localhost:3333' \
./out/build/bin/ot-rcp \
--eval-command='load'
Reset the MCU (via gdb shell)
(gdb) r
Exit GDB by pressing CTRL + C and typing quit into the GDB Shell:
(gdb) quit
Done! The Firmware on your Device is ready to act as an Openthread-RCP Dongle
This Part describes how to prepare a host Platform to operate as a Openthread Border Router in conjunction with the connected RCP-Device. It is strongly advised to follow the Guide on the Official Openthread Website.
Tested on Debian11/Ubuntu22.04LTS/RaspberryPiOS(32Bit)
Start with a fresh OS-Installation on whatever Platform you are planning to Use (Like RaspberryPi, VM, NUC).
The OpenThread Border Router works best with debian based Platforms
On your desired Host-Platform clone into the Openthread-Borader-Router-repository
git clone https://github.com/openthread/ot-br-posix
cd ot-br-posix
(sudo) bash script/bootstrap
#Raspberry Pi on Ethernet
(sudo) bash INFRA_IF_NAME=eth0 ./script/setup
(sudo) bash INFRA_IF_NAME=wlan0 ./script/setup
4. Check if the serial connection got initialized correctly
```console
ls /dev/ | grep tty*
should return something like
ttyACM0
or
ttyACM1
(sudo) nano /etc/default/otbr-agent
The Device will likely aper as /dev/ttyACM0 but you should double check that with something like dmesg. You should modify your config-file according to your system. Some examples:
WIFI and RCP mapped to /dev/ttyACM0
OTBR_AGENT_OPTS="-I wpan0 -B wlan0 spinel+hdlc+uart:///dev/ttyACM0 trel://wlan0"
Ethernet and RCP mapped to /dev/ttyACM1
OTBR_AGENT_OPTS="-I wpan0 -B eth0 spinel+hdlc+uart:///dev/ttyACM1 trel://eth0"
After modifying the otbr-agent config-file you should reboot your Host.
sudo reboot now
After Reboot you should be able to reach the Openthread Border Router Web-Interface by typing
http://YOURHOSTADDR/
into your Web-Browser