Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By owendelong
#23616 In my application, I want to essentially wake up, gather a bunch of data from various sensors, send that data to a web server and then go back to sleep.

Since it takes some time to gather the data from the sensors, I'm using the wakeup mode from deep sleep where the radio is not powered.

However, it's not entirely clear how to then power up the radio when I'm ready to start transmitting (actually a few seconds before so that it can associate with the AP in the background, but not burn too much battery while I'm doing the prep work.

Anyone have any Arduino IDE compatible working example code that does strict power management on the 8266?

I'm using the Huzzah breakouts from Adafruit, but I also have some Sparkfun modules as well.
User avatar
By tytower
#23619
owendelong wrote:However, it's not entirely clear how to then power up the radio when I'm ready to start transmitting (actually a few seconds before so that it can associate with the AP in the background, but not burn too much battery while I'm doing the prep work.
Anyone have any Arduino IDE compatible working example code that does strict power management on the 8266?.

Well i have written an arduino ide code to do that in the wiki on this page (scroll up).
It wakes up ,reads sensors , sends the data and goes back to sleep. When the modem is not available it goes to sleep and checks back periodically. It ought to be fairly straightforward to alter it to allow whatever time you need to gather the data then connect then sleep . The act of deepSleep() closes the connection and restarts the chip from the start of the program.