Skip to content

Commit

Permalink
Added basic readme for nrf52840 for Thread
Browse files Browse the repository at this point in the history
  • Loading branch information
Slyke committed Nov 8, 2024
1 parent 18c0ccb commit 30aa221
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 4 deletions.
68 changes: 68 additions & 0 deletions .templates/otbr/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# OTBR (Open Thread Border Router)

The container will fail to show the WUI until IPv6 is enabled on the RPi. You can do so by running the following commands:
```
$ sudo modprobe ip6_tables
$ sudo modprobe ip6table_filter
```

Save between reboots:
```
$ echo "ip6_tables" | sudo tee -a /etc/modules
$ echo "ip6table_filter" | sudo tee -a /etc/modules
```

Open docker config `sudo nano /etc/docker/daemon.json`:
```
{
"ipv6": true,
"fixed-cidr-v6": "2001:db8:1::/64"
}
```

Then:
```
$ sudo systemctl restart docker
```

I have this successfully working with a MakerDiary nrf52840 USB Thread radio node. It requires custom firmware flashed on it.

You can flash the USB card with the `openthread/environment:latest` docker image. You only need to flash the firmware once to the USB radio, it has ran on every device I've tested running OTBR: baremetal, Docker, IOTstack, and Kubernetes (containerd).

Run the following commands in it:
```
$ git clone https://github.com/openthread/ot-nrf528xx.git
$ cd ot-nrf528xx/
$ git submodule update --init
$ ./script/build nrf52840 USB_trans -DOT_BOOTLOADER=USB
```

After this, it depends on the type of nRF52840. If you are using aMakerDiary, mount it as a drive and drag the UF2 file into it, after converting it to a .hex file:
```
$ arm-none-eabi-objcopy -O ihex build/bin/ot-cli-ftd ot-cli-ftd.hex
$ pip install --pre -U git+https://github.com/makerdiary/uf2utils.git@main
$ uf2conv -f 0xADA52840 -c -b 0x1000 -o build/bin/ot-cli-ftd.uf2 build/bin/ot-cli-ftd
```

Since I run Zigbee and zwave on the same device, I mounted the nRF52840 this way `compose-override.yml`:
```
services:
otbr:
volumes:
- ./volumes/otbr/data:/var/lib/otbr
- ./volumes/otbr/wpantund:/etc/wpantund.conf
- ./volumes/otbr/config:/etc/otbr
- /dev/serial/by-id/usb-Nordic_Semiconductor_nRF528xx_OpenThread_Device_XXXXXXXXXXX-if00:/dev/ttyACM0
```

Note the device serial number has been replaced with Xs. You can find yours by running:
```
ls -ahl /dev
```

You need to have flashed it with the OTBR firmware before running this command, as it will have a different name if running the stock firmware.

Links:
* https://openthread.io/guides/border-router/docker (OTBR running in docker)
* https://openthread.io/guides/build/index.md (Radio/Node/RCP binary compile and firmware flashing)
* https://openthread.io/guides/border-router/raspberry-pi (Running on RPi 3+ bare-metal)
2 changes: 1 addition & 1 deletion .templates/otbr/service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ otbr:
- ./volumes/otbr/wpantund:/etc/wpantund.conf
- ./volumes/otbr/config:/etc/otbr
ports:
- "80:8283"
- "8283:80"
command: >
--radio-url spinel+hdlc+uart:///dev/ttyX # Example
6 changes: 3 additions & 3 deletions .templates/python-matter-server/service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ python-matter-server:
- apparmor=unconfined
volumes:
- ./volumes/python-matter-server/data:/data
ports: # For reference only. Matter requires these ports.
- "5580:5580"
- "5080:5080"
# ports: # For reference only. Matter requires these ports.
# - "5580:5580"
# - "5080:5080"
command: >
--storage-path /data

0 comments on commit 30aa221

Please sign in to comment.