User Tools

Site Tools


PIDflight Lap

How to connect to Bluetooth with the GUI application for Linux

This guide should apply to most Linux distributions, this was specifically performed on Ubuntu 18.04.

  1. Pair to the Bluetooth module (e.g. HC-06/HC-05/HM-10) using bluetoothctl.
    1. Type scan on to discover the Bluetooth module and MAC address.
    2. Type pair <MAC_address> to pair, enter pin/pass code when/if prompted.
    3. Type exit to leave Bluetooth control utility.
      $ bluetoothctl 
      [NEW] Controller B8:D1:3F:07:76:AE CMengler [default]
      Agent registered
      [bluetooth]# scan on
      Discovery started
      [CHG] Controller B8:D1:3F:07:76:AE Discovering: yes
      [NEW] Device 20:17:01:12:21:09 PIDFLIGHT
      [bluetooth]# pair 20:17:01:12:21:09
      Attempting to pair with 20:17:01:12:21:09
      [CHG] Device 20:17:01:12:21:09 Connected: yes
      Request PIN code
      [PID..agent] Enter PIN code: 1234
      [CHG] Device 20:17:01:12:21:09 UUIDs: 00001101-0000-1000-8000-00805f9b34fb
      [CHG] Device 20:17:01:12:21:09 ServicesResolved: yes
      [CHG] Device 20:17:01:12:21:09 Paired: yes
      Pairing successful
      [CHG] Device 20:17:01:12:21:09 ServicesResolved: no
      [CHG] Device 20:17:01:12:21:09 Connected: no
      [bluetooth]# exit
      Agent unregistered
  2. Bind to your paired Bluetooth module with RFCOMM.
    1. 0 refers to the device (e.g. /dev/rfcomm0 will be created in this case).
    2. 20:17:01:12:21:09 is the MAC address of the paired Bluetooth module.
    3. 1 is the channel to use.
      sudo rfcomm bind 0 20:17:01:12:21:09 1
  3. Open the GUI lap timing app.
  4. Select 'Manual selection' from the drop down menu.
  5. Enter /dev/rfcomm0 in the 'Ports' field.
  6. Click 'Connect'.

When you have finished with the Bluetooth connection, type the following to release the rfcomm0 device.

sudo rfcomm release 0
pidflightlap/guibluetoothlinux.txt · Last modified: 2018/12/02 20:45 by cmengler