![]() |
nRF51 IoT SDK
|
To allow fast startup with 6LoWPAN over Bluetooth low energy, you can set up a Raspberry Pi as Linux boarder router. With this setup, you can test all delivered examples.
The Raspberry Pi must run a version of Raspbian OS that supports 6LoWPAN, the required modules must be installed, and a Bluetooth dongle with Bluetooth low energy support must be connected to the Raspberry Pi.
This user guide explains how to set up Raspbian OS on the Raspberry Pi and add 6LoWPAN support and router capabilities, so that you can use the Raspberry Pi as router.
Note: Save the above downloaded files to the same directory. The kernel must be unzipped prior to transferring them to the raspberry. You should have in total 6 .deb files after unzipping. Let’s call this path /path/to/downloaded/dependencies
Ways of interfacing:
If you are not familiar with the raspberry pi, generic information about the board is available on this site: http://elinux.org/RPi_Hub
Before you start setting up Raspbian OS, ensure that you have an SSH terminal client and the SCP file transfer program installed.
Download the following files:
To be able to communicate with your raspberry pi, it’s essential that it’s connected to your network, and that you know the IP address of it. Finding the ip-address of the Raspberry Pi can be done by calling “hostname –I” in the terminal of your Raspberry Pi. If you have issues finding the IP address of your device, please see this page: http://www.raspberrypi.org/documentation/troubleshooting/hardware/networking/ip-address.md
Copy the standard image of Raspbian OS to an SD card. See http://www.raspberrypi.org/documentation/installation/installing-images/ for detailed instructions on how to install the image.
The following commands demonstrate how to create the SD card on a Linux operating system. These commands assume that the SD card is the /dev/sdb
device. See the Raspberry Pi documentation for information about how to create the SD card on other operating systems, or to troubleshoot problems.
/dev/sda
instead of /dev/sdb
), you might overwrite your current file system!To be able to access the Raspberry Pi without an internet connection and without a router, and without attaching a screen, it must be assigned a static network address. You can then access the Raspberry Pi through this IP address. However, this IP will be used only to get easy access to the dynamic IP address.
To assign a static network address to the Raspberry Pi, edit the network interface configuration file on the system partion. The file is located at /etc/network/interfaces
on the Raspian OS SD card. With the SD card mounted on your computer, open the file /media/<path-to-raspbian-system-partition>/etc/network/interfaces
in an editor (you need root permissions to edit the file) and add a static network. For example:
Next, couple the Raspberry Pi and the host directly with a network cable and configure your host machine to use the same static network. For example, assign the host the IP 192.168.111.112 with the same netmask that you used for the Raspberry Pi.
If the host is running on a Linux system, issue the following command, for example:
Currently, Raspbian OS does not support 6LoWPAN. You must upgrade the kernel to add 6LoWPAN support. In addition, you need to install several modules that provide Bluetooth low energy and router capabilities
The current Raspbian OS uses the 3.12 Linux kernel, which does not support 6LoWPAN. Therefore you must upgrade the kernel to version 3.17.
Complete the following steps to upgrade the kernel:
/boot
folder, locate the new kernel image, and open /boot/config.txt
for editing. For example: /boot/config.txt
, add the following content or replace the kernel option with a line like this: /boot/config.txt
and exit the editor.To add Bluetooth low energy functionality to Linux, you must install BlueZ - Bluetooth Stack. This module also provides tools like hcitool, hciconfig, and so on.
If you followed the procedure described above, BlueZ is already installed. Otherwise, log in as root user and issue the following command to install it:
Having IPv6 connectivity requires distributing the global IPv6 prefix to Bluetooth devices. On Linux, you can use the Router Advertisement Daemon for this purpose. RADVD can periodically or on solicitation send Router Advertisement message.
See RADVD for Linux for more information about RADVD and how to configure and run it.
By default, the debugfs file system is not mounted to a specific location in Raspbian OS. To be aligned with most Linux distributions, you should configure Raspbian OS to use /sys/kernel/debug
as debugfs location.
The following commands can be used to mount debugfs:
To make this change persistent, mount debugfs permanently by adding it to the /etc/fstab
file.