!!!DSD TECH HM-11/10 日本国内で使う場合は「[技適未取得機器を用いた実験等の特例制度|https://www.tele.soumu.go.jp/j/sys/others/exp-sp/]」を利用してください。 *[DSD TECH Official Website: DSD TECH HM-11 Bluetooth 4.0 BLE Module|http://www.dsdtech-global.com/2018/04/dsd-tech-hm-11.html] *[Huamao Technology CO,. LTD.|http://www.jnhuamao.cn/download_rom_en.asp](Firmware Download) *[HM-10 Bluetooth 4 BLE Modules | Martyn Currey|http://www.martyncurrey.com/hm-10-bluetooth-4ble-modules/] *[GitHub - jpliew/BLEShieldSketch: Arduino BLE Shield (HM-10) Testing Sketch|https://github.com/jpliew/BLEShieldSketch] *[How to Use HM-10 BLE Module with Arduino to Control an LED using Android App|https://circuitdigest.com/microcontroller-projects/how-to-use-arduino-and-hm-10-ble-module-to-control-led-with-android-app] *[[SOLVED] Blynk and BLE using HM10 module (OK+CONN problem) - Solved - Blynk Community|https://community.blynk.cc/t/solved-blynk-and-ble-using-hm10-module-ok-conn-problem/20172] *[マーティーの工房日誌: Bluetooth BLE Module(CC41-A)とAndroidのペアリングで苦戦|https://martyworkshopdiary.blogspot.com/2018/05/bluetooth-ble-modulecc41-aandroid.html] *[BLEモジュールのHM-11を買って試してみた | kako blog|http://kako.com/blog/?p=46583] *[安価なBLEモジュールにシリアル接続してみた - Qiita|https://qiita.com/juosugi/items/46b6c20f369f8cd0824c] !!Raspbery Pi インストール $ sudo pip3 install bluepy $ sudo pip3 install ble-serial 起動 $ sudo ble-scan # デバイスアドレスの確認 $ ble-serial -d AA:BB:CC:DD:EE:FF & #デバイスアドレスを指定 送受信(シリアル通信) $ echo aaaaaa > /tmp/ttyBLE $ cat < /tmp/ttyBLE import serial ser = serial.Serial('/tmp/ttyBLE', 9600) # デバイス名とボーレートを設定しポートをオープン ser.write(b"hello") # 出力 ser.close() # ポートのクローズ import serial ser = serial.Serial('/tmp/ttyBLE', timeout=0.1) # timeoutを秒で設定(default:None)ボーレートはデフォルトで9600 c = ser.read() # 1文字読み込み str = ser.read(10) # 指定文字数読み込み ただしtimeoutが設定されている場合は読み取れた分だけ line = ser.readline() # 行終端'\n'までリードする ser.close() *[Pythonでシリアル通信 - Qiita|https://qiita.com/kosystem/items/0023cfee941fdf099087] Pythonからの接続と送信(BLE) 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() Pythonからの接続と受信(BLE) 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() *[ble-serial · PyPI|https://pypi.org/project/ble-serial/] *[Send/receive data from/to Raspberry Pi to/from Arduino with HM-10 (Bluetooth LE module) - Arduino Stack Exchange|https://arduino.stackexchange.com/questions/74935/send-receive-data-from-to-raspberry-pi-to-from-arduino-with-hm-10-bluetooth-le]