You are reading a single comment by @Robin and its replies. Click here to read the full conversation.
  • Fri 2020.04.17

    Hey @AkosLukacs, thank you for that working example. That does answer the turning on the high power side of things.

    By chance are you aware of any snippets that might resolve the catch-22 situation? Both @ColinP and I are trying to figure out a way to have the Puck (in your example) lie in wait in sleep mode, but still have the ability to respond when the smart phone is close enough, which somehow signals the sleeping Puck. Presumeably, the Mag ref is only to show how to enable a high power consuption device?

    My only idea was to wake say every minute and broadcast. If no immediate ~5 sec response, go back to sleep, thereby conserving precious battery. When in range, decrease broadcast power and decrease the listening interval to around every five seconds. Interesting dilema, and one I plan on tackling, once my flash device arrives. (presumably you've been following that progress in the other thread, and thanks for that gsmdevice comparablity link there) ;-)

    Beacons seem to do this task, but the tutorial here didn't seem to address that, unless I misunderstood. Tutorial iBeacons seem to be always on. I'll re-read tomorrow.

  • By default (connectable if you want to connect, but not connected to anything) the Puck consumes around 20uA. If this is good enough for you, than you are done. :)

    The Puck handles connection intervals dynamically, so if you are not connected it only sends small advertising packets every 375ms. And if you connect and there is data transfer, switches to lower connection interval.

    Quoting Puck's power consumption and Nordic's "Online Power Profiler":

    • Advertising, 375ms 0dBm (default mode) - 20uA (Nordic: 26uA)
    • Not doing anything - 3uA
    • Not doing anything, watching the button for presses - 12uA
    • Advertising, 1000ms 0dBm - Nordic: 11uA
    • Advertising, 5000ms 0dBm - Nordic: 3.8uA
    • Advertising, 10000ms 0dBm - Nordic: 2.9uA (this is lower than Gordon's Not doing anything might be because of other parts in the Puck)


    I think you can try these things:

    • call NRF.sleep(), and wake periodically with setInterval. I think this was in your last paragraph. Don't know the consumption of this one (the impact of setInterval). But would be kind of annoying if I had to wait & scan...
    • increase the connection interval with NRF.setConnectionInterval() from the default 375ms. Should save some power, and would be still easily connectable
    • turn off the radio, and only turn it back on button press. That would be the 12uA power consumption in idle

    So if believe Nordic's numbers, Espruino's internals don't interfere, and there is nothing else running, 1 second (and of course anything biger) advertising interval would be better than turning off the radio and watching a pin for button press. And would be still easily connectable without excessive waiting...

About

Avatar for Robin @Robin started