• 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

About

Avatar for Gordon @Gordon started