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,