If the imp was to be used to respond to an external input (say, http) and do something with real-time or near real-time response, e.g. open a door, how would it be configured so that it’s not consuming a lot of power listening to http? Or is it not designed to work in this fashion and conserve battery power?
If you can spare about 5mA, then you can just use imp.setpowersave(true). When your code is idle, the imp will be taking about 5mA whilst still being associated to wifi. This will be dropping to ~2mA when we finish the power save implementation later this year.
You can sleep at 6uA, then connect periodically to check for messages. This is much easier to do with agents, coming to general users hopefully in the next month (they’re in closed beta now). eg, connect every 5 minutes.
Like (2), but you also wake on a local event, eg an accelerometer interrupt or a motion detector. This is good for things like doors, whose locked/unlocked state is largely immaterial until someone tries to go open them.
Thanks, this helps. So maybe for something like a door open system then, my request to open the door is a signal to modify the state of some REST service. My imp polls the REST service every 5 seconds, so then my duty cycle goes down to about 20%. I don’t get instant response, but I save a bunch of battery and a slight delay is no big deal.
Possibly, but waking every 5 seconds is going to be a serious battery drain (more than staying awake at 5mA) as it would be associating, DHCPing, and doing a TLS connection setup every time you woke. You’d have to extend the time between polls more.
You don’t need a REST service with the agents. You just wake and ask the agent what the door state should be. The agent runs in our servers, so stays “awake” all the time - you can send it messages any time you want via HTTP.