Android Question BLE2 - Characteristic data throughput is slow

PhilipK

Member
Licensed User
Hi

I have an Arduino using the ArduinoBLE library. The board has a service which now has a handful of characteristics sending data from an IMU sensor. Cycling 100 samples per second, three characteristics each with three axes of data.

I have an LED on the Arduino which flashes every 100 cycles of IMU read (and does so when the B4A app is connected to the service before data transmission). It flashes slightly faster than 1 second intervals. A rate that I'm trying to achieve.

My B4A app. uses the manager.SetNotify() instruction, controlled by a timer, to launch successive connections to each of the characteristics.

Once the characteristics are live I do get data from the IMU. (In case it's the B4A code, as a test, I commented out all the code in the manager_DataAvailable routine.) Either way, the Arduino cycle slows dramatically; to the region of 100 cycles in TEN seconds.

Is there a setting, I'm missing? I have read in one post that throughput is potentially an issue but haven't found anyone providing insight or a fix. The Bluetooth LE standard talks about application throughput 0.27-1.37 Mbit/s.

Ideas, very welcome!

Thanks
 

PhilipK

Member
Licensed User
Hi Erel

Re timer: I use a timer with a half second interval to call the SetNotify for each of the characteristics: acc, gyro and mag. It appeared that the manager needs time to connect and calling multiple connections at the near same time, meant the connections weren't made or something stalled. Perhaps there's an alternative solution but this method works.

  1. Tried connecting to one characteristic only (the 3 axes Accelerometer data) and used ReadData produces elapsed read times of 59 - 330 msecs. (or 7 - 3 readings per sec) using Marco Vilucchi useful utility and adjusting the read timer to the max speed . Not sure why it is so slow.
  2. Back to SetNotify (on one characteristic only (the 3 axes Accelerometer data)) approximately 55-75 readings per sec.

Obviously, I'm trying to get the best throughput using BLE. I'd prefer to use BLE but if there's no way to accelerate it, I'll think about changing hardware to WiFi...

Any further ideas welcome.

Thanks for your help
 
Upvote 0
Top