Relative Content

Tag Archive for python-3.xbluetoothrfcomm

Bind a bluetooth device to a rfcomm via python

I was able to search and pair a Raspberry Pi 4 to a bluetooth 4.0 Thermal printer using the BlueZ API.
In order to use the python-escpos library I need to create a serial port /dev/rfcomm, which I can do with sudo rfcomm bind /dev/rfcomm0 XX:XX:XX:XX:XX:XX 1.
How can I do it programatically in python (without having to use python-subprocess)? Thanks!