Hi all.
Just bought a ESP-WROOM-32, immediately flashed Micropython and played a bit with it, very cool!
I'm really not a bluetooth expert, but I wrote in the past some client-server programs to communicate between PCs using pybluez and the serial-like RFCOMM protocol. I'm trying to do the same thing with my ESP32, especially configured as server.
I'm having a hard time finding examples about the usage of RFCOMM. RFCOMM isn't mandatory, but I'm looking for an easy way to send raw data between ESP32 and my PC, with the least possible troubles of advertising, pairing, connections, encryption and security. Any suggestion and/or examples?
Thanks a lot.
bluetooth, send and receive raw data
Re: bluetooth, send and receive raw data
RFCOMM is a Bluetooth Classic profile. Although the ESP32 supports classic, MicroPython's bindings only support Bluetooth Low Energy.c22 wrote: ↑Fri Oct 23, 2020 4:48 pmI'm really not a bluetooth expert, but I wrote in the past some client-server programs to communicate between PCs using pybluez and the serial-like RFCOMM protocol. I'm trying to do the same thing with my ESP32, especially configured as server.
I'm having a hard time finding examples about the usage of RFCOMM. RFCOMM isn't mandatory, but I'm looking for an easy way to send raw data between ESP32 and my PC, with the least possible troubles of advertising, pairing, connections, encryption and security. Any suggestion and/or examples?
There are two ways to achieve a similar result over BLE:
- Use the "Nordic UART Service", which is a way of doing streaming data over a pair of GATT characteristics. I wrote an example peripheral here -- https://github.com/micropython/micropyt ... ipheral.py -- and an example that dupterm's the REPL into it here -- https://github.com/micropython/micropyt ... rt_repl.py There are a few Android (and I imagine iOS too) apps that can connect to it. I use Adafruit's "Bluefruit Connect".
- BLE also supports opening an L2CAP "connection oriented channel". This is supported by Android 10+ and iOS 11+. This is much more like how RFCOMM works over classic, and essentially gives you something a bit like a socket. This is not currently supported by MicroPython but I am currently working on implementing it. Only tested on STM32 so far (can do ~30kiB/s pyboard-d to pyboard-d) but I need this for a project so will hopefully complete it soon.
Re: bluetooth, send and receive raw data
I was expecting that Bluetooth LE was a just a low-power version on the regular bluetooth. Now I know it isn't
Thanks a lot!

Thanks a lot!