What's the best way to manage WiFi power consumption?

The documentation suggests using Spark.sleep() to put the WiFi module to sleep and wake up after some time interval.


The documentation references WiFi.status(). WiFi.status does not exist.

The documentation also suggests SYSTEM_MODES


However this seems like we take a lot of ownership on managing the spark connection.

I thought I would ask the community the best way to manage the WiFi connection. Spark.sleep seems like a good approach but not sure how to implement w/o WiFi.status.


Gosh the docs gave some wrong information a function that is not available.

@satishgn wrote the docs for Spark.sleep() and might be able to fix the description a bit with the correct functions to check against!

For now, i think sleep is a good option if the core is not required to be up and running all the time.

Another way is to try using AUTOMATIC and in the user firmware, turn off the Wifi module and switch it back on when you need it.

That should probably help a lot but i haven’t tried the behavior of the core when you do something like that. :wink: