Pi 6LoWPAN SLIP radio

$14 USD

5 in stock

This is another way of making a border router out of a pi. Where the AT86RF233 module exposes the transceiver to the pi and has linux running the network stack, this module has a microcontroller (NXP KW41Z) to run the network stack and talks IPv6 to the pi over the UART via a SLIP link. The SWD pins are also routed to the pi for programming and debugging.

I'm running Riot on this mostly. The gnrc-border-router example is a good starting point. It sets up a SLIP interface to the pi and serves a /64 on the wireless interface and routes between them. You can also run the OpenThread firmware for frdm-kw41z without modification but I haven't done much with that.

The main relevant difference between attaching an SPI transceiver directly to linux on the pi versus adding a microcontroller that runs the network stack is that the network stacks in linux and embedded OSs like Riot are still in different states of maturity and that means that some things are only available on one platform or the other, and that the interoperability between platforms is incomplete. So if for instance you're running Riot on your end devices you may want the border router to run Riot too in some cases. Anyway that's the need I had when I made this. Also of course it's useful to have both options for development purposes.

10 Comments

Mesut

July 11, 2019, 11:46 a.m.

hi,i have this 802.15.4 network that operates on channel 26 with panid 0xbeef.2 of my raspberrys can ping each other using Raspberry Pi 802.15.4 radio modules.what i want to do is to use 6LoWPAN SLIP radio module as an interface like your tap0: solution and ping both devices. Is this possible and if so what are steps needed to be done

Mesut

July 11, 2019, 2:04 p.m.

I am receiving this error with the method that you write for Murat

write to fd 4 failed: Success
write to fd 4 failed: Success
write to fd 4 failed: Success
write to fd 4 failed: Success
write to fd 4 failed: Success
write to fd 4 failed: Success
write to fd 4 failed: Success
write to fd 4 failed: Success
write to fd 4 failed: Success
write to fd 4 failed: Success
write to fd 4 failed: Success
write to fd 4 failed: Success
write to fd 4 failed: Success
write to fd 4 failed: Success
write to fd 4 failed: Success
write to fd 4 failed: Success
write to fd 4 failed: Success
write to fd 4 failed: Success
write to fd 4 failed: Success
write to fd 4 failed: Success
write to fd 4 failed: Success
write to fd 4 failed: Success
write to fd 4 failed: Success
write to fd 4 failed: Success

benemorius

July 11, 2019, 4:16 p.m.

What command gave that output? I haven't seen it before.

Murat

July 11, 2019, 4:57 p.m.

RIOT / dist / tools / ethos / start_network.sh / dev / ttyAMA0 tap0 2001: db8: ffff: ffff :: / 64 921600 We received this error when we ran a similar command. I think we couldn't introduce the 6lowpan slip module on the raspberry. We would like to introduce the slip module via raspberry pi 3 b + and enable ipv6. we have 2 raspberry 802.15.4 modules and 2 6lowpan slip modules. our goal is to run each raspberry pi 6lowpan network we want to establish.

benemorius

July 11, 2019, 5:19 p.m.

Ok that narrows it down but now I don't know which line of the script generates the error. Please can you prepend sh -x to the start_network.sh command to see which command causes the error?

root@ocd:~ # sh -x RIOT/dist/tools/ethos/start_network.sh /dev/ttyAMA0 tap0 2001:db8:ffff:ffff::/64 921600
+ readlink -f RIOT/dist/tools/ethos/start_network.sh
+ dirname RIOT/dist/tools/ethos/start_network.sh
+ ETHOS_DIR=RIOT/dist/tools/ethos
+ PORT=/dev/ttyAMA0
+ TAP=tap0
+ PREFIX=2001:db8:ffff:ffff::/64
+ BAUDRATE=115200
+ readlink -f RIOT/dist/tools/ethos/../uhcpd/bin
+ UHCPD=RIOT/dist/tools/uhcpd/bin/uhcpd
+ [ -z /dev/ttyAMA0 -o -z tap0 -o -z 2001:db8:ffff:ffff::/64 ]
+ [ ! -z 921600 ]
+ BAUDRATE=921600
+ trap cleanup INT QUIT TERM EXIT
+ create_tap
+ ip tuntap add tap0 mode tap user root
+ sysctl -w net.ipv6.conf.tap0.forwarding=1
net.ipv6.conf.tap0.forwarding = 1
+ sysctl -w net.ipv6.conf.tap0.accept_ra=0
net.ipv6.conf.tap0.accept_ra = 0
+ ip link set tap0 address aa:aa:aa:be:ee:ef
+ ip link set tap0 up
+ ip a a fe80::1/64 dev tap0
+ ip a a fd00:dead:beef::1/128 dev lo
+ ip route add 2001:db8:ffff:ffff::/64 via fe80::2 dev tap0
+ start_uhcpd
+ UHCPD_PID=23038
+ RIOT/dist/tools/ethos/ethos tap0 /dev/ttyAMA0 921600
+ RIOT/dist/tools/uhcpd/bin/uhcpd tap0 2001:db8:ffff:ffff::/64
----> ethos: sending hello.
----> ethos: activating serial pass through.

Mesut

July 12, 2019, 1:44 a.m.

The error message is generated by ethos, i've checked the code and this message is generated by checked_write() function int ethos.c

Below is the output you've requested.
----------

root@raspberrypi:~/RIOT# cd ..
root@raspberrypi:~# sh -x RIOT/dist/tools/ethos/start_network.sh /dev/ttyAMA0 tap0 2001:db8:ffff:ffff::/64 921600
+ readlink -f RIOT/dist/tools/ethos/start_network.sh
+ dirname /root/RIOT/dist/tools/ethos/start_network.sh
+ ETHOS_DIR=/root/RIOT/dist/tools/ethos
+ PORT=/dev/ttyAMA0
+ TAP=tap0
+ PREFIX=2001:db8:ffff:ffff::/64
+ BAUDRATE=115200
+ readlink -f /root/RIOT/dist/tools/ethos/../uhcpd/bin
+ UHCPD=/root/RIOT/dist/tools/uhcpd/bin/uhcpd
+ [ -z /dev/ttyAMA0 -o -z tap0 -o -z 2001:db8:ffff:ffff::/64 ]
+ [ ! -z 921600 ]
+ BAUDRATE=921600
+ trap cleanup INT QUIT TERM EXIT
+ create_tap
+ ip tuntap add tap0 mode tap user root
+ sysctl -w net.ipv6.conf.tap0.forwarding=1
net.ipv6.conf.tap0.forwarding = 1
+ sysctl -w net.ipv6.conf.tap0.accept_ra=0
net.ipv6.conf.tap0.accept_ra = 0
+ ip link set tap0 up
+ ip a a fe80::1/64 dev tap0
+ ip a a fd00:dead:beef::1/128 dev lo
+ ip route add 2001:db8:ffff:ffff::/64 via fe80::2 dev tap0
+ start_uhcpd
+ + /root/RIOT/dist/tools/uhcpd/bin/uhcpd tap0 2001:db8:ffff:ffff::/64
UHCPD_PID=1013
+ /root/RIOT/dist/tools/ethos/ethos tap0 /dev/ttyAMA0 921600
----> ethos: sending hello.
write to fd 4 failed: Success
write to fd 4 failed: Success
write to fd 4 failed: Success
----> ethos: activating serial pass through.
write to fd 4 failed: Success
write to fd 4 failed: Success
write to fd 4 failed: Success
^C+ cleanup
+ echo Cleaning up...
Cleaning up...
+ remove_tap
+ ip tuntap del tap0 mode tap
+ ip a d fd00:dead:beef::1/128 dev lo
+ kill 1013
+ trap INT QUIT TERM EXIT
root@raspberrypi:~#

Murat

July 15, 2019, 12:41 a.m.

Benemorius,
Do you have any comments with the printout sent by Mesut? We're stuck here. :(
thanks.

Mesut

July 16, 2019, 10:25 a.m.

Dude, we've kinda stuck here as Murat points out. Could you please check and get back to us ?

Murat

July 5, 2019, 3:30 a.m.

Hi All,
Pi 6LoWPAN SLIP radio module which kernel also works successfully. How do I install this module in rpi3 ?

benemorius

July 7, 2019, 7:36 a.m.

I have encountered no limitations with linux kernel versions for this one.

1) install master branch of openocd using instructions here.

2) flash gnrc_border_router Riot firmware onto slip module:

apt install gcc-arm-none-eabi gdb-arm-none-eabi
git clone https://github.com/benemorius/RIOT.git
cd RIOT/examples/gnrc_border_router
DEFAULT_CHANNEL=11 ETHOS_BAUDRATE=921600 CFLAGS+="-DSTDIO_UART_BAUDRATE=921600 -DDEBUG_ASSERT_VERBOSE -DKW41ZRF_ENABLE_LEDS=1" USEMODULE+="periph_rtc netstats_l2 netstats_ipv6" BOARD=openlabs-kw41z-slip make -j4 flash
It might be better to use a more recent arm toolchain from here. Also it's faster to compile Riot on something much faster than a Pi if you're going to be reprogramming it often.

3) start ethos script:
RIOT/dist/tools/ethos/start_network.sh /dev/ttyAMA0 tap0 2001:db8:ffff:ffff::/64 921600

Leave a comment