This post explains steps to set up a 6LowPAN wireless sensor network using SensorTag based on Cotiki examples and an edge router running 6lbr. Nodes can be accessed from web browser. The post combines previous posts into one place for reference. In summary

  • 6LowPAN edge router = ContikiInstant virtual machine + 6lbr + SensorTag as SLIP radio + contiki/examples/ipv6/slip-radio.
  • Sensor nodes = SensorTag + contiki/examples/cc26xx/cc26xx-web-demo.
  • Access from IPv6 network using the Windows machine hosting the ContikiInstant virtual machine.

Edge router

The previous post explained how to configure 6lbr on ContikiInstant, or any Linux host, with a SensorTag as SLIP radio. Basically, the steps are:

Firstly, install 6lbr onto the Linux host

$ cd $HOME
$ sudo apt-get install ncurses-dev
$ sudo apt-get install bridge-utils
$ git clone --recursive https://github.com/cetic/6lbr
$ cd 6lbr/examples/6lbr
$ make all_native plugins tools
$ sudo make install

After that, configure 6lbr by running $ sudo nano /etc/6lbr/6lbr.conf, then edit

MODE=ROUTER

RAW_ETH=0
BRIDGE=1
CREATE_BRIDGE=0
DEV_BRIDGE=br0
DEV_TAP=tap0
DEV_ETH=eth0

RAW_ETH_FCS=0

DEV_RADIO=/dev/ttyACM0
BAUDRATE=115200

IFUP=/usr/lib/6lbr/6lbr-ifup
IFDOWN=/usr/lib/6lbr/6lbr-ifdown

Remember to check DEV_RADIO by $ dmesg | grep tty and $ lsusb

Create a bridge in network interface $ sudo nano /etc/network/interfaces

auto lo

iface lo inet loopback

iface eth0 inet static
address 0.0.0.0

auto br0
iface br0 inet dhcp
    bridge_ports eth0
    bridge_stp off
    up echo 0 > /sys/devices/virtual/net/br0/bridge/multicast_snooping
    post-up ip link set br0 address `ip link show eth0 | grep ether | awk '{print $2}'`

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet dhcp

Finally, reboot and start 6lbr

$ sudo service 6lbr start

Check 6lbr settings

$ /usr/lib/6lbr/bin/nvm_tool --print /etc/6lbr/nvm.dat

By default, 6lbr uses channel 26, update it to 25 as it will be used by SensorTags

$ /usr/lib/6lbr/bin/nvm_tool --update --channel 25 /etc/6lbr/nvm.dat
$ /usr/lib/6lbr/bin/nvm_tool --print /etc/6lbr/nvm.dat

Check its ip

$ cat /var/log/6lbr.ip

Sensor Nodes

I used three SensorTag, one as SLIP radio with Devpack-Debugger connected to the 6lbr host which is the ContikiInstant virtual machine. The other two were sensor nodes.

The SensorTag as SLIP radio was flashed with contiki/examples/ipv6/slip-radio, channel 25, PAN_ID=0xABCD, see project-conf.h.

Flash the sensor nodes with cc26xx-web-demo.hex, which is available in contiki/examples/cc26xx/cc26xx-web-demo.

Results

Start 6lbr service and access its webserver from a web browser at [bbbb::100], Firefox in ContikiInstant or the web browser of the Windows host machine both works. In the sensors section, two sensors appeared, click on the web link to show its data. CoAP link hasn’t worked yet.

Sensors

And its data in the web page

SensorData

Issues

N/A

References