Replies: 1 comment 2 replies
-
Hi @FugLong, About subscribing: ble-serial should automatically try to write the CCCD for notifications via start_notify in bleak, but seems like you already solved this in the peripheral Arduino code. For debugging the PC side try ble-serial with |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm integrating ble_serial with an arduino 33 ble based head tracker for pc games (using opentrack and its hatire plugin).
Basically I'm just having trouble getting the central (ble_serial) to update fast enough to pass head tracking data to opentrack effectively. It works, but is clearly updating only once every half second or so. I understand BLE is really not meant for constant communication but I have learned about BLE characteristic subscription and think it may be what I need.
I have the notify flag set on my read characteristic but I can't figure out how to get ble_serial to subscribe and listen to those notifications. Is there a way to enable subscription? Monitoring on my phone it seems pretty responsive but it's hard to tell with raw numbers.
I'm generating and sending 30 bytes at around 100hz in usb mode and attempting the same over BLE. Is this a pipe dream or is something like this possible?
*Edit: Looked into the bluetooth chip on my arduino (u-blox NINA-B306) and it should support way more than this throughput with no issues according to the data sheet. Also think descriptors might be the issue? The characteristic has a notify but it also has a "Client Characteristic Configuration" descriptor (UUID: 0x2902) that says "Notifications or indications disabled". Can't figure out how to modify that with ArduinoBle library.
*Edit 2: I've learned more about Cccd and I modified the Arduino BLE library to set the Cccd of my characteristic to 0x0001 (Notifications enabled) and it does seem to be updating faster, but it's still either losing 50% of its packets or updating too slow. Not sure how to diagnose, I'm new to bt. Still acting like it's only updating every 250 ms or so.
Beta Was this translation helpful? Give feedback.
All reactions