Bluetooth® SPP Verification with RFCOMM and BlueTerm* App for Intel® Edison Boards





To test SPP using RFCOMM between an Android* device and an Intel® Edison device, download and install the BlueTerm* app on an Android device.

This guide explains the process, including pairing the Android device with the Intel Edison device and SPP verification using RFCOMM. For the Intel Edison device, we use 98:4F:EE:03:03:03 as its Bluetooth* address; for the Android device, we use A0:B4:A5:XX:XX:XX.

Note This guide assumes you have a serial connection established with the Intel® Edison device.
  1. Unblock Bluetooth using the rfkill command, then run the bluetoothctl command:
    root@MyEdison:~# rfkill unblock bluetooth
    root@MyEdison:~# bluetoothctl
    [NEW] Controller 98:4F:EE:03:03:03 MyEdison [default]

  2. Register the agent and make it the default:
    [bluetooth]# agent KeyboardDisplay
    Agent registered
    [bluetooth]# default-agent
    Default agent request successful

  3. Start scanning for Bluetooth devices using the scan on command. After your Android device is displayed on the Intel Edison, stop scanning for devices with the scan off command:
    [bluetooth]# scan on
    [CHG] Controller 98:4F:EE:03:03:03 Discovering: yes
    [NEW] Device A0:B4:A5:XX:XX:XX Android Device (Galaxy Note4)
    [bluetooth]# scan off
    Discovery stopped
    [CHG] Controller 98:4F:EE:03:03:03 Discovering: no

  4. Pair the Android device and the Intel Edison device using the pair command and the Bluetooth address for the Android device:
    [bluetooth]# pair A0:B4:A5:XX:XX:XX
    Attempting to pair with A0:B4:A5:XX:XX:XX
    [CHG] Device A0:B4:A5:XX:XX:XX Connected: yes
    Request confirmation
    [agent] Confirm passkey 527722 (yes/no): yes
    [CHG] Device A0:B4:A5:XX:XX:XX Modalias: Bluetooth: XXXXXXXXXXX
    [CHG] Device A0:B4:A5:XX:XX:XX UUIDs:
    [CHG] Device A0:B4:A5:XX:XX:XX Paired: yes
    Pairing successful
    [CHG] Device A0:B4:A5:XX:XX:XX Connected: no

  5. Request from the Android device to connect with the Intel Edison board and authorize the service request on Intel Edison:
    Authorize service
    [agent] Authorize service 0000111e-0000-1000-8000-00805f9b34fb (yes/no): yes
    [bluetooth]# disconnect A0:B4:A5:XX:XX:XX
    Attempting to disconnect from A0:B4:A5:XX:XX:XX
    Successful disconnected
    [bluetooth]# exit
    Agent unregistered
    [DEL] Controller 98:4F:EE:03:03:03 MyEdison [default]

  6. Because we are using BlueTerm/BlueTerm+, it uses channel 1 for Android devices instead of channel 22. On the Intel Edison device, create the rfcomm 0 port with channel 1 in the background:
    root@MyEdison:~# rfcomm listen 0 1 &
    Waiting for connection on channel 1.

  7. Open the BlueTerm app on the Android device and request to connect (in the app) to the Intel Edison device. Once the connection is established between devices, Intel Edison displays there is a new connection to /dev/rfcomm0:

    BlueTerm app

    root@MyEdison:~# Connection from A0:B4:A5:XX:XX:XX to /dev/rfcomm0
    Press CTRL-C for hangup

  8. To see the text transmitted from the Android device to the Intel Edison device, use the cat command:
    root@MyEdison:~# cat /dev/rfcomm0
    Sending text from Android
    Notify me when received.

  9. To send text to the Android device, use the echo command:
    root@MyEdison:~# echo "Hi, I received your message. Hanging up now." > /dev/rfcomm0

  10. The rfcomm process is running in the background; to hang up, look for the process number using the ps command and terminate it using the kill command:
    root@MyEdison:~# ps
    343 root 0 SW< [kworker/u5:0]
    344 root 0 SW< [hci0]
    345 root 0 SW< [hci0]
    346 root 0 SW< [kworker/u5:1]
    347 root 1736 S brcm_patchram_plus --use_baudrate_for_download --no2
    348 root 0 SW< [kworker/u5:2]
    353 root 1792 S rfcomm listen 0 1
    356 root 2896 R ps
    root@MyEdison:~# kill 353