-
• #2
If you only care about BLE then any nrf52 device you have is basically the same regarding radio power consumption. The power efficiency is slightly improved when using external 32kHz crystal and when builtin DC/DC converter is enabled (Bangle 2 has both) but the difference is not so big. The best device is one where you can actually measure the current. However I am not aware of any Espruino device that could measure it by itself. Maybe the 52832DK 52840DK Nordic devboards have something.
My guess is that lowest power consumption would be when maintaining connection with long connection interval. Scanning for advertising may draw more on the scanning side as the radio receiver must be enabled for longer time. With a connection both sides are synchronized and wake only briefly and exactly when needed to maintain connection or send/receive data.
Basic stuff can be estimated even with simple multimeter if it can measure down to few microamps. However the power draw is dynamic so the meter will jump or show some average.
-
• #3
E.getPowerUsage
was added in version 2v22 (https://www.espruino.com/Reference#l_E_getPowerUsage) - but it's more of a guesstimate and probably won't be much use in your case - actual BLE power usage isn't known by the hardware.There are some minor differences in power usage between the 52840 in the Bangle and the 52832 in the Puck, but realistically measuring power usage with the Puck would be good enough.
If you really want to get into it, Nordic sells a power profiler board which is really cool - and you could attach the Puck to that. It's £100 but is a really useful device: https://www.nordicsemi.com/Products/Development-hardware/Power-Profiler-Kit-2
Otherwise another option is if you have an oscilloscope, power the Puck via a 1 Ohm resistor, then attach the scope across the resistor. Modern digital scopes often even have the ability to integrate all the readings, which will give you a decent power draw figure.
Even with a multimeter if you have a big capacitor and a low resistor value, you can smooth out the power draw spikes enough that you can get some rough idea what's going on, but it's hard to be 100% sure on the reliability.
As @fanoush says actually maintaining a connection is going to be the most low power way of tracking, as having the radio in receive mode is very expensive (10mA or so).
https://www.espruino.com/Tilt+Repeater does something neat though - it takes advantage of the fact that advertisements are sent every Xms, so once it finds an advertisement it immediately stops scanning and then only starts again in time to catch the next one.
You just have to be careful because advertising is intentionally sent a random time period either side of the advertising interval, so you can't start listening at exactly the right time - you always have to have some leeway
I'm working on a BLE "things tracker" that e.g. warns when your keys (with an attached BLE transponder) fall out of your pocket. I was wondering if there are any APIs that expose current/recent/etc. power consumption of the Bangle.js 2?
The power consumption for the watch talks about some rough figures, according to this page these might have been obtained by directly measuring the chipset/battery power draw with a multimeter or similar?
If there is no built-in API what would be the best/easiest way to get insight into power usage of the chipset while trying various scanning options/approaches?
I would rather not pick my Bangle apart, but I have a puck/couple Pixel.js-es lying around, was thinking maybe these could work as a proxy? Are they sufficiently similar? Any tips are welcome!