dqpi
Posts: 33
Joined: Fri May 24, 2013 12:22 pm

rpi3 bluetooth serial

Thu Mar 24, 2016 1:55 pm

Hello!

I'm trying to setup a bluetooth serial port on the PI3, but cannot manage to get it to work. In bluetoothctl I can find the devices (on scan), pair and trust the device, and connect to the device. Connection is successfull.

However, I need to connect to the device over serial port. How can I set up the device as a serial point? I've looked into rfcomm but not sure if thats the right direction. Can someone advise where to go from here?

Massi
Posts: 1691
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: rpi3 bluetooth serial

Thu Mar 24, 2016 2:11 pm

dqpi wrote:Hello!

I'm trying to setup a bluetooth serial port on the PI3, but cannot manage to get it to work. In bluetoothctl I can find the devices (on scan), pair and trust the device, and connect to the device. Connection is successfull.

However, I need to connect to the device over serial port. How can I set up the device as a serial point? I've looked into rfcomm but not sure if thats the right direction. Can someone advise where to go from here?
rfcomm is the direction
it has been discussed recently
with bluez5 (on jessie) there is not the rfcomm.conf file, so you have to do manually

once you have paired and trusted the device in bluetoothctl, exit and do a rfcomm bind rfcomm0 xx:xx:xx:xx:xx
then check if all is ok (so try using yout rfcomm0 port)
if this is ok, you can automate the bind command editing the bluetooth service file (you can find how on this forum)

Edit: here. viewtopic.php?f=28&t=140631

zemzemkoko
Posts: 1
Joined: Mon Jul 10, 2017 12:40 pm

Re: rpi3 bluetooth serial

Mon Jul 10, 2017 12:48 pm

Hi there, i've been tackling with the same problem for a few days now.

I did everything asked on forum until the 'bind' step, no problem there. Yet i can't seem to get it work after that point. Tried both socket and pyserial methods.

Can you point me the direction I should look for now? Searching for few days, couldn't find a simple example that's working. I'm trying to get some data sent by hm-10 module, raspberry side will read the incoming bytes.

Massi
Posts: 1691
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: rpi3 bluetooth serial

Mon Jul 10, 2017 2:32 pm

that's a ble module, afaik it's not that easy with ble modules

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

Re: rpi3 bluetooth serial

Mon Jul 10, 2017 2:41 pm

The HM-10 is a BLE device, so rfcomm and the SPP will have nothing to do with it. The HM-10 uses a proprietary BLE service to emulate serial communications (reading a characteristic to receive, sending a notification to transmit). PySerial will also be of no use. If you want to connect to an HM-10 using the Pi's Bluetooth, you'll need to duplicate that BLE service.

Much easier would be to connect another HM-10 to the Pi, with which you can talk to with PySerial.

Return to “Beginners”