Hey guys I am having trouble connecting to my phone via serial bluetooth on an embedded linux system. Here are the steps that I have taken to attempt a connection. (Note that I am able to pair and connect just fine using bluetoothctl) OS: Linux nitrogen6x 4.1.15-2.0.0-ga+yocto+g651db0b #1 SMP PREEMPT Thu Feb 16 15:53:27 PST 2017 armv7l armv7l armv7l GNU/Linuxroot@embeddedsystem:~# echo 0 > /sys/class/rfkill/rfkill0/stateroot@embeddedsystem:~# echo 1 > /sys/class/rfkill/rfkill0/state root@embeddedsystem:~# hciattach -t 30 -s 115200 /dev/ttymxc2 texas 3000000 flowFound a Texas Instruments' chip!Firmware file : /lib/firmware/ti-connectivity/TIInit_7.6.15.btsLoaded BTS script version 1texas: changing baud rate to 3000000, flow control to 1Bluetooth: HCI UART driver ver 2.3Bluetooth: HCI UART protocol H4 registeredBluetooth: HCI UART protocol LL registeredDevice setup completeroot@embeddedsystem:~# hciconfig hci0 uproot@embeddedsystem:~# hciconfig hci0 sspmode 1 //simple pairing//Enable controllerroot@embeddedsystem:~# bluetoothctl[bluetooth]# power on[bluetooth]# agent on[bluetooth]# default-agent[bluetooth]# quitroot@embeddedsystem:~# rfcomm bind /dev/rfcomm0 AA:AA:AA:AA:AA:AA 22root@embeddedsystem:~# sdptool add --channel=22 SP //Serial port on channel 22root@embeddedsystem:~# rfcomm //check to see if channel is okrfcomm0: AA:AA:AA:AA:AA:AA channel 22 cleanroot@embeddedsystem:~# rfcomm connect /dev/rfcomm0 AA:AA:AA:AA:AA:AA 22Can't connect RFCOMM socket: Connection refusedHere is where I get stuck. I have no idea why the connection is being refused when I can connect without problems using bluetoothctl (confirmed on my phone). It took me awhile to get here so I am not exactly sure what is the difference between bluetoothctl and rfcomm. From poking around I just see that you need to use rfcomm to get a serial connection. All I want to do is to grab my phone contacts from my phone using command line. I guess I am also asking if it is achievable to get my phone contacts without using rfcomm but using a connection through bluetoothctl. Thanks for all the help I greatly appreciate it!P.S. If anyone knows how to grab files from my phone via command line without using OBEX I would appreciate it as well!
How to connect to my phone via bluetooth serial
embedded;bluetooth;bluez