Hello,
I’m on a project where we must use the minimum energy possible. In order to reduce Imp’s consumption due to the WIFI connection, we need to work with the Imp disconnected from the WIFI and only connect to it once per hour to upload the collected data.
Is there any function that can help me?
Absolutely, the Imp is great at this. Take a look at the functions in the following example code:
if (server.isconnected()) { // If WiFi is connected server.expectonlinein(30); // Disconnect, and let the server know we should be back in 30 seconds } //Do stuff imp.onidle(function() { //Whenever the device is not busy doing something server.expectonlinein(30); //Schedule disconnect and sleep imp.deepsleepfor(25); });