• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Magic wake up

Q&A Forum › Category: ESP8266 › Magic wake up
0 Vote Up Vote Down
David Richards asked 3 years ago

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.

Question Tags: Deep sleep, WEB Server
9 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

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
 

0 Vote Up Vote Down
David Richards answered 3 years ago

Ok. I thought that would be the case, but thank you for taking the time to reply.
 

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Ok. Thanks.
If you need further help, you just need to open a new question in our forum.
Regards,
Sara

0 Vote Up Vote Down
Steve Mercer answered 3 years ago

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.

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi, Steve.
You’re right. Those are two excellent options.
Regards,
Sara

0 Vote Up Vote Down
David Richards answered 3 years ago

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

0 Vote Up Vote Down
David Richards answered 3 years ago

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.

0 Vote Up Vote Down
David Richards answered 3 years ago

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.

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi.
Thanks for sharing.
Then, keep us updated.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.