user46267: My goal is to send a string from an Arduino via an HM-10 bluetooth module to a Rasperry Pi. I do this today by connecting the HM-10 on the Arduino to another HM-10 module (master/slave) and then from that module to the Raspberry Pi via USB Serial adapter which gives me a /dev/ttyUSB0 that I can read. I would like to just have the Arduino's HM-10 connect up directly to the Bluetooth of the Raspberry Pi without any extra modules at all.
I found the app "Arduino Bluetooth Controller" (Android) that can connect to the module and serial communication is working.
I also have the HC-05 module and there I can solve it by using rfcomm bind 2 , but that doesn't work on the HM-10.
I'm open to any solution that can do this. Either bind the serial communication using rfcomm (or alternative) like on the HC-05, or try to build an app that is doing the same thing the Android app does, only on the Raspberry Pi.

user64075: HM-10 is a BLE device. You'll need to understand BLE programming, which is quite different than classic Bluetooth.
There is no standard BLE service for serial communication. 
The best way on a Pi to use BLE is with the 

noble and bleno modules for node.js. 
Or start by playing with gatttool.   

If you are fit in Phyton:
The HM-10 style device will send notifications that the Pi's BLE device can read. Basically you need to 
attach a 'delegate' call-back function to the Peripheral object, 
and then wait for notifications. 
The call-back can then process the received data.
You'll have to install the bluepy lib on the PI. This sample code writes to an Arduino HC-10 device
import bluepy.btle as btle

p = btle.Peripheral("AA:BB:CC:DD:EE:FF")
s = p.getServiceByUUID("0000ffe0-0000-1000-8000-00805f9b34fb")
c = s.getCharacteristics()[0]

c.write(bytes("Hello world\n", "utf-8"))
p.disconnect()   

Here is some code for reading from an Arduino HC-10 device 
import bluepy.btle as btle

class ReadDelegate(btle.DefaultDelegate):
    def handleNotification(self, cHandle, data):
        print(data.decode("utf-8"))

p = btle.Peripheral("AA:BB:CC:DD:EE:FF")
p.withDelegate(ReadDelegate())

while True:
    while p.waitForNotifications(1):
        pass

p.disconnect()


46267: <p>My goal is to send a string from an Arduino via an HM-10 bluetooth module to a Rasperry Pi. I do this today by connecting the HM-10 on the Arduino to another HM-10 module (master/slave) and then from that module to the Raspberry Pi via USB Serial adapter which gives me a /dev/ttyUSB0 that I can read. I would like to just have the Arduino's HM-10 connect up directly to the Bluetooth of the Raspberry Pi without any extra modules at all.</p>

<p>I found the app "Arduino Bluetooth Controller" (Android) that can connect to the module and serial communication is working.</p>

<p>I also have the HC-05 module and there I can solve it by using rfcomm bind 2 , but that doesn't work on the HM-10.</p>

<p>I'm open to any solution that can do this. Either bind the serial communication using rfcomm (or alternative) like on the HC-05, or try to build an app that is doing the same thing the Android app does, only on the Raspberry Pi.</p>
 64075: <p>HM-10 is a BLE device. You'll need to understand BLE programming, which is quite different than classic Bluetooth.
There is no standard BLE service for serial communication. 
The best way on a Pi to use BLE is with the </p>

<ul>
<li><a href="https://www.skyrise.tech/blog/tech/bluetooth-raspberry-pi-bleno-part-1-ibeacon/" rel="nofollow noreferrer">noble and bleno modules for node.js</a>. </li>
<li>Or start by <a href="https://www.instructables.com/id/Bluetooth-Low-Energy-Read-Write-to-Sensor-Network-/" rel="nofollow noreferrer">playing with gatttool</a>.   </li>
</ul>

<p>If you are fit in Phyton:
The HM-10 style device will send notifications that the Pi's BLE device can read. Basically you need to 
attach a 'delegate' call-back function to the Peripheral object, 
and then wait for notifications. 
The call-back can then process the received data.
You'll have to install the bluepy lib on the PI. This sample code writes to an Arduino HC-10 device</p>

<pre><code>import bluepy.btle as btle

p = btle.Peripheral("AA:BB:CC:DD:EE:FF")
s = p.getServiceByUUID("0000ffe0-0000-1000-8000-00805f9b34fb")
c = s.getCharacteristics()[0]

c.write(bytes("Hello world\n", "utf-8"))
p.disconnect()   
</code></pre>

<p>Here is some code for reading from an Arduino HC-10 device </p>

<pre><code>import bluepy.btle as btle

class ReadDelegate(btle.DefaultDelegate):
    def handleNotification(self, cHandle, data):
        print(data.decode("utf-8"))

p = btle.Peripheral("AA:BB:CC:DD:EE:FF")
p.withDelegate(ReadDelegate())

while True:
    while p.waitForNotifications(1):
        pass

p.disconnect()
</code></pre>
