(Updated)
I am trying to communicate with a BLE device using command-line or program.
I have paired with this device, using bluetoothctl v5.50:
[bluetooth]# paired-devices
Device XX:XX:XX:XX:XX:XX Mydevice
But when I try to read its characteristics with gatttool
, I get the answer Characteristic value/descriptor operation failed: Attribute requires authentication before read/write
.
sudo gatttool -b XX:XX:XX:XX:XX:XX -I -t random --sec-level=high
[XX:XX:XX:XX:XX:XX][LE]> connect
Attempting to connect to d2:a7:4c:76:f3:e0
Connection successful
[XX:XX:XX:XX:XX:XX][LE]> char-read-hnd 0x000e
Error: Characteristic value/descriptor read failed: Attribute requires authentication before read/write
[XX:XX:XX:XX:XX:XX][LE]>
I also tried with with bleah and I get the error Error from Bluetooth stack (comerr)
.
With bluetoothctl, list-attributes
does not return anything. And I am unable to read standard characteristic such as 00002a00-0000-1000-8000-00805f9b34fb
(Device Name):
[MyDevice]# list-attributes
[MyDevice]# attribute-info 00002a00-0000-1000-8000-00805f9b34fb
Attribute 00002a00-0000-1000-8000-00805f9b34fb not available
Note that the characteristics are readable (I enumerated the device with bleah): 0x000e has READ property.
Can somebody suggest a solution to read such characteristics?