0

I have tried following a lot of posts online, but I could still not solve my issue.

I want to instantiate serial communication between my RPi and my Windows 11 computer.

Currently, I have connected them over Bluetooth, but I am struggling to create a serial port.

Before I connected, I ran this command: sudo nano /etc/systemd/system/dbus-org.bluez.service, and then added the compatibility flag -C and the SP profile line:

ExecStart=/usr/lib/bluetooth/bluetoothd -C
ExecStartPost=/usr/bin/sdptool add SP

After I connected using the GUI, I ran this on the pi:

pi@raspberrypi:~ $ sudo rfcomm connect hci0 xx:xx:xx:xx:xx:xx
Connected /dev/rfcomm0 to xx:xx:xx:xx:xx:xx on channel 1
Press CTRL-C for hangup

But when I try to create an incoming COM port on my Windows machine, Windows does not pick up on the Raspberry Pi. When I try to create an outgoing COM port on my Windows machine, it says "The device you have selected does not have a serial port service running".

I am not sure where to go from here.

1 Answer 1

2

Running bluetoothd with -C and the tool rfcomm are both deprecated and not recommended to use.

The official BlueZ example is at: https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/test/test-profile although it still requires a bit of knowledge to get running.

Another alternative for the RPi would be the Bluedot RFCOMM functionality: https://www.stuffaboutcode.com/2017/07/python-bluetooth-rfcomm-client-server.html.

It can also be done with standard Python sockets. For example: https://stackoverflow.com/a/62815818/7721752. There is also this useful blog https://blog.kevindoran.co/bluetooth-programming-with-python-3/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.