Hi, I have a battery powered weather station based on an ESP8266 that is in deep sleep mode most of the time, but wakes occasionally to send data to an MQTT server. This set up works well, but the station itself is quite inaccessible, so updating the firmware (as I sometimes want to do) is inconvenient because I have to demount the hardware and connect it to my laptop for programming over USB.
I have successfully used the excellent ElegantOTA library to do OTA updates on other projects and would like to do the same with the weather station, but of course the ESP is asleep and so I cannot access the update page on its webserver.
Ideally, I would like to be able to wake the MCU remotely so that I can use its webserver to do the updates.
Is there any way to do this “wake on webserver access” functionality?
My alternative solution is to check the time on the MCU each time it wakes up and at a predetermined time of day run the web server for say 20mins so that there is a window where I can do the updates. The down side of this is most of the time the webserver will be running for no purpose and it will run down the batteries more quickly.
Thanks in anticipation.
Hi.
That is a feature that would be certainly useful for a lot of us.
But, unfortunately, because the ESP is sleeping and the Wi-Fi is off, it doesn’t know we want to access the web server. I don’t think there isn’t a way to wake it up remotely via a web server call.
Regards,
Sara
Ok. I thought that would be the case, but thank you for taking the time to reply.
Ok. Thanks.
If you need further help, you just need to open a new question in our forum.
Regards,
Sara
Rather than turn on a web server for a period of time you can use an alternative OTA updater like OTADrive or IOT App Story. Every time your device wakes up to send data via MQTT it also checks to see if there is a new version available.
Thank you Steve. I will look into those alternatives.
It did seem extravagant to run a web server just in case there were an update coming.
Currently, I have it working using persistent mqtt messages to tell the esp not to go to sleep after the next check, but the batteries still do not last very long! Hopefully, changing to the approach that you suggest will help with this.
Dave
I think that the batteries that I was using before must have been a bit tired. I tried some other ones and they are lasting a lot longer. Unfortunately, I will not have much time to play with this for a while, but I will come back and report when I have got around to trying those other services. Thank you for your replies.
I think that the batteries that I was using before must have been a bit tired. I tried some other ones and they are lasting a lot longer. Unfortunately, I will not have much time to play with this for a while, but I will come back and report when I have got around to trying those other services. Thank you for your replies.