I'm simply 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 am getting this error. My code is working on windows but I could not work Ubuntu 15.10.
I had the same problem on Raspbian, and solved by:
Running bluetooth in compatibility mode,
by modifying /etc/systemd/system/dbus-org.bluez.service
,
changing
ExecStart=/usr/lib/bluetooth/bluetoothd
into
ExecStart=/usr/lib/bluetooth/bluetoothd -C
Then adding the Serial Port Profile, executing:
sudo sdptool add SP
References:
https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=133263
https://github.com/karulis/pybluez/issues/161
https://raspberrypi.stackexchange.com/questions/41776/failed-to-connect-to-sdp-server-on-ffffff000000-no-such-file-or-directory
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With