3

I am have Bluno nano and would like to connect it my pc(Ubuntu 16.06) and receive information via blue tooth. some online Q&A but unable to make it work.

  1. I paired Bluno nano my pc (checked via - $ bluetoothctl , [bluetooth]# paired-devices).

  2. After that I ran $ sudo rfcomm bind 0 F4:5E:AB:AA:BB:CC 1

but I am unable to see /dev/rfcomm0 . Do I need to create any config files ?

Connection to blutooth is done by the following commands

$ rfkill list all
$ sudo rfkill unblock bluetooth
$ sudo hciconfig hci0 up
$ sudo bluetoothctl
[bluetooth]# power on
[bluetooth]# discoverable on
[bluetooth]# agent on
[bluetooth]# pairable on
[bluetooth]# scan on
[bluetooth]# scan off
[bluetooth]# connect F4:5E:AB:AA:BB:CC 
[bluno]# pair F4:5E:AB:AA:BB:CC 
[bluno]# trust F4:5E:AB:AA:BB:CC
  • your method looks is simplest and best that should work. maybe try sudo apt install gnome-bluetooth pulseaudio-module-bluetooth which installs some bluetooth stuff alongside the bluez – ptetteh227 Apr 18 '18 at 15:49

1 Answers1

3

This method worked for me.

After you paired to the device and connected connected successfully, discover services that are using rfcomm on the remote device:

sdptool browse <remote_dev>
sdptool browse 12:34:56:78:11:22

take note of all the possible rfcomm and their channels (remote_channel)

Now create a virtual rfcomm device on our machine:

rfcomm listen /dev/rfcomm0 2

you can replace 2 with any value. it is our channel

Then bind the remote rfcomm to our virtual rfcomm device:

sudo rfcomm bind <virtual_rfcommdev> <remote_mac> <remote_channel>  
sudo rfcomm bind /dev/rfcomm0 12:34:56:78:11:22 2

if you prefer a one liner

 rfcomm bind 0 12:34:56:78:11:22 1

You can check if it is worked by sending it a test AT command

first install picocom:

sudo apt install picocom

then check if the device is present:

ls /dev/rfcomm*

then start picocom on the rfcomm:

sudo picocom -c /dev/rfcomm0

-c to make the command visible as you type

you get sometime like

picocom v2.2

port is        : /dev/rfcomm0
flowcontrol    : none
baudrate is    : 9600
parity is      : none
databits are   : 8
stopbits are   : 1
escape is      : C-a
local echo is  : no
noinit is      : no
noreset is     : no
nolock is      : no
send_cmd is    : sz -vv
receive_cmd is : rz -vv -E
imap is        : 
omap is        : 
emap is        : crcrlf,delbs,

terminal is ready

now type AT and press enter. If you get OK then it working.

ptetteh227
  • 1,904
  • I tried $ sdptool browse F4:5E:AB:AA:BB:CC Failed to connect to SDP server on F4:5E:AB:AA:BB:CC: Host is down – BhanuKiran Apr 15 '18 at 06:22
  • I also tried directly $ sudo rfcomm connect rfcomm0 F4:5E:AB:AA:BB:CC 2 It says "Can't connect RFCOMM socket: Host is down" – BhanuKiran Apr 15 '18 at 14:30
  • your device probably is be paired but not connected. inside the bluetoothctl shell do connect <Bluno mac> and repeat the sdptool step again – ptetteh227 Apr 15 '18 at 16:43
  • When i tried [Bluno]# connect F4:5E:AB:AA:BB:CC It displayed Connection successful. Just to cross check i also tried [Bluno]# paired-devices and it displayed the device too. I also tried hciconfig hci0 up and then sdptool browse step but it displayed the same statement SDP server on F4:5E:AB:AA:BB:CC: Host is down – BhanuKiran Apr 15 '18 at 19:42
  • Hi , Once connected how can i test with AT commands ? – BhanuKiran Apr 16 '18 at 13:39
  • i will edit my answer to include that – ptetteh227 Apr 16 '18 at 13:44
  • Thank you very much . Unfortunately I am still unable to connect rfcomm port. Not really sure about the problem. Previously i was able to the pair the device(although SDP server on F4:5E:AB:AA:BB:CC: Host is down).After updating the Bluez software from 5.37 to 5.49, only connection is established to the device but can't pair. – BhanuKiran Apr 16 '18 at 20:23
  • how were you able to connect when you were using bluez 5.37? – ptetteh227 Apr 16 '18 at 23:12
  • Hi, i also edited the question with the commands. – BhanuKiran Apr 18 '18 at 06:51