Issue
I am trying to connect raspberry pi to my galaxy note to use it for serial communication. I have somewhat succeeded at that.
First I paired it and trusted through bluetoothctl
. Then I run sudo rfcomm watch hci0
and opened with cat /dev/rfcomm
. I was able to connect to raspberry pi using bluetooth terminal (only this app, every other one failed) and strings sent from galaxy would be shown in the cat
window.
I have somehow messed up later and now running sudo rfcomm watch hci0
gives me Can't bind RFCOMM socket: Address already in use
. I can't release it with sudo rfcomm release hci0
or sudo rfcomm release 0
as it then gives me Can't release device: No such device. Likewise cat /dev/rfcomm0
too now gives me No such file or directory.
I killed the process listed with sudo lsof | grep /dev/rfcomm0
, this had no effect on my ability to use RFCOMM. Reloading with systemctl daemon-reload
and restarting with service bluetooth restart
too has had no effect.
I can still scan for other bluetooth devices, and I can connect to raspberry pi with bluetooth terminal, but it seems rfcomm
is gone. I am aware that rebooting can solve this, though I would like to do that programatically if possible without having to resort to power-cycling.
Thanks for your help.
Solution
pair device with raspberry pi..
bluetoothctl
scan on
pair XX:XX:XX:XX:XX:XX
trust XX:XX:XX:XX:XX:XX
agent-on
Configure Bluetooth Device
hciconfig
to create serial on pi, /dev/rfcomm
sudo rfcomm watch hci0
sudo hciconfig hci0 piscan
sudo sdptool add sp
sudo rfcomm watch hci0
Answered By - Gokul Raghu Answer Checked By - Katrina (WPSolving Volunteer)