+1 vote
in Touch Interface by (510 points)
I noticed that the time is correct for several hours and then it goes back to epoch time.  There is no printout for getting the time update so i cannot tell if it is trying and cannot connect.  Big Problem.

I ran the example for Minimal NTP Time Demo with DST correction and it not only displays the initial time, it displays when the next update is due..  Diagnostics can be very helpful especially with 500 different users.

I also had some initial problems with the touch screen and you solved it by running the spiffs format/  IOnce that ran, I noticed that when I tapped the top (Time Area) that I go the background data screens.  When I tapped near the bottom, I go the time format change.  So i had to go into the .ino around line 200 and modify: from <80 to >80 and it seemed to work OK..... if (p.y > 80).  Minor problem.

I hear your pain with the touch screen, but this is the first time I have been able to try the touch screen and I appreciate your leadership into this area.

3 Answers

0 votes
by (10.0k points)
selected by
 
Best answer
Hi Bill

My dad reported today the same issue about the time. This must be related to an update of the NTP time server. After this happens, do you have to reset the device or it recovers by itself and goes back to real time without further issues?

Dani
by (510 points)
Dani,

I restarted the unit and it ran good ( Kept correct time) up to ~ 6 hrs into the run. Then back to 1970 year. On the next weather update it corrected the time itself.  I had checked it after 5 hrs and it was running OK so something happened between 5 to 6 running hours.  I'll leave it running but i'll be asleep before the next 6 hrs comes up!

Bill
by (510 points)
Update: The unit has been running OK ( as far as I have noticed)a nd then after 1d20 hes it was back to 1970 and did NOT clear up with the next weather update.  I had to push the reset button and it operated properly again with the correct time.
by (10.0k points)
I have an idea what might cause the issue. I recently merged a pull request and the contributor  added/moved these lines to updateData():
  WiFi.mode(WIFI_STA);
  connectWifi();
  [...]

  WiFi.mode(WIFI_OFF);
  delay(1000);

I think the WiFi.mode lines should be removed completely and the connectWifi method should be moved to the setup() method before the call of updateData.

I believe that the 1970 issue happens, when the device tries to update the time but due to the WiFi.mode(WIFI_OFF); it cannot reach the ntp server.

Can you please try this and confirm that it resolves the issue?
by (510 points)
Dani,

I commented out ONLY the two WiFi.mode lines and moved the connectWiFi() to setup() right before the call to updateData().

It compiled and ran OK with the time working properly.  I'll monitor it and let you know immediately if I notice any problems.  if no problems noticed after 2 days time I'll get back to you with a confirmation.

Bill
by (510 points)
Dani,

Its been running 2 days + without any time problems.  See like this problem was resolved by you suggested fix.

Thanks for your continued help.

Bill
by (120 points)
Hi,

I modified as suggested and can report 100% success.

Thanks for the assistance, much appreciated.

Colin
by (10.0k points)
Hi everybody. Thank you for your patience. I updated the code on github according to my suggestions above and since Bill and Colin report success I hope that will do! Thank you guys for testing!
https://github.com/squix78/esp8266-weather-station-color
by (510 points)
Dani,
I tried the new code and after running for 60 seconds correctly it goes into a new display that only shows date & time. No weather data.  Jumps around to different lines on the display. When I touch the screen, the page 1 of the data displays for a second, then disappears with the date and time back on the display.
Seems you changed more than just what we tested!

Bill
0 votes
by (300 points)
Hello,

thanks for this Information,

But can everyone explan the code? I have the same Problem , but I can't solver it.

I have 1:00:00 and Jan 01 1970

I change the NTP servers but nothing works.

Thanks

Makro
by (300 points)
that i do
  
  connectWifi();
  
  // update the weather information
  updateData();
  timerPress = millis();
  canBtnPress = true;
}

but no chance :-(
0 votes
by (300 points)
Halo Dani,

I use now your last scretch.

But i have the same problem again.
No time and Date :-(
It#s still standing at 1:00:00 and Thu Jan 01 1970
the time ist not running only stand
The weather informations are correct

I only put te wifi informations and the key location in the setup.h

regards makro
by (300 points)
Hello all,
everything is OK now.

Its was a Router Problem in my Company.

Regards Markus

Welcome to ThingPulse Q&A, where you can ask questions and receive answers from other members of the community.

https://thingpulse.com

...