BLE 6LoWPAN边界路由器的多连接

时间:2018-08-06 03:57:42

标签: raspberry-pi bluetooth-lowenergy nrf52

我正在努力通过树莓派3进行BLE连接。

当我建立1:1连接时,它工作正常。

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

但是当我连接2个或更多设备时,它不起作用!

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

谁能告诉我如何使用BLE 6LoWPAN边界路由器连接多个设备。

2 个答案:

答案 0 :(得分:0)

我解决了这个问题。 问题是最新的Laspbian内核,版本4.14.y。 重建4.9.80-v7 +后,它可以正常工作。

答案 1 :(得分:0)

这篇文章将近2岁了,但对我有很大帮助!

与Raspbian一起运行的Raspberry Pis 4出现完全相同的错误。

使用

查看我的内核版本
uname -a

显示它具有版本4.19.97-v7l +。

我发现降级到4.9.80-v7 +应该可以解决该问题,所以我很简单地升级到了最新的内核5.4.40-v7l +,

sudo rpi-update

,我的BLE 6loWPAN连接工作正常!

因此,似乎在4.14和4.19之间的内核版本与BLE上的6lowPAN有一些问题。在Google上找不到原因,但已对其进行了更新!