question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JS connection fails when characteristic has no descriptors

See original GitHub issue

Kable version: 0.10.2 Kotlin version: 1.5.31 (using IR)

Chrome version: 95.0.4638.54 (64 bit)

Upon trying to connect to my BLE device, I get the following error message:

SystemLogEngine.kt?d539:37 [Kable] z6FTIjgMta7LYVye0Uu2zQ== Unable to retrieve descriptor.
  service: 00001000-0000-1000-8000-00805f9b34fb
  characteristic: 00001001-0000-1000-8000-00805f9b34fb
DOMException: No Descriptors found in Characteristic.

By using a different, third-party BLE tool (“nRF Connect for Mobile” Android app) I have been able to establish that the characteristic mentioned in the error message indeed has no descriptors. kable_issue

In terms of the source code, I have been able to figure out that…

  1. Upon connecting to a Peripheral, all Services are being queried and converted to PlatformServices: https://github.com/JuulLabs/kable/blob/0.10.2/core/src/jsMain/kotlin/Peripheral.kt#L178
  2. For each individual Service, the Characteristics are in turn queried and converted to PlatformCharacteristics: https://github.com/JuulLabs/kable/blob/0.10.2/core/src/jsMain/kotlin/PlatformService.kt#L24
  3. Each individual Characteristic queries a list of descriptors: https://github.com/JuulLabs/kable/blob/0.10.2/core/src/jsMain/kotlin/PlatformCharacteristic.kt#L27
  4. The Characteristic uses the external getDescriptors method in the Web Bluetooth API: https://github.com/JuulLabs/kable/blob/0.10.2/core/src/jsMain/kotlin/external/BluetoothRemoteGATTCharacteristic.kt#L19
  5. That method seems to throw an error when there are no Descriptors (cf. the original error report “No Descriptors found in Characteristic”, which triggers the catch handler in https://github.com/JuulLabs/kable/blob/0.10.2/core/src/jsMain/kotlin/PlatformCharacteristic.kt#L28

Please note that I am not knowledgeable enough in Bluetooth or BLE technology to understand what a Characteristic not having Descriptors even means, or whether it is allowed per the Bluetooth specifications. The device I am using is a Rubik’s Cube that can track movements and rotations, cf. https://www.thecubicle.com/products/moyu-weilong-ai-3x3

Thank you for your awesome Kotlin library 😄

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
gregorbgcommented, Oct 25, 2021

With your snapshot, the exception changes from GATT operation failed for unknown reason. to GATT operation not permitted.

The cube is publicly available, it’s called “MoYu WeiLong AI”. You can purchase one at

But I really won’t expect the maintainers of a free, open-source project to spend 70USD for debugging a random Bluetooth issue! 😅 I’d be more than happy to get in touch via the kotlinlang Slack, I think my username is either gregorbg or Gregor Billing over there.

0reactions
twyattcommented, Nov 24, 2021

An update on this. I received the “MoYu WeiLong AI”, but have not yet had time to revisit this issue. I’ll try to find some time soon though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ble web cannot read from a characteristic - Stack Overflow
When I read the characteristics from ble web, I get a "NotSupportedError: GATT operation failed for unknown reason." here is the part to ......
Read more >
Characteristic 0003cdd1-0000-1000-8000-00805f9b0131 ...
I use "monitorCharacteristicForDevice" method to receive notification from device. but error occurs as follows:
Read more >
BluetoothCharacteristicProperties - Web APIs - MDN Web Docs
Returns a boolean that is true if notifications of the characteristic value without acknowledgement is permitted. read Read only Experimental.
Read more >
Unable to add descriptors to the characteristic - Nordic Q&A
The second characteristic has only read and write properties. ... did not face any problems and i could see them on the nRF...
Read more >
960258 - Windows 10 startNotifications fails with error on ...
If i want data from non protected characteristic it is working ok, like fetching device name, since it is not protected. Also i...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found