BeagleBone Setup

Posted 2014-08-12

This page includes detailed notes on the setup of a TI BeagleBone Black (BBB) as an OpenVisualizer border router host. Once it's setup, operation is just like running on a laptop.

This setup allows the BBB to route IPv6 packets between the OpenVisualizer 6LoWPAN network onto a wired ethernet network. The setup does not address IPv6 connectivity for the wired network on which it runs. Presently, for our experiments, the destination for the 6LoWPAN packets is on this local wired network, so no other setup is required.


The following setup is based on the demonstration distribution image:

$ uname -a
Linux beaglebone 3.8.13-bone47 #1 SMP Fri Apr 11 01:36:09 UTC 2014 armv7l GNU/Linux

The setup includes three steps:

  1. System setup, most importantly to make the BBB operate as a router
  2. Installation of OpenVisualizer dependencies
  3. Installation of OpenVisualzer itself

To perform these steps, I have found it easiest to ssh into the BBB via its USB device interface, as described on the BBB wiki's Terminal Shells page.

Basic System Setup

This setup will route packets between the 6LoWPAN bbbb::/64 network on the BBB's tun0 interface and the IPv6 network on its eth0 interface. However, eth0 also still is used for conventional IPv4 packet traffic.

aptitude update -- Update package lists. I use aptitude out of habit, but command line apt-get works, too.

unzip -- Install via aptitude.

timezone -- Reconfigure to local time with the command below.

dpkg-reconfigure tzdata

apache2 -- Disable the demonstration web server, which runs on port 8080. This conflicts with OpenVisualizer.

/etc/apache2# rm sites-enabled/000-default

Also, comment out a couple of lines in /etc/apache2/ports.conf -- NameVirtualHost and Listen. Apache will fail to restart, but we don't care. Maybe it's really simplest to remove the package altogeter.

/etc/network/interfaces -- Allow use of eth0. Uncomment the line below. Do not enable DHCP for IPv4 here; that is managed by wicd and should connect automatically.

auto eth0

/etc/sysctl.conf -- Allow the device to act as a router. Enable the line, net.ipv6.conf.all.forwarding=1.

radvd -- Router advertisement daemon; install via aptitude. We need to configure it. Define /etc/radvd.conf as below, where the 'x's in the prefix are specific to your setup. Must route OpenVisualizer's 'bbbb::' network.

interface eth0
   AdvSendAdvert on;
   prefix xxxx:xxxx:xxxx:xxxx:/64
      AdvOnLink on;
      AdvAutonomous on;
   route bbbb::/64

Usage Note: We usually boot up the BBB after booting our host computer, which is on the wired Ethernet network. Sometimes the host computer does not add the route to the bbbb network on the fly, and we must cycle its network interface (down, up) to incorporate the route.

Global IPv6 address -- BBB uses wicd for network management. So, we must add an acceptable script to set the router's IPv6 address. Modify the value for the 'afterscript' key in /etc/wicd/wired-settings.conf to specify the name of the script, such as:

afterscript = /etc/wicd/scripts/postconnect/set_eth0_ipv6

Then define the set_eth0_ipv6 script to contain the command below, again substituting your IPv6 address prefix for the 'x's.

ip -6 addr add xxxx:xxxx:xxxx:xxxx:1/64 dev eth0

ufw -- Firewall tool. Install via aptitude. Allow ssh, http, dhcp, and 8080 for OpenVisualizer. Enable the firewall.

# ufw allow 22
# ufw allow 67
# ufw allow 68
# ufw allow 80   
# ufw allow 8080 
# ufw enable

Finally, we must configure ufw to support router traffic, and to forward OpenVisualizer's tun packets.

Modify /etc/ufw/sysctl.conf to forward packets, and to autoconfigure. These lines should already exist. Uncomment/alter them as required.


Modify /etc/ufw/before6.rules to forward tun packets. Add these lines.

-A ufw6-before-input -i tun0 -j ACCEPT
-A ufw6-before-forward -i tun0 -j ACCEPT
-A ufw6-before-forward -o tun0 -j ACCEPT

Install OpenVisualizer Dependencies

  • python (v2.7.3) -- Already installed
  • python-serial (v2.5) -- Already installed
  • scons (v2.1) -- Install via aptitude
  • bottle (v12.7) -- Install via pip; Debian is on v0.10.11, which does not include the required 'run' command.
  • PyDispatcher (v2.0.3) -- Install via pip since not in Debian archive

Install OpenVisualizer

Using root user for now.

  • From home directory, create 'opt/openwsn' directory.
  • Download zip archive of OpenWSN FW and FW.
  • Unzip both files, then change the name of the FW and SW directories to 'openwsn-fw' and 'openwsn-sw', respectively.

Good to Go

The setup above worked for me, but definitely can be improved. Let me know if you have any questions or ideas to make it easier.

During operation, I found the toggle capability to define the DAGroot was somewhat unreliable. Sometimes the root and bridge mode states did not both toggle together.

2014-09-21 update: The unreliable link is a known issue with OpenWSN. I have created firmware and software pull requests that resolve the problem, as you can see in the comments for the issue. You also can use my firmware and software branches directly.

I also noticed that sometimes the ethernet link on the BeagleBone does not come up. This problem is described on a a BeagleBone forum thread, and looks like use of a bad mask to find the PHY interface. Perhaps an update to a more recent image will help.