How to make Raspberry Pi 3 available for iOS and CoreBluetooth?

I have a Raspberry Pi 3 and am trying to make it available for iOS devices. I sudo hciconfig hci0 piscan to make it discoverable. I see this with my iMac.

In iOS, I use CoreBluetooth and start scanning neighboring devices. I can detect several FitBit and iMac devices, but the Raspberry Pi does not appear.

Is there another setting that I have to enable for Bluetooth LE detection? Is the Raspberry Pi 3 iOS compatible for bluetooth?

Thanks in advance. I appreciate any help with this.

+5
source share
3 answers

After a lot of research and some help from a Twitter friend to enable LE broadcast, you should use one of the following commands.

 sudo hciconfig hci0 leadv 0 sudo hciconfig hci0 leadv 3 

A value of 0 indicates connectivity.

A value of 3 indicates an inability to connect.

+10
source

For those who have an Iphone connection, the only way to get the RPi visible on the Bluetooth scan screen is to set the raspberry role / profile as a sound shell, as described below, in addition to the answer posted by @Jeremiah Jessel:

sudo / bin / hciconfighci0 inqdata "0c097261737062657272797069020a00091002006b1d460217050d03001801180e110c1115110b1100"

all in one line, the long line is the request data, in this line we set the bluetooth name and profiles supported by our raspberry PI

+2
source

For anyone to whom HubuN has helped and was interested in the same things as Manuel Otto, you can change the name by editing the hexadecimal data from 0c09 to 020a. I have no reputation for adding comments, so I am adding a separate answer.

Using the HubuN example:

 sudo /bin/hciconfig hci0 inqdata "0c097261737062657272797069020a00091002006b1d460217050d03001801180e110c1115110b1100" 

"raspberrypi" is 7261737062657272797069

Let's say you want to change it to "MyName"

You will get a hex for "MyName" and fill in the remaining blank data 0

4d794e616d65 = "MyName"

 7261737062657272797069 = "raspberrypi" 4d794e616d650000000000 = "MyName " 

What gives you:

 sudo /bin/hciconfig hci0 inqdata "0c094d794e616d650000000000020a00091002006b1d460217050d03001801180e110c1115110b1100" 

I am not very familiar with the rest of the hex code, so if anyone else wants to explain this or even provide a simpler solution, feel free to.

(Note: you can use a tool like this to convert text to HEX)

0
source

All Articles