panbachi / wordclock

DIY WordClock
https://www.panbachi.de/eigene-word-clock-bauen/
MIT License
107 stars 45 forks source link

Hour jumping #8

Open valknut89 opened 3 years ago

valknut89 commented 3 years ago

I think I found a mistake. I have a grid in Config of 10×11 and DE_alt. The the hour jumps back and forth between the correct hour and an hour before. every two minutes

fabmsg commented 3 years ago

I have been facing that issue for some time. What did you change to correct it?

achkoe commented 3 years ago

I am facing this issue too. For example between 19:25 and 19:26 there seems to be a difference of 1 hour in displayed time.

valknut89 commented 3 years ago

we debugged the time.cpp and found that the time zone query changes between 0 and 3600. the HTTP return is sometimes incorrect. So we changed the void loop() and set a fix time in seconds

"void Time::loop() { Time::ntpClient.update();

int h = Time::ntpClient.getHours(); int m = Time::ntpClient.getMinutes();

if(m != Time::minute) { if(m == 0 && h == Time::hour) { h = (h + 1) % 24; }

Time::hour = h;
Time::minute = m; 
Grid::setTime(Time::hour, Time::minute);
Time::ntpClient.setTimeOffset(3600);
Serial.println(h);

} "

napsio commented 3 years ago

Do you use the stable version (4.0.1) or the master branch?

SehlingS commented 3 years ago

Do you use the stable version (4.0.1) or the master branch?

I have the same problem with the master branch 4.0.1. But i think, only when i have activate the automatic time zone.

valknut89 commented 3 years ago

Do you use the stable version (4.0.1) or the master branch?

I can only download one branch from here. So I took this branch

fabmsg commented 3 years ago

Is it possible to fix the timezone? I cannot change it because is greyed out image

SehlingS commented 3 years ago

Is it possible to fix the timezone? I cannot change it because is greyed out image

You have to restart the device after you set it to inaktiv. then you have the possibility to change the time zone to mabey +1

ibrot commented 3 years ago

Hi,

I had the same issue a while ago. Back then it was jumping between 0 and 7200 because of the daylight saving time.

I fixed it that I did not use 0 as a fallback for the timezone, but using the last known timezone if we get a bad response from the time zone provider.

I created a pull-request #10 , you might want to look into it ;)

napsio commented 3 years ago

This might be only an issue for the master branch. The release 4.0.1 does not have automatic timezones. I'll check the #10 pull-request.

valknut89 commented 3 years ago

where can i download 4.0.1 ?

napsio commented 3 years ago

Look at: https://github.com/panbachi/wordclock/releases

valknut89 commented 3 years ago

thank you for your great work

valknut89 commented 3 years ago

In Master-Branch the Option "Automatische Zeitzone" is reset to "Aktiv" after set "Inaktiv" and coldstart ESP.

SehlingS commented 3 years ago

i can confirm that, but the automatic will work fine with the last changes from ibrot.

LoenzeDoenz commented 3 years ago

"Automatische Zeitzone" for me in germany is not working.. offset is not correct. Also Manual offset is not working.

SehlingS commented 3 years ago

I can send you a ready to flash bin to test it out. Maybe you use other libarys.

wordclock.ino.d1_mini.bin_11x11_de_DE_Gridfirst2_gridsingleminute1.zip

p3moto commented 3 years ago

we debugged the time.cpp and found that the time zone query changes between 0 and 3600. the HTTP return is sometimes incorrect. So we changed the void loop() and set a fix time in seconds

"void Time::loop() { Time::ntpClient.update();

int h = Time::ntpClient.getHours(); int m = Time::ntpClient.getMinutes();

if(m != Time::minute) { if(m == 0 && h == Time::hour) { h = (h + 1) % 24; }

Time::hour = h;
Time::minute = m; 
Grid::setTime(Time::hour, Time::minute);
Time::ntpClient.setTimeOffset(3600);
Serial.println(h);

} "

also with this one the automatic modus ist still one hour wrong..
is shows "9:00" but should be "10:00".

edit: it still jumps

valknut89 commented 3 years ago

we debugged the time.cpp and found that the time zone query changes between 0 and 3600. the HTTP return is sometimes incorrect. So we changed the void loop() and set a fix time in seconds "void Time::loop() { Time::ntpClient.update(); int h = Time::ntpClient.getHours(); int m = Time::ntpClient.getMinutes(); if(m != Time::minute) { if(m == 0 && h == Time::hour) { h = (h + 1) % 24; }

Time::hour = h;
Time::minute = m; 
Grid::setTime(Time::hour, Time::minute);
Time::ntpClient.setTimeOffset(3600);
Serial.println(h);

} "

also with this one the automatic modus ist still one hour wrong.. but is seems to be constantly wrong and dosent jump anymore is shows "9:00" but should be "10:00".

With this version there is no automatic mode. It isn't wrong, it is fixed to a special timezone. The webinterface has to ne changed too With this time.cpp.

p3moto commented 3 years ago

we debugged the time.cpp and found that the time zone query changes between 0 and 3600. the HTTP return is sometimes incorrect. So we changed the void loop() and set a fix time in seconds "void Time::loop() { Time::ntpClient.update(); int h = Time::ntpClient.getHours(); int m = Time::ntpClient.getMinutes(); if(m != Time::minute) { if(m == 0 && h == Time::hour) { h = (h + 1) % 24; }

Time::hour = h;
Time::minute = m; 
Grid::setTime(Time::hour, Time::minute);
Time::ntpClient.setTimeOffset(3600);
Serial.println(h);

} "

also with this one the automatic modus ist still one hour wrong.. is shows "9:00" but should be "10:00".

edit: it still jumps

With this version there is no automatic mode. It isn't wrong, it is fixed to a special timezone. The webinterface has to ne changed too With this time.cpp.

the time still jumpes...

i added this lines Time::ntpClient.setTimeOffset(3600); Serial.println(h); in the code of the time.cpp, like: grafik

"The webinterface has to be changed too With this time.cpp." no it did not change anything there... still could use automatic timezone

maybe i missunderstood sth. i dont have a clue of C++.

valknut89 commented 3 years ago

we debugged the time.cpp and found that the time zone query changes between 0 and 3600. the HTTP return is sometimes incorrect. So we changed the void loop() and set a fix time in seconds "void Time::loop() { Time::ntpClient.update(); int h = Time::ntpClient.getHours(); int m = Time::ntpClient.getMinutes(); if(m != Time::minute) { if(m == 0 && h == Time::hour) { h = (h + 1) % 24; }

Time::hour = h;
Time::minute = m; 
Grid::setTime(Time::hour, Time::minute);
Time::ntpClient.setTimeOffset(3600);
Serial.println(h);

} "

also with this one the automatic modus ist still one hour wrong.. is shows "9:00" but should be "10:00". edit: it still jumps

With this version there is no automatic mode. It isn't wrong, it is fixed to a special timezone. The webinterface has to ne changed too With this time.cpp.

the time still jumpes...

i added this lines Time::ntpClient.setTimeOffset(3600); Serial.println(h); in the code of the time.cpp, like: grafik

"The webinterface has to be changed too With this time.cpp." no it did not change anything there... still could use automatic timezone

maybe i missunderstood sth. i dont have a clue of C++.

pls have a look at #9 (comment) and you have to delete line 31-34 in your code, insert line "Time::ntpClient.setTimeOffset(3600);" also to setup in time.cpp You can try the version 4.0.1. There is no auto-timezone