chexbox
Posts: 28
Joined: Thu Apr 28, 2016 11:31 pm
Location: US

Bluetooth connection pi 3

Sat Nov 19, 2016 11:03 pm

I try to connect to devices via Bluetooth. The pi says Connection Failed - No usable services on this device. What do I do? BTW- I am using raspian w/ pixel.

User avatar
Douglas6
Posts: 4781
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Bluetooth connection pi 3

Sat Nov 19, 2016 11:44 pm

What do you want to use the connection for? Serial communication, file transfer, networking, audio streaming, HID, other?

hazza96
Posts: 23
Joined: Sun Oct 23, 2016 1:34 am

Re: Bluetooth connection pi 3

Sun Nov 20, 2016 4:17 am

Did you put the device into discovery mode?

With my Bluetooth headsets I hold down the power until the lights flash blue/red, then I get the Pi to do a search, finds them every time.

chexbox
Posts: 28
Joined: Thu Apr 28, 2016 11:31 pm
Location: US

Re: Bluetooth connection pi 3

Sun Nov 20, 2016 7:43 pm

hazza96 wrote:Did you put the device into discovery mode?

With my Bluetooth headsets I hold down the power until the lights flash blue/red, then I get the Pi to do a search, finds them every time.
It was another computer I was connecting to. I put the pi into discovery mode and paired it. It would stay connected for a second, but then disconnect.

briank1179
Posts: 29
Joined: Wed Jun 29, 2016 4:40 pm

Re: Bluetooth connection pi 3

Fri Jan 06, 2017 6:53 pm

I had the same issue. I was trying to pair a Raspberry Pi3 with a Pi2 to use as serial communication between the two. I got "Connection failed - No usable services on this device.
Any suggestions or guidance?
Thank you.

Brian

User avatar
Douglas6
Posts: 4781
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Bluetooth connection pi 3

Fri Jan 06, 2017 7:05 pm

You'll need to add the Serial Port Profile to both Pis. See this post: viewtopic.php?p=947185#p947185

briank1179
Posts: 29
Joined: Wed Jun 29, 2016 4:40 pm

Re: Bluetooth connection pi 3

Fri Jan 06, 2017 8:24 pm

I made the modifications to both Pi's as instructed in the post sent; Thank you for that by the way.
However when I rebooted both and paired I got the same message again. Is there another step I'm missing?

Thanks again for you help!!

User avatar
Douglas6
Posts: 4781
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Bluetooth connection pi 3

Fri Jan 06, 2017 8:31 pm

How are you trying to connect? You'll want to run an 'rfcomm watch' command on the slave Pi, and an 'rfcomm connect' on the master. That should create virtual /dev/rfcomm0 devices on each Pi which can be used with a serial terminal such as minicom, or programmatically with Python or C or whatever.

briank1179
Posts: 29
Joined: Wed Jun 29, 2016 4:40 pm

Re: Bluetooth connection pi 3

Fri Jan 06, 2017 9:00 pm

Okay I add the "rfcomms" to the master and slave Pi's. However when I attempted to pair the two the "slave" reported;
"Paired successfully, but this device has no services which can be used with Raspberry Pi"
The "Master" first returned;
:"Pairing failed - GDBus.Error.org.bluez.Error Authentication Failed. Authentication Failed"
and then immediately followed with the following message.
"Connection failed-GDBus.Error.org.bluez.Error.NotAvailable: Operation currently not available. Try to connect manually".
Tried to "connect" from both PI's and got the same message of No Usable services on this device.

User avatar
Douglas6
Posts: 4781
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Bluetooth connection pi 3

Fri Jan 06, 2017 9:43 pm

OK, they must be paired and trusted first. How are you trying to pair them? Here's how I would do it, using bluetoothctl. First start it on the slave:

Code: Select all

bluetoothctl
Then enter:

Code: Select all

agent on
and

Code: Select all

discoverable on
You'll have three minutes for the following steps. On the master, start bluetoothctl and enter this:

Code: Select all

scan on
After some moments it should find the slave and print the Bluetooth device address, something like AA:BB:CC:DD:EE:FF. Then type

Code: Select all

pair AA:BB:CC:DD:EE:FF
Check the slave and follow any instructions; if asked to authorize, reply with 'yes', not 'y'. The master should indicate you are paired. Now enter

Code: Select all

trust AA:BB:CC:DD:EE:FF
and it should indicate trusted. You can now 'quit' bluetoothctl on both machines.

If you get this far, we can discuss the rfcomm commands.

briank1179
Posts: 29
Joined: Wed Jun 29, 2016 4:40 pm

Re: Bluetooth connection pi 3

Fri Jan 06, 2017 11:02 pm

Okay following your instructions the Master reported: Device 5C:F3:70:7D:EC:C6 RSSI: -58
So I typed in "pair 5C:F3:70:7D:EC:C6 "
The response I got was" Failed to pair: org.bluez.Error.AlreadyExists
If they are truly paired is there simple test to confirm?

briank1179
Posts: 29
Joined: Wed Jun 29, 2016 4:40 pm

Re: Bluetooth connection pi 3

Fri Jan 06, 2017 11:08 pm

Further information. If I click on the Bluetooth icon on either device and select the device it is supposedly connected to and click on the "Connect" icon I get Connection failed - No usable services on this device.

Again Thank you so much for your assistance.

User avatar
Douglas6
Posts: 4781
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Bluetooth connection pi 3

Fri Jan 06, 2017 11:45 pm

Yes, they are already paired. You can confirm this in bluetoothctl with

Code: Select all

info 5C:F3:70:7D:EC:C6
If the pairing is not trusted, be sure to trust it with (again)

Code: Select all

trust 5C:F3:70:7D:EC:C6
The Bluetooth panel is generally only useful for keyboards and speakers. Instead, in a terminal window on the slave, enter

Code: Select all

sudo rfcomm watch hci0
Leave that window open. In a terminal window on the master, enter

Code: Select all

sudo rfcomm connect hci0 <bdaddr>
replacing <bdaddr> with the device address of the slave. You should see a message that the Pis are connected.

briank1179
Posts: 29
Joined: Wed Jun 29, 2016 4:40 pm

Re: Bluetooth connection pi 3

Sat Jan 07, 2017 4:01 pm

Again I appreciate all your help. I followed the instructions to the point on the master typing in the "sudo rfcomm" command.
On a terminal in the master I typed
[bluetooth]# sudo rfcomm connect hci0 5C:F3:70:7D:EC:C6
I got "Invalid command"
I retyped the command again this time putting the "address" in <>.
Same response.
What do you suggest?
Thank you
Brian

User avatar
Douglas6
Posts: 4781
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Bluetooth connection pi 3

Sat Jan 07, 2017 4:17 pm

The rfcomm commands should be entered on the Linux command line, outside of bluetoothctl. Do not use '<>'.
Last edited by Douglas6 on Sat Jan 07, 2017 4:31 pm, edited 1 time in total.

briank1179
Posts: 29
Joined: Wed Jun 29, 2016 4:40 pm

Re: Bluetooth connection pi 3

Sat Jan 07, 2017 4:31 pm

Fantastic, it worked! Final question, is there a way to automatically launch both Pi's into Bluetooth connected mode when they boot up? The ultimate goal is a stand alone remote control system.
Thank you so much!!!
Brian

User avatar
Douglas6
Posts: 4781
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Bluetooth connection pi 3

Sat Jan 07, 2017 4:40 pm

See this post on setting up a systemd service for the rfcomm commands: viewtopic.php?p=919463#p919463. Adjust the ExecStart= line for the master. You'll need to start the slave first, so the master has something to connect to when it starts. You might be able to get around that by replacing 'rfcomm connect' with 'rfcomm bind'.

briank1179
Posts: 29
Joined: Wed Jun 29, 2016 4:40 pm

Re: Bluetooth connection pi 3

Sat Jan 07, 2017 5:05 pm

Great!! Thank you very much for all your help!!!

Return to “General discussion”