Bluetooth.btcommon.BluetoothError: (2, "There is no such file or directory")

I'm just trying to run the RFCOMM server example at https://code.google.com/p/pybluez/source/browse/trunk/examples/simple/rfcomm-server.py

$ python2 rfcomm-server.py Traceback (most recent call last): File "rfcomm-server.py", line 20, in <module> profiles = [ SERIAL_PORT_PROFILE ], File "/usr/lib/python2.7/site-packages/bluetooth/bluez.py", line 176, in advertise_service raise BluetoothError (str (e)) bluetooth.btcommon.BluetoothError: (2, 'No such file or directory') 

I get this error. My code works with windows, but I could not work with Ubuntu 15.10.

+5
source share
1 answer

I had the same problem on Raspbian and I solved:

  • Running bluetooth in compatibility mode,

    by changing /etc/systemd/system/dbus-org.bluez.service ,

    the change

    ExecStart=/usr/lib/bluetooth/bluetoothd

    in

    ExecStart=/usr/lib/bluetooth/bluetoothd -C

  • Then add the serial port profile by doing: sudo sdptool add SP

Literature:

0
source

Source: https://habr.com/ru/post/1247304/


All Articles