Raspberry PI with IEEE 802.15.4 Hardware and RTC

At work, I have been working with the Raspberry PI and some additional hardware lately. We have a board that we call raspINGA that goes onto the extension pins of the Raspberry. The board contains an Atmel AT86RF231 radio chip for the IEEE 802.15.4 standard. Furthermore, the board has a DS1340 RTC with a battery clip to allow the Raspberry to keep its local time even when no power is applied.

In this blog entry I want to sum up the steps to set up this hardware and use it together with IBR-DTN, the best Bundle Protocol Implementation for Linux. Using the Bundle Protocol over IEEE 802.15.4 allows seamless interoperability with uDTN, the only Bundle Protocol Implementation for Contiki.

This post is work in progress and may get updated over time.

How to install the IBR Repo?

  1. $ echo “deb http://jenkins.ibr.cs.tu-bs.de/download/debian/ wheezy-unstable main” | sudo tee /etc/apt/sources.list.d/ibrdtn.list
  2. $ sudo apt-get update

How to install IBR-DTN and the necessary tools?

  1. $ sudo apt-get install ibrdtnd ibrdtn-tools lowpan-tools

How to install the RPI Kernel with 802.15.4 Support?

  1. $ sudo apt-get install linux-image-3.6.11-1-rpi+ibr
  2. $ sudo cp /boot/vmlinuz-3.6.11-1-rpi+ibr /boot/kernel.img

How to enable the RTC in Raspbian?

  1. $ sudo apt-get remove –purge fake-hwclock
  2. $ sudo apt-get install –reinstall util-linux
  3. $ sudo update-rc.d hwclock.sh enable
  4. Edit /etc/init.d/hwclock.sh and remove the following lines:
    if [ -d /run/udev ] || [ -d /dev/.udev ]; then
    return 0
    fi
  5. $ sudo reboot

How to set up the IEEE 802.15.4 stack?

  1. $ sudo /etc/init.d/ifplugd stop # ifplugd tends to “up” interfaces
  2. $ sudo modprobe at86rf230 # if your kernel has the spi controller as module, load spi_bcm2708 now
  3. $ sudo iz add `iz listphy | head -n 1 | awk -F ‘ ‘ ‘ { print $1 } ‘`
  4. $ sudo ifconfig wpan0 up
  5. $ sudo iz set wpan0 ${PAN} ${NODE_ID} ${CHANNEL} # Here: PAN=0x780 NODE_ID=0x4 CHANNEL=16
  6. $ sudo killall -9 ifplugd
  7. Make sure to use different NODE_IDs on all nodes involved in your network

How to configure IBR-DTN to use the IEEE 802.15.4. link?

  1. Use this configuration:
  2. net_interfaces = inga
    
    net_inga_type = dgram:lowpan
    net_inga_interface = wpan0
    net_inga_port = 1920
    net_inga_discovery = yes
    
  3. Make sure, that the port matches your PAN (0x780 is 1920).

2 Comments

  1. Dimitris

    In this post you refer to raspINGA. How does this module defer from http://trac.ibr.cs.tu-bs.de/project-cm-2012-inga/ ?

    Cheers,
    Dimitris

    Reply
    1. bastian

      In fact, INGA is a complete WSN node including MCU, etc.
      raspINGA is a stripped down version where only the transceiver is present and wired in a way so that it can be plugged into the raspberry PI. While I am not sure we will publish the schematics, it is actually quite simple. Use the schematics of INGA and remove all the things you do not need. Then figure out the pin assignment from the kernel source and make your own circuit board.

      Reply

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.