2

I currently have a Raspberry Pi 3 with built-in bluetooth and some of my work specification require to connect it with HM-10 bluetooth module but I am unable to do so.

I have tried various methods and I have successfully connected it with my android mobile phone using bluetooth serial terminal app but I am unable to do so with HM-10 however bluetooth module gets connected to the Raspberry Pi, but is not serially transmitting data on console and I get a response on command window as:

Waiting for connection on channel 1

I am using rfcomm.

Ghanima
  • 15,855
  • 15
  • 61
  • 119
Bilal Riaz
  • 21
  • 3
  • Have you added the bluetooth serial port to /boot/cmdline.txt? Ref. https://raspberrypi.stackexchange.com/questions/45570/how-do-i-make-serial-work-on-the-raspberry-pi3 – MatsK Aug 26 '17 at 16:28
  • Try these three steps; https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=158856&p=1032763#p1032763 – MatsK Sep 14 '17 at 02:56

1 Answers1

0

My understanding is the HM-10 only works using Bluetooth 4.0 Low Energy (BLE). BLE is different than the classic Bluetooth, so you can't use the rfcomm serial devices to communicate with the HM-10. Instead you need to use the gatttool to discover the different characteristics of the device and read/write data. 0000ffe1-0000-1000-8000-00805f9b34fb is the characteristic the HM-10 uses by default to read/write up to 20 bytes at a time (ID can be changed using the AT commands).

Alternatively if you are using a recent version of BlueZ (5.46 or newer) then you can use the acquire-write and acquire-notify commands of bluetoothctl to create file descriptors you can use to read and write data. On my Raspberry Pi 3 I had Ubuntu 16.04.3 installed but bluetoothctl -v showed an older version. I came across this script that worked to install a newer version, and after enabling the experimental features in bluetoothd the acquire commands started working.

Greg Bray
  • 111
  • 3