No option for bluetooth pins for pairing

Update

It appears possible to pair and communicate with the module without using a pin, but so far only using gatttool. I am still learning about BLE, and it is unclear to me whether this is a normal feature (e.g. a low-security default mode), or whether the modules I am using (JDY-08 / BT05 / HM-10 style BLE serial) might be non-compliant and simply not using the pin as set.

Via the default connection tool in Ubuntu Mate

I am running Ubuntu Mate on a Lenovo P50. I am exploring a BT05 BLE module, but I cannot connect to the device due to what I think might be a bug in Ubuntu. The steps I am taking to connect the device are:

  1. From the bluetooth menu, I select "Setup new device".
  2. I select the device from the list
  3. and then proceed, selecting "pair device"
  4. A screen saying "Pairing in progress..." appears.
  5. After some minutes, the message changes to "Failed to add device".
  6. At no point in time am I prompted to enter the 6-digit pin code needed for pairing.

The pin is customized and cannot be inferred by the operating system (short of forcing 10^6 possibilities), so I need to be able to enter it when connecting to the device. This issue might be related. The commands found here are a possible solution, but to this date there remains no method of communicating with bluetooth devices through the graphical user interface.

Via bluetoothctl

bluetoothctl claims to connect (without using the custom pin). (this question is helpful for understanding what bluetoothctl is doing). However, it does not seem possible to read/write characteristics once the device is paired?

φ bluetoothctl
[bluetooth]# agent on
Agent registered
[bluetooth]# default-agent
Default agent request successful
[bluetooth]# scan on
[NEW] Device [address] [name]
[bluetooth]# scan off
[bluetooth]# pair [address]
Attempting to pair with [address]
[CHG] Device [address] Paired: yes
Pairing successful
[name]# info [address]
Device [address] Name: [name] Alias: [name] Paired: yes Trusted: yes Blocked: no Connected: yes LegacyPairing: no UUID: Generic Access Profile ([ID1]) UUID: Generic Attribute Profile ([ID2]) UUID: Device Information ([ID3]) UUID: Unknown ([ID4]) Modalias: bluetooth:[number]
[name]# list-attributes
[no attributes]

Based on, for example, this tutorial, I would expect Characteristics and Attributes to become available after pairing.

Via hcitool and gatttool

I am able to connect to the modules and access the relevant properties using the commands hcitool and gatttool. This is also without a pin.

φ sudo hcitool -i hci0 lescan --duplicates | grep 'earlybird'
[ADDRESS] [NAME]
φ gatttool -i hci0 -b [ADDRESS] -I
[ADDRESS][LE]> connect
Attempting to connect to [ADDRESS]
Connection successful
[ADDRESS][LE]> primary
attr handle: 0x0001, end grp handle: 0x000b uuid: 00001800-0000-1000-8000-00805f9b34fb
attr handle: 0x000c, end grp handle: 0x000f uuid: 00001801-0000-1000-8000-00805f9b34fb
attr handle: 0x0010, end grp handle: 0x0022 uuid: 0000180a-0000-1000-8000-00805f9b34fb
attr handle: 0x0023, end grp handle: 0xffff uuid: 0000ffe0-0000-1000-8000-00805f9b34fb
[ADDRESS][LE]> included
No included services found for this range
[ADDRESS][LE]> characteristics
handle: 0x0002, char properties: 0x02, char value handle: 0x0003, uuid: 00002a00-0000-1000-8000-00805f9b34fb
...
handle: 0x0024, char properties: 0x1e, char value handle: 0x0025, uuid: 0000ffe1-0000-1000-8000-00805f9b34fb

1 Answer

Actually the post you linked to is identical as they never had a PIN option either, the second picture was from someone else. I would try in terminal, with your BT05 device in pairing mode

echo -e "power on\n scan on" |bluetoothctl
Then you should see a reference to a new device with a MAC address and a name, use the MAC exactly as displayed in terminal or you can enter the first couple digits and use the TAB key to autocomplete
pair {MAC}
trust {MAC}
connect {MAC}
With any luck it will pair or ask you for the PIN to enter. If that doesn't work install Blueman
sudo apt install blueman
See if it will allow you to use the 6 digit PIN as this was a bug with gnome-bluetooth in 16.04 6

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like