Skip to content

Commit babc03a

Browse files
Added basic readme for nrf52840 for Thread
1 parent 18c0ccb commit babc03a

File tree

3 files changed

+72
-4
lines changed

3 files changed

+72
-4
lines changed

.templates/otbr/readme.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# OTBR (Open Thread Border Router)
2+
3+
The container will fail to show the WUI until IPv6 is enabled on the RPi. You can do so by running the following commands:
4+
```
5+
$ sudo modprobe ip6_tables
6+
$ sudo modprobe ip6table_filter
7+
```
8+
9+
Save between reboots:
10+
```
11+
$ echo "ip6_tables" | sudo tee -a /etc/modules
12+
$ echo "ip6table_filter" | sudo tee -a /etc/modules
13+
```
14+
15+
Open docker config `sudo nano /etc/docker/daemon.json`:
16+
```
17+
{
18+
"ipv6": true,
19+
"fixed-cidr-v6": "2001:db8:1::/64"
20+
}
21+
```
22+
23+
Then:
24+
```
25+
$ sudo systemctl restart docker
26+
```
27+
28+
I have this successfully working with a MakerDiary nrf52840 USB Thread radio node. It requires custom firmware flashed on it.
29+
30+
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).
31+
32+
Run the following commands in the `openthread/environment` docker instance:
33+
```
34+
$ git clone https://github.com/openthread/ot-nrf528xx.git
35+
$ cd ot-nrf528xx/
36+
$ git submodule update --init
37+
$ ./script/build nrf52840 USB_trans -DOT_BOOTLOADER=USB
38+
```
39+
40+
After this, it depends on the type of nRF52840 you're using. If you are using a MakerDiary, mount it as a drive and drag the UF2 file into it, after converting it to a .hex file, and then a UF2 file:
41+
```
42+
$ arm-none-eabi-objcopy -O ihex build/bin/ot-cli-ftd ot-cli-ftd.hex
43+
$ pip install --pre -U git+https://github.com/makerdiary/uf2utils.git@main
44+
$ uf2conv -f 0xADA52840 -c -b 0x1000 -o build/bin/ot-cli-ftd.uf2 build/bin/ot-cli-ftd
45+
```
46+
47+
Since I run Zigbee and zwave on the same device, I mounted the nRF52840 this way `compose-override.yml`:
48+
```
49+
services:
50+
otbr:
51+
volumes:
52+
- ./volumes/otbr/data:/var/lib/otbr
53+
- ./volumes/otbr/wpantund:/etc/wpantund.conf
54+
- ./volumes/otbr/config:/etc/otbr
55+
- /dev/serial/by-id/usb-Nordic_Semiconductor_nRF528xx_OpenThread_Device_XXXXXXXXXXX-if00:/dev/ttyACM0
56+
```
57+
58+
Note the device serial number has been replaced with Xs. You can find yours by running:
59+
```
60+
ls -ahl /dev
61+
```
62+
63+
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.
64+
65+
Links:
66+
* https://openthread.io/guides/border-router/docker (OTBR running in docker)
67+
* https://openthread.io/guides/build/index.md (Radio/Node/RCP binary compile and firmware flashing)
68+
* https://openthread.io/guides/border-router/raspberry-pi (Running on RPi 3+ bare-metal)

.templates/otbr/service.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ otbr:
1717
- ./volumes/otbr/wpantund:/etc/wpantund.conf
1818
- ./volumes/otbr/config:/etc/otbr
1919
ports:
20-
- "80:8283"
20+
- "8283:80"
2121
command: >
2222
--radio-url spinel+hdlc+uart:///dev/ttyX # Example
2323

.templates/python-matter-server/service.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ python-matter-server:
77
- apparmor=unconfined
88
volumes:
99
- ./volumes/python-matter-server/data:/data
10-
ports: # For reference only. Matter requires these ports.
11-
- "5580:5580"
12-
- "5080:5080"
10+
# ports: # For reference only. Matter requires these ports.
11+
# - "5580:5580"
12+
# - "5080:5080"
1313
command: >
1414
--storage-path /data
1515

0 commit comments

Comments
 (0)