Serial over Bluetooth not working

Hey guys,

I’ve been scouring the internet looking for fixes on this and seem to be coming up short. My goal is to get Serial over Bluetooth working so that I can configure the nano’s WiFi adapter via a phone app connected by bluetooth. I have tried the following:
vi /etc/systemd/system/dbus-org.bluez.service
changed line “ExecStart=/usr/lib/bluetooth/bluetoothd” to “ExecStart=/usr/lib/bluetooth/bluetoothd --compat”
systemctl daemon-reload
systemctl restart bluetooth
sdptool add SP

then when I run my python script it gives me the following output

root@chuck-desktop:/home/chuck/Documents# python3 ./run.py
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/bluetooth/bluez.py", line 273, in advertise_service
    protocols)
_bluetooth.error: (2, 'No such file or directory')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./run.py", line 135, in <module>
    profiles = [ SERIAL_PORT_PROFILE ])
  File "/usr/local/lib/python3.6/dist-packages/bluetooth/bluez.py", line 275, in advertise_service
    raise BluetoothError (*e.args)
bluetooth.btcommon.BluetoothError: [Errno 2] No such file or directory

Now, I believe this is because it’s looking for the file /var/run/sdp - and from what I understand that file is created by running the last command - “sdptool add SP”. I could be mistaken, i’m really grasping at straws here. I’m pretty sure whatever sdptool add SP does though, isn’t working. When I run an sdptool get SP - get the following

root@chuck-desktop:/home/chuck/Documents# sdptool get SP
Failed to connect to SDP server on FF:FF:FF:00:00:00: No such file or directory

Bump, Still having issues - willing to pay for help at this point.

I am in the same boat - recompiled kernel for rfcomm support and tried everything I can find online with no success.

Here are a couple of places I have been.
Recompile Kernel

https://forums.developer.nvidia.com/t/how-to-enable-serial-port-profile-for-the-bluetooth-service-of-jetson-nano/81947

Post back if you figure it out!

Hi,

Have you successfully recomplied the kernel as the did in the good tutorial https://blog.hypriot.com/post/nvidia-jetson-nano-build-kernel-docker-optimized/? Just follow it, then in the menuconfig panel, enable the “RFCOMM TTY support”, which is under the “Networking support/Bluetooth subsystem support”. After that, reboot the system, type the command “sudo rfcomm bind 0 xx:xx:xx:xx:xx:xx”. Then follow the link I provided here https://forums.developer.nvidia.com/t/how-to-enable-serial-port-profile-for-the-bluetooth-service-of-jetson-nano/81947. If you have further questions, please let me know.

Best regards,

yxqlamb

By the way, I used Intel Intel Wifi and bluetooth module as showed in this
https://www.jetsonhacks.com/2019/04/08/jetson-nano-intel-wifi-and-bluetooth/.

yxqlamb

I have recompiled the kernel and followed all links you suggested.
I am able to pair my android device, and create rfcomm0 and chmod 777 /dev/rfcomm0

After this point, I am unable to establish any connection between the jetson and android.

I have tried minicom on jetson and serialbluetooth terminal on android as well as a python program and BT Terminal on android AND my own App Inventor send a 1 or 0 program on android.

I get Error 507: Unable to connect, is the device turned on? from BT Terminal and my App Inventor program.
From serialbluetooth terminal, I get connection failed, socket might be closed or timeout, read ret =-1.

Jetson desktop shows the phone paired.

I have tried everything I can find online but cannot establish a serial connection.

Any help appreciated.

Scott

Chuck;

Any progress?
I’m still stuck.

I think the rfcomm need to built within the kernel Image. Could try and follow the instructions in https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide%2Fkernel_custom.html%23 to rebuild your kernel Image?

Hi Alanz;

I did build the kernel with RFCOMM support.
I can pair an android device to the Nano, I can create RFCOMM0, but any attempt to create a server and connect results in Error 507: Unable to connect, is the device turned on?
This error shows when I try to connect using any terminal application on Android.

Scott

Greetings all,

I’m having the same exact issue as chuckgreve2012, and I was wondering if anyone’s found a solution?

I’ve recompiled the kernel as yxqlamb suggested (followed the tutorial link), and enabled “RFCOMM_TTY support”. That allows me to now bind a connection with “sudo rf comm bind 0 xx:xx:xx:xx:xx:xx”.

I then follow the exact commands as chuckgreve2012 posted in the original message to add the compatibility feature, and I am still receiving the exact error he is, as if the “sdptool add SP” did nothing.

Has anyone found the solution to this?

Thanks!

-Patrick

Patrick;

I’m still stuck and for now moved on to other things, but I did find what looks to be some posts on the topic which I intend to try.

I just translated them in chrome.

Let me know if you make any progress!

Has someone managed to create a Serial Connection by now?
I am trying everything, but from serialbluetooth terminal, I also get connection failed, socket might be closed or timeout, read ret =-1…

Best Regards,
Florian