|
|
|
# IoT Gateway
|
|
|
|
|
|
|
|
## Upstream
|
|
|
|
|
|
|
|
* https://gitlab.eclipse.org/eclipse/oniro-blueprints/transparent-gateway
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
Requisites: 3 boards:
|
|
|
|
|
|
|
|
- https://gitlab.eclipse.org/eclipse/oniro-blueprints/transparent-gateway/meta-oniro-blueprints-gateway/-/issues/5
|
|
|
|
|
|
|
|
|
|
|
|
## Gateway
|
|
|
|
|
|
|
|
Sources:
|
|
|
|
|
|
|
|
- https://gitlab.eclipse.org/eclipse/oniro-blueprints/core/meta-oniro-blueprints-core/-/tree/master/recipes-connectivity/openthread/ot-br-posix
|
|
|
|
- https://gitlab.eclipse.org/eclipse/oniro-blueprints/core/meta-oniro-blueprints-core/-/tree/master/recipes-connectivity/openthread
|
|
|
|
- http://cgit.openembedded.org/meta-openembedded/tree/meta-networking/recipes-connectivity/openthread?h=kirkstone
|
|
|
|
- https://github.com/openthread/ot-br-posix
|
|
|
|
|
|
|
|
|
|
|
|
## Radio usb adapter
|
|
|
|
|
|
|
|
Sources:
|
|
|
|
|
|
|
|
- https://gitlab.eclipse.org/eclipse/oniro-core/meta-zephyr/-/blob/oniro/kirkstone/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-openthread-rcp.bb
|
|
|
|
- https://git.yoctoproject.org/meta-zephyr/log/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-openthread-rcp.bb
|
|
|
|
- https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/net/openthread/coprocessor
|
|
|
|
- https://openthread.io/platforms/co-processor
|
|
|
|
|
|
|
|
I used nrf52840dk-nrf52840 and deployed image using usb mount:
|
|
|
|
|
|
|
|
https://gitlab.eclipse.org/eclipse/oniro-core/oniro/-/issues/491
|
|
|
|
|
|
|
|
|
|
|
|
Plug nrf52840dk-nrf52840 to rpi4 usb and power on
|
|
|
|
|
|
|
|
```
|
|
|
|
dmesg
|
|
|
|
(...)
|
|
|
|
[ 2.470230] usb 1-1.3: Product: OpenThread CoProcessor NRF
|
|
|
|
(...)
|
|
|
|
[ 10.017199] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
|
|
|
|
[ 10.026571] usbcore: registered new interface driver cdc_acm
|
|
|
|
[ 10.033312] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
|
|
|
|
(...)
|
|
|
|
|
|
|
|
lsusb | grep OpenThread
|
|
|
|
Bus 001 Device 003: ID 2fe3:0100 NordicSemiconductor OpenThread CoProcessor NRF
|
|
|
|
|
|
|
|
sudo ot-ctl version
|
|
|
|
OPENTHREAD/thread-reference-20200818-1828-g424005f69; POSIX; Jul 22 2022 04:50:45
|
|
|
|
Done
|
|
|
|
|
|
|
|
ps aux | grep otbr
|
|
|
|
308 root 0:01 /usr/sbin/otbr-agent -I wpan0 -B eth0 spinel+hdlc+uart:///dev/ttyACM0 trel://eth0
|
|
|
|
|
|
|
|
sudo /usr/sbin/ot-ctl --help
|
|
|
|
# Run ot commands from:
|
|
|
|
# https://gitlab.eclipse.org/stefanschmidt/openthread-node-zephyr/-/blob/main/static-openthread-configuration.sh
|
|
|
|
|
|
|
|
sudo ip addr show wpan0
|
|
|
|
4: wpan0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1280 qdisc fq_codel state UNKNOWN group default qlen 500
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
## Node
|
|
|
|
|
|
|
|
### Sources:
|
|
|
|
|
|
|
|
- https://gitlab.eclipse.org/eclipse/oniro-blueprints/transparent-gateway/meta-oniro-blueprints-gateway/-/blob/main/meta-oniro-blueprints-gateway/recipes-kernel/zephyr-kernel/zephyr-blueprint-gateway-node_git.bb
|
|
|
|
- https://gitlab.eclipse.org/eclipse/oniro-blueprints/transparent-gateway/openthread-node-zephyr
|
|
|
|
- https://github.com/zephyrproject-rtos/zephyr/tree/main/modules/openthread/platform
|
|
|
|
|
|
|
|
### Usage
|
|
|
|
|
|
|
|
On node (arduino-nano-ble) :
|
|
|
|
|
|
|
|
```
|
|
|
|
uart:~$ ot help
|
|
|
|
|
|
|
|
uart:~$ ot version
|
|
|
|
OPENTHREAD/e2a765599; Zephyr; Jun 5 2022 11:19:10
|
|
|
|
Done
|
|
|
|
|
|
|
|
uart:~$ ot eui64
|
|
|
|
????????????????
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
Boot gateway
|
|
|
|
|
|
|
|
The use app to join wifi and add node, reset node
|
|
|
|
|
|
|
|
on node's console trace:
|
|
|
|
|
|
|
|
```
|
|
|
|
** Booting Zephyr OS build zephyr-v3.1.0 ***
|
|
|
|
[00:00:00.006,011] <inf> regulator_fixed: vdd_env onoff: 0
|
|
|
|
[00:00:00.006,103] <inf> ieee802154_nrf5: nRF5 802154 radio initialized
|
|
|
|
[00:00:00.024,047] <inf> fs_nvs: 8 Sectors of 4096 bytes
|
|
|
|
[00:00:00.024,078] <inf> fs_nvs: alloc wra: 0, fd8
|
|
|
|
[00:00:00.024,108] <inf> fs_nvs: data wra: 0, 10
|
|
|
|
[00:00:00.024,383] <inf> net_l2_openthread: State changed! Flags: 0x00038200 Current role: disabled
|
|
|
|
[00:00:00.024,536] <inf> net_l2_openthread: OpenThread version: OPENTHREAD/e2a765599; Zephyr; Jun 5 2022 11:19:10
|
|
|
|
[00:00:00.025,360] <inf> net_l2_openthread: State changed! Flags: 0x0900900b Current role: disabled
|
|
|
|
[00:00:00.030,426] <inf> net_config: Initializing network
|
|
|
|
[00:00:00.030,578] <inf> net_l2_openthread: State changed! Flags: 0x00000001 Current role: disabled
|
|
|
|
[00:00:00.030,670] <inf> openthreadnode: Oniro Gateway Blueprint OpenThread node
|
|
|
|
[00:00:05.395,751] <inf> net_l2_openthread: State changed! Flags: 0x0800c00b Current role: disabled
|
|
|
|
[00:00:09.058,166] <inf> net_l2_openthread: State changed! Flags: 0x08000000 Current role: disabled
|
|
|
|
[00:00:09.206,909] <inf> net_l2_openthread: State changed! Flags: 0x08000000 Current role: disabled
|
|
|
|
[00:00:09.267,028] <inf> net_l2_openthread: State changed! Flags: 0x18040100 Current role: disabled
|
|
|
|
[00:00:09.366,821] <inf> net_l2_openthread: Join success
|
|
|
|
[00:00:09.367,218] <inf> net_l2_openthread: State changed! Flags: 0x1800101f Current role: detached
|
|
|
|
[00:00:10.559,631] <inf> net_l2_openthread: State changed! Flags: 0x301b32b7 Current role: child
|
|
|
|
[00:00:10.559,722] <err> net_l2_openthread: Cannot add OpenThread unicast address
|
|
|
|
[00:00:10.559,997] <inf> net_l2_openthread: State changed! Flags: 0x00000001 Current role: child
|
|
|
|
[00:00:10.560,028] <err> net_l2_openthread: Cannot add OpenThread unicast address
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Notes
|
|
|
|
|
|
|
|
Connectivity: Support openthread protocol (ipv6) on Mesh network (radio). to be demonstrated along doorlock (and vending machine)
|
|
|
|
|
|
|
|
Hardware: Linux : RPi, +Seco boards?
|
|
|
|
|
|
|
|
Status: alpha
|
|
|
|
|
|
|
|
- [ ] https://gitlab.eclipse.org/groups/eclipse/oniro-core/-/epics/20
|
|
|
|
- [ ] https://gitlab.eclipse.org/eclipse/oniro-core/meta-zephyr-bsp/-/issues/1 (jasmine)
|
|
|
|
- https://gitlab.eclipse.org/eclipse/oniro-blueprints/transparent-gateway/openthread-node-zephyr
|
|
|
|
- [ ] https://gitlab.eclipse.org/eclipse/oniro-blueprints/transparent-gateway/meta-oniro-blueprints-gateway/-/issues/6
|
|
|
|
|
|
|
|
|
|
|
|
* [ ] https://gitlab.eclipse.org/eclipse/oniro-blueprints/transparent-gateway/meta-oniro-blueprints-gateway/-/merge_requests/4
|
|
|
|
|
|
|
|
Hints:
|
|
|
|
|
|
|
|
- https://docs.oniroproject.org/projects/blueprints/en/latest/transparent-gateway.html
|
|
|
|
- https://gitlab.eclipse.org/stefanschmidt/openthread-node-zephyr
|
|
|
|
- https://chat.ostc-eu.org/ostc/pl/ijfwfazw7jnnmmjrx5dzeffixh#OpenThread
|
|
|
|
- https://fosdem.org/2022/schedule/event/openthread_mesh_network/
|
|
|
|
- https://fosdem.org/2022/schedule/event/openthread_mesh_network/attachments/slides/4908/export/events/attachments/openthread_mesh_network/slides/4908/2022_02_06_FOSDEM_Running_an_OpenThread_network.pdf
|
|
|
|
|
|
|
|
|
|
|
|
#### Download
|
|
|
|
|
|
|
|
```
|
|
|
|
curl -O "https://siasky.net/CACYKjdfSNaw9zO4Q9xeC26yTel0-DfHfMilhyLD2UU73Q/#./file/blueprint-gateway-image-raspberrypi4-64-20220906221609.rootfs.wic.gz" # 158Mi465Ki880o = 0166152048c ~= 162258 Ki ~= 159 Mi ~= 1 Gi
|
|
|
|
md5sum blueprint-gateway-image-raspberrypi4-64-20220906221609.rootfs.wic.gz | grep "e75fb7ec6589475eee17a6af68638935"
|
|
|
|
|
|
|
|
curl -O "https://siasky.net/vAGYEEOZ4n487yeR251T1XbeVB_pKy_zwj6VNhCk1_ORUw/#./file/zephyr-blueprint-gateway-node.bin" # 369Ki364o = 0378220c ~= 370 Ki ~= 1 Mi ~= 1 Gi
|
|
|
|
md5sum zephyr-blueprint-gateway-node.bin | grep "c4248c085c5b6a655ceece44a7cbd0e7"
|
|
|
|
|
|
|
|
```
|
|
|
|
|