"CCCD Handle not found" error from characteristic.startNotifications() #1060
Replies: 16 comments
-
Posted at 2020-08-03 by @gfwilliams Wow, that's a strange one - and you're sure you were calling
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-08-03 by Zakaton There was no
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-08-04 by @gfwilliams Ahh - thanks for posting up the code. That looks pretty good. I guess my thought is maybe the CCCD isn't at handle |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-08-05 by Zakaton It turns out the CCCD value for all the Notify characteristics are 0, which triggers the |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-08-06 by @gfwilliams Wow, thanks for tracking that down! I bet 0 is valid. I'll try and get a fix into Espruino for that today - I'll post up when done |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-08-06 by @gfwilliams Hmm... from the Nordic SDK:
So it looks a lot like the Bose device is actually using an out of spec handle. It does seem amazingly unlikely that anything would have a 0xFFFF handle, but then if we used that as an invalid handle we'd end up potentially breaking something that was ok. What I've done for now is to modify the code so that if you manually set So if you try a 'cutting edge' build now and you can get it working, let me know and i'll figure out another way of handling the CCCD discovery that will deal with a CCCD handle of 0. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-08-06 by Zakaton I flashed the latest build and now I don't get errors when I set And thank you so much for taking the time to help out so far |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-08-07 by @gfwilliams Thanks for letting me know - I'd be pretty sure it is setting the CCCD characteristic now, so I wonder whether there's something else that's not quite normal in the Bose bluetooth setup |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-08-07 by Zakaton The weirdest thing happened - when I enabled the sensors from my desktop browser (which triggers the device to stream sensor/gesture data), the CCCD's changed to I'm still not getting notifications, but I'll keep playing with it. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-08-19 by Zakaton Are there any tools besides the nRF Connect app I can use to debug this further? Also is there anyone I can pay to figure this out? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-08-19 by @gfwilliams All I could really suggest is https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Sniffer-for-Bluetooth-LE for sniffing the actual bluetooth traffic. However if bonding is required then it likely wouldn't be much use as the connection would be encrypted. Just a thought but is is possible that the device is expecting a number to be entered during the bonding process, and so the bonding actually fails? What does
You could post on http://forum.espruino.com/microcosms/1202/ and see if anyone replies? I can do consultancy work as well if needed? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-08-21 by gerardwr Hi, I have the same error as the topic starter, not sure if my problem is related, I'm rather new to Espruino/BLE so it may be a "user error". Here's my code, and the output it produces. It seems to run OK until the point when Notifications are enabled:
The NrfConnect output for the Notification is below. I know the handle for the notification is 0x0038. When I connect to the device using RPI-gatttool using this handle it starts Notifications immediately.:
Do I need to specify this handle specifically before using Any help is welcome.Attachments: |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-08-21 by gerardwr BTW : My device is a Xiaomi BLE Thermometer type LYWSD03MMC Attachments: |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-08-21 by gerardwr Update : working now! Reading the code from @zakaton and @gordon's response I added a
Now the Notifications are coming through.
Thanks for the inspiration. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-08-24 by @gfwilliams Great! I'd love to figure out why this isn't going though - it should really have been able to figure it out automatically. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-08-24 by gerardwr I always think it's ME, not this time ;-) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2020-08-03 by Zakaton
I'm writing a port of the Bose AR Web SDK to Bangle.js. Right now I'm able to connect to the BLE device, get the service/characteristics and read/write values, but I get a
CCCD Handle not found
error when I runcharacteristic.startNotifications()
on the characteristics with thenotify
property.I looked it up and it seems to look for a
handle_cccd
property on the characteristic so I looked it up and found the cccd0x1
and assigned it to the characteristics'characteristic.handle_cccd
property, and the error stopped. However I still don't get any notifications when adding an eventListener viacharacteristic.on('characteristicvaluechanged', callback)
.Beta Was this translation helpful? Give feedback.
All reactions