I had an issue like this on my Nano:
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 tried adding compatibility mode in the bluetooth.service file, reloading daemon, restarting bluetooth and then adding a serial port by doing
sudo sdptool add SP
These steps work fine on my ubuntu 20.04 laptop, but on jetpack 4.5.1, they don’t. And I checked also, they don’t work on jetson NX either.
I am really curious on how to solve this issue, otherwise, another way to use bluetooth inside a python code is welcomed.
Thanks
The solution was in the path of the bluetooth configuration file (inspired from this https://developer.nvidia.com/embedded/learn/tutorials/connecting-bluetooth-audio)
this answer : bluetooth.btcommon.BluetoothError: (2, 'No such file or directory')
is not enough for jetson devices (jetpack). Although I didn't test if it works without changing the file mentioned in this link.
There is a .conf
file that needs to be changed also : /lib/systemd/system/bluetooth.service.d/nv-bluetooth-service.conf
modify :
ExecStart=/usr/lib/bluetooth/bluetoothd -d --noplugin=audio,a2dp,avrcp
to :
ExecStart=/usr/lib/bluetooth/bluetoothd -C
after that it is necessary to do:
sudo systemctl daemon-reload
sudo systemctl restart bluetooth
Tested on jetson Nano and NX with jetpach 4.5.1
Thanks for the help !