Multi connection of BLE 6LoWPAN Border Router

390 Views Asked by At

I am struggling to make BLE connetion with raspberry pi 3.

When I make 1:1 connection, it works fine.

root@raspberrypi:~# hciconfig hci0 leadv
root@raspberrypi_SLAVE:~# echo "connect B8:27:EB:5D:C6:1E 1" > /sys/kernel/debug/bluetooth/6lowpan_control
root@raspberrypi:~# hcitool con
Connections:
        < LE B8:27:EB:5D:C6:1E handle 64 state 1 lm MASTER

root@raspberrypi:~# ping -6 -I bt0 2005::b827:ebff:fe5c:b7a0
PING 2005::b827:ebff:fe5c:b7a0(2005::b827:ebff:fe5c:b7a0) from 2005::1 bt0: 56 data bytes
64 bytes from 2005::b827:ebff:fe5c:b7a0: icmp_seq=1 ttl=64 time=164 ms
64 bytes from 2005::b827:ebff:fe5c:b7a0: icmp_seq=2 ttl=64 time=89.1 ms
64 bytes from 2005::b827:ebff:fe5c:b7a0: icmp_seq=3 ttl=64 time=62.9 ms
64 bytes from 2005::b827:ebff:fe5c:b7a0: icmp_seq=4 ttl=64 time=85.6 ms
64 bytes from 2005::b827:ebff:fe5c:b7a0: icmp_seq=5 ttl=64 time=58.9 ms
--- 2005::b827:ebff:fe5c:b7a0 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 58.958/92.193/164.287/37.976 ms

But when I connect 2 or more devices, It does not work!!

root@raspberrypi:~# hciconfig hci0 leadv
root@raspberrypi_SLAVE2:~# echo "connect B8:27:EB:5D:C6:1E 1" > /sys/kernel/debug/bluetooth/6lowpan_control
root@raspberrypi:~# hcitool con
Connections:
        > LE B8:27:EB:C2:60:83 handle 65 state 1 lm SLAVE
        > LE B8:27:EB:5C:B7:A0 handle 64 state 1 lm SLAVE
root@raspberrypi:~# ping -6 -I bt0 2005::b827:ebff:fe5c:b7a0
PING 2005::b827:ebff:fe5c:b7a0(2005::b827:ebff:fe5c:b7a0) from 2005::1 bt0: 56 data bytes
^C
--- 2005::b827:ebff:fe5c:b7a0 ping statistics ---
28 packets transmitted, 0 received, 100% packet loss, time 28097ms

Can anyone tell me how to connect multiple devices with a BLE 6LoWPAN Border Router.

2

There are 2 best solutions below

0
On

I solved this problem. The problem was newest Laspbian kernel, version 4.14.y. After rebuild 4.9.80-v7+, it works fine.

0
On

This post is almost 2 years old but it helped me a lot!

Had exactly the same error on my Raspberry Pis 4 running with Raspbian.

Looking at my kernel version with

uname -a

showed that it had the version 4.19.97-v7l+.

I found it a bit strange that downgrading to 4.9.80-v7+ should solve the issue so instead I upgraded to the newest kernel 5.4.40-v7l+ simply with

sudo rpi-update

and my BLE 6loWPAN connections worked just fine!

So it seems that kernel-versions between 4.14 and 4.19 have some issues with 6lowPAN over BLE. Couldn't find the reason for this on Google but updating fixed it!