3

I had this question on Stack Overflow, but it was suggested that I migrate over here. It was flagged for moderator attention but I am unsure how that process works and I did not receive any feedback so I figured I would ask the question here:

I am trying to establish a Bluetooth Smart connection between two Raspberry PIs where I can use IPSP (Internet Protocol Support Profile) so I can communicate with IPv6 protocol using 6LoWPAN.

I have been able to successful establish this communication between the Raspberry Pis and a Nordic nRF51 development kit however as a proof of concept I am now trying to establish this connection between the two Raspberry Pi boxes without the Nordic nRF51 development kit.

So my first step was to setup the Raspberry Pis. I did this with the steps in Nordic’s nRF5 IoT SDK (https://developer.nordicsemi.com). I know the Raspberry Pis are set up correctly because they both work with the nRF51 board. I am able to establish a connection between the Raspberry Pi and the nRF51 boards and ping6 the nRF51 board from the Raspberry Pi.

Now to establish my Bluetooth connection between the Raspberry Pis I run though the following steps: On the Master device I run the following commands:

#need root access
sudo su

#enable 6lowpan over Bluetooth le
echo 1 > /sys/kernel/debug/bluetooth/6lowpan_enable

#start advertising Bluetooth LE service
hciconfig hci0 leadv

On the Slave device I run the following commands:

#need root access
sudo su

#enable 6lowpan over Bluetooth le
echo 1 > /sys/kernel/debug/bluetooth/6lowpan_enable

#establish le connection to master
hcitool lecc 5C:F3:70:XX:XX:XX

The hcitool lecc command always returns “Connection Handle 64”. At this point I have a stable connection between the two devices that I can verify using the hcitool con command.

I am now able to run the following command on either the master or the slave where the mac address is the address for the Bluetooth device I am connecting too:

echo “connect 5C:F3:70:XX:XX:XX 1” > /sys/kernel/debug/bluetooth/6lowpan_control

Whichever Raspberry Pi I run the command on establishes a 6lowpan connection and if I run the ifconfig command I see a new bt0 device. The other Raspberry Pi however does not get a bt0 device. I have tried running the ifconfig bt0 up command and also running the same echo command (changing the mac address) but neither one of them give me the bt0 device.

The bt0 device that appears on the Raspberry Pi that I ran the command on always disappears after 39 seconds. In the /var/log/syslog log file it appears that the ntpd daemon begins listening on the bt0 interface when it comes up and then exactly 39 seconds later it detects that the interface is gone and releases it. I have tried assigning an IPv6 address to the device when it is up using the following command:

ifconfig bt0 inet6 add 2001:db8::5cf3:70ff:feXX:XXXX/64 

I then ran a ping6 to continuously ping it in hopes to keep the interface up for a little while but the interface still went down after 39 seconds.

I am using two Raspberry Pi 2 Model B and both Bluetooth adapters are Broadcom Corp BCM20702A0 Bluetooth 4.0 devices (used lsusb to get the information about the adapter). Even though the adapters are listed as Bluetooth 4.0, I was able to successfully use them with the Nordic nRF51 development kit to establish a 6LoWPAN connection.

After all of my experiments, here are the questions that I have:

  • Is it possible to do what I am trying to do?
  • Has anyone been able to successfully establish a 6LoWPAN connection between two Linux devices that could tell me what I am missing in my steps?
  • Do I need one of the Bluetooth devices to be compatible with Bluetooth Smart 4.2 to correctly establish this connection?
  • Anyone familiar with bluez that can recommend additional steps to try?

Any help would be greatly appreciated.

Jon

EDIT 1:

I was able to get this connection working between an Ubuntu 14.04 box and a Raspberry Pi by installing the 3.19 pre-built kernel downloaded from here: http://kernel.ubuntu.com/~kernel-ppa/mainline/linux-3.19.y.z-queue/2016-01-07-vivid/

I still do not understand why it is not working between the two Raspberry Pis but if I find a solution I will post it here.

EDIT 2:

Ubuntu 14.04 runs Bluez 4 while the Raspberry Pis runs Bluez 5. since I was unable to connect the two Raspberry Pis (running Bluez 5) I figured I would try to connect two Fedora 23 instances running Bluez 5 to see if there is something wrong with Bluez or the Raspberry Pis. In my experiments I am experiencing the same behaviors with the two Fedora 23 instances that I did with the two Raspberry pis (where the 6lowpan connection goes down in less than 30 seconds after connecting).

The bluez version running on the Fedora 23 instances is 5.35 and the bluez version running on the Raspberry Pis is 5.23.

Anyone have any idea why this is happening with Bluez 5.x?

Thanks,

2 Answers 2

2

Solution

I Just solved the issue. the problem was with the kernel. I installed Ubuntu 15 but had the same issue as the Raspberry Pis so I downloaded the source for the 4.4 kernel, configured it and built a new kernel. Once the new kernel was in place everything worked great. Not sure if it was the patch level of the kernel or the configuration but it is now working.

1

Thank you for your post. I was working on IPv6 over BTLE last year and I faced the exact same issue as you. After about 39 seconds, the IPv6 over BLE link between my master and slave device gets disconnected. This happened to me in Linux kernel v4.1.x (for both master and slave). Both the master and slave are using the same platforms (sorry I can't reveal any details of the platforms due to confidentiality). All I can say is that it is a x86_64 platform running a Linux OS built off using the Yocto platform.

Then, interestingly enough, I managed to get more promising results on kernel 3.19. I actually used uBuntu 14.04 LTS on both of my platforms. I was able to upgrade the BlueZ version manually from BlueZ v4.101 to BlueZ v5.x. I can't remember exactly which version of BlueZ 5 that I was using. Then, I followed the steps similar to yours and I was able to successfully hold it for a long period of time. I remember going for dinner after that and it still holds after 30 minutes. Then I continued running the test the whole night and the connection stayed up!

Thank you for providing me with this information on which Linux kernel version to use. Regarding the patch that was applied, perhaps it could be related to one of these patches applied: https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/log/?id=refs/tags/v4.4.27&qt=grep&q=6lowpan

1
  • I'm not able to add comments as I do not have 50 reputation at the moment. So I just wanted to share what I know.
    – anandan111
    Commented Feb 15, 2017 at 2:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .