G6EJD / ESP32-e-Paper-Weather-Display

An ESP32 and 2.9", 4.2" or 7.5" ePaper Display reads Weather Underground data via their API and then displays the weather
Other
934 stars 203 forks source link

Waveshare 3.7 sleep code wrong #217

Closed grahamwhaley closed 1 year ago

grahamwhaley commented 1 year ago

It looks like I messed up my re-written 'do not wake up overnight' code when I did the Waveshare 3.7" display with the firebeetle.

this code looks like it is core to the issue, given both those variables are in effect statics!

if (WakeupTime < SleepTime ) { //Wake up tomorrow

I only noticed this once I'd finally (over a year later) built myself a physical unit to hang on the wall, and noticed the updates were definitely not doing what I expected! I think I must have had a brain fart when I wrote that code ;-)

I'll try to look at and fix this in the next few days - feel free to assign the open Issue to me!

G6EJD commented 1 year ago

Yes it passes the tests every hour!

it needs either to be using UNIX time or the tests need to be a lot more comprehensive.

Plus the RC based ESP32 internal clock is notoriously slow or fast so although you may expect it to wake in say 8-hours sone devices may wake early or late. The difficult one to solve is waking early so that it does not invoke another long sleep.