k.elsherif
Posts: 6
Joined: Fri Apr 07, 2017 9:54 am

Bluetooth Pairing of two Raspberry Pis

Mon May 08, 2017 2:21 pm

Hello Everyone, I am a beginner in using raspberry pi and currently I am trying to make a simple Project using two Raspberry Pis ZeroW. The project involves a temperature sensor connected to one Rasp.Pi and an LED connected to the other and they should communicate through Bluetooth.

I am Having a problem in pairing the two Raspberry Pis Together. I am able to see the other raspberry Pi but when I order to pair and connect a Note stating (Paired Succesfully, but this device has no services which can be used with Raspberry Pi) on one Raspberry Pi and the other has a note (Connection failed, GDBus.Error.org.bluez.NotAvailable: Operation currently not available. Try to connect manually). Thanks in Advance for your help.
PS: The two Raspberry Pis are currently not connected to Wifi and communication should be done over bluetooth

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

Re: Bluetooth Pairing of two Raspberry Pis

Mon May 08, 2017 3:41 pm

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

If the Pis are paired, unpair and re-pair after the SPP has been added. Create the virtual serial ports by running 'rfcomm watch' on the slave Pi, and 'rfcomm connect' on the master Pi. Then use any programming language to communicate over the /dev/rfcomm0 ports.

User avatar
B.Goode
Posts: 8221
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Bluetooth Pairing of two Raspberry Pis

Mon May 08, 2017 8:01 pm

The BlueDot python library has documentation that describes how to pair 2 RPi systems:

http://bluedot.readthedocs.io/en/latest/pairpipi.html

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

Re: Bluetooth Pairing of two Raspberry Pis

Mon May 08, 2017 8:25 pm

To be clear, the Pis will not be able to connect unless the SPP is started, at boot time as described in the link above, or programmatically, using Blue Dot.

User avatar
LetHopeItsSnowing
Posts: 357
Joined: Sat May 26, 2012 6:40 am
Location: UK
Contact: Website

Re: Bluetooth Pairing of two Raspberry Pis

Fri May 12, 2017 1:36 pm

Douglas6 wrote:To be clear, the Pis will not be able to connect unless the SPP is started, at boot time as described in the link above, or programmatically, using Blue Dot.
You don't need to register SPP to get Blue Dot to work. The bluedot python library registers the SPP at run time when it starts.
"am I getting slower, or is stuff more complicated; either way I now have to write it down - stuffaboutcode.com"

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

Re: Bluetooth Pairing of two Raspberry Pis

Fri May 12, 2017 1:50 pm

Yes, that was my point (I wrote the code that registers the SPP in Blue Dot). Without Blue Dot, you'll need to register SPP another way.

k.elsherif
Posts: 6
Joined: Fri Apr 07, 2017 9:54 am

Re: Bluetooth Pairing of two Raspberry Pis

Mon May 22, 2017 10:01 am

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

If the Pis are paired, unpair and re-pair after the SPP has been added. Create the virtual serial ports by running 'rfcomm watch' on the slave Pi, and 'rfcomm connect' on the master Pi. Then use any programming language to communicate over the /dev/rfcomm0 ports.
I followed the steps in order to pair the two Raspberry pis but I am not able to connect an I get an error that there is no usable service on this device

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

Re: Bluetooth Pairing of two Raspberry Pis

Mon May 22, 2017 1:15 pm

How are you trying to connect?
Douglas6 wrote:If the Pis are paired, unpair and re-pair after the SPP has been added. Create the virtual serial ports by running 'rfcomm watch' on the slave Pi, and 'rfcomm connect' on the master Pi.

Return to “Beginners”