Wanted: BLE low power example

jackjansen
Posts: 2
Joined: Wed May 13, 2020 10:20 pm

Wanted: BLE low power example

Postby jackjansen » Wed May 13, 2020 11:03 pm

Can anyone point me to an example of a low-power BLE server? It's actually an actuator, so I can't simply send all data in the advertisement, it needs to be connectable.

What I'm doing at the moment is have a 2-second cycle, with 200ms awake with radio on (using about 70mA) and then 1800ms light sleep with radio off (less than 1mA). I've set the advertising interval so that I advertise when I wake up. When there's a connection I don't sleep. I've checked (by varying the durations and looking at a scope for power measurements and a BLE receiver for the data) that the device seems to do what I intended.

But this isn't optimal: I'm still using 7mA on average, and the BLE device is sluggish (to be expected, as it only advertises once every 2 seconds). I'm aiming for something like 1-2mA on average, and that doesn't seem to be unreasonable given the BLE devices that run for months while idle on a CR2032 and are still pretty reactive when connecting to.

And the 200ms I picked with the idea of "clients will connect shortly after receiving an advertisement, so 200ms seems reasonable". I've played with the various intervals (`BLEAdvertising::setMinInterval` and the other three), but this had disappointing results. And trying to find the meaning of those parameters in the 3200-page Bluetooth spec has proven to be beyond my abilities...

So, clearly I don't know what I'm doing, and I'm probably going at low-power completely the wrong way.

Can anyone point me to example code (or readable documentation) for low-power BLE servers?

rin67630
Posts: 102
Joined: Sun Mar 11, 2018 5:13 pm

Re: Wanted: BLE low power example

Postby rin67630 » Sat May 16, 2020 8:09 am

If you use the Arduino IDE, you have got the examples in File/Examples/ Examples for ESP32/ESP32 BLE Arduino...

(at their logical place, by the way)

Who is online

Users browsing this forum: No registered users and 69 guests