Make linux-device (intel edison) visible for BLE scan on another linux device

354 Views Asked by At

I want to connect my devices using BLE. I already have a gatttool on my laptop and on the intel edison. I check the availability of both devices equally:

~# rfkill list 

Bluetooth(es) isn't soft/hard blocked. Now I want to find BLE devices(on both devices I enter):

~# sudo hcitool lescan

And it do not find the first device from the second (and vice versa).

  • What should I do to make devices visible to each other?
  • What should I do to make a connection between them?

Thank you in advance.

UPDATE: Now, when I type

~# sudo hciconfig hci0 leadv 0
LE set advertise enable on hci0 returned status 12

So, I'm stuck on this. How to make device connectable?

UPDATE 2: Ok, I get it. On the edison side:

~# sudo hciconfig hci0 down
~# sudo hciconfig hci0 up 
~# sudo hcitool -i hci0 cmd 0x08 0x0008 1e 02 01 1a 1a ff 4c 00 02 15 e2 c5 6d b5 df fb 48 d2 b0 60 d0 f5 a7 10 96 e0 00 00 00 00 c5 00 00 00 00 00 00 00 00 00 00 00 00 00
~# sudo hciconfig hci0 leadv 0

On the laptop side:

~# sudo gatttool -b 98:4F:EE:04:31:F4 -I
[98:4F:EE:04:31:F4][LE]> connect
Attempting to connect to 98:4F:EE:04:31:F4
Connection successful

But now there is a new problem: gatt connection falls after 30 seconds. Any ideas?

1

There are 1 best solutions below

0
fflush On

OK, I finally found the cause of a connection failure. https://github.com/sandeepmistry/noble/issues/242 https://www.raspberrypi.org/forums/viewtopic.php?t=119110&p=807994

As written in these discussions, if you encounter such a problem you need to perform a downgrade of the kernel version.