I am trying to pair my HC-05 arduino bluetooth module with my Ubuntu machine for the past couple of hours but with no success.
I ran the following commands:
sdptool add --channel=1 SP
hcitool scan
sudo rfcomm bind rfcomm0 <MAC address of the HCO5 module>
But then if I try to connect issuing the following command:
sudo rfcomm connect 0
I get the error:
Can't connect RFCOMM socket: Connection refused
I have also edited the /etc/bluetooth/rfcomm.conf
file to this:
# # RFCOMM configuration file. #
rfcomm0 {
# # Automatically bind the device at startup
bind yes;
#
# # Bluetooth address of the device
device 20:14:02:17:17:38;
#
# # RFCOMM channel for the connection
channel 1;
#
# # Description of the connection
comment "Arduino Bluetooth module";
}
But I always keep getting the Connection refused
error. I also tried pairing with the module from the bluetooth manager applet. The default pin is 1234
and I have successfully connected with my bluetooth module through my android phone. But here, i see the HC-05 module listed as Unknown
and therefore when I try to connect with the default pin, the bluetooth manager generates a random pin and asks me to enter that pin on the other device to complete the pairing request which I can not do obviously.
When I try rfcomm connect
I am not presented with a pairing request window where I can just punch in the pin like I did in my android phone.
I read the blogs and the bluetooth module can be connected to linux machines so I am sure I am missing something simple. Any help is appreciated.