lmirel / MorphingClockRemix

a remix on the work of HarryFun's MorphingClock
https://www.instructables.com/id/Morphing-Digital-Clock/
78 stars 30 forks source link

Timezone out of sync with configuration #15

Open lmirel opened 5 years ago

lmirel commented 5 years ago

After installing the MorphingClock from Hary (works very fine) I was intrested in You project. It also works fine excluding to show the correct time. Date and the minutes of the clock are correct but not the hours. In my case /Germany/ it is showing always +7 hours from the correct time in Germany. Btw, the same bug happens with the SW "MorphingclockRemixRemix (KoljaS). I have no idea what is the problem. Change settings in Timezone are not relevant, nothing will change.

I have taken a printout from the monitor ( to have more information I have included informations from NTPClientLib. I'm not a programmer.

Configuration NodeMCU1.0, Flash size:4M(1M SPIFFS), CPU F=160MHz

10:35 I started the monitor FM6126A - REG: 12 FM6126A - REG: 13 WM: Adding parameter WM: timeZone WM: Adding parameter WM: military WM: Adding parameter WM: metric WM: Adding parameter WM: date_fmt No Double Reset Detected WM: WM: AutoConnect WM: Connecting as wifi client... WM: Using last saved values, should be faster WM: Connection result: WM: 3 WM: IP Address: WM: 192.168.179.25 timezone=1 military=Y metric=Y date-format=D.M.Y WiFi connected, IP address: 192.168.179.25 NTP server 0 set to: pool.ntp.org NTP time zone set to: 1, result: OK --Set daylight OFF Short sync interval set to 5 Long sync interval set to 1800 Time sync started -- NTP Server hostname: pool.ntp.org -- Transmit NTP Request Sync frequency set low No daylight First sync! 17:35:06 20/03/2019

Succeccful NTP sync at 17:35:06 20/03/2019 Long sync interval set to 10 i:connecting to weather server.. connected. w:unable to retrieve weather data *WM: freeing allocated params! display color range [0 .. 65535] day mode brightness showing the weather !no weather data available showing the date Long sync interval set to 86400 i:connecting to weather server.. connected. w:unable to retrieve weather data

Once a time it happened that the clock started after flashing the sketh with the time/Date: 08:00:03 01/01/1970 and after 10sec. it shows the correct time for a long long time...but after power off the new time is again +7 hours (false).

May be You have any idea Thanks in advance

(Burkhard)

burkadius commented 5 years ago

Hi Mirel, thanks for the answer. I hope You will solve the problem. Here is one remark from my side:

You wrote "The output from your console looks fine so the issue is not in the configuration, but it might be in the Time library or the NTP Library. Anyhow, I need to debug this to track it down or change the time support entirely."

The "get time" solution for the "original Morphing Colck" is completely an other and works for me without any problems. May be You can take this one. Burkhard

lmirel commented 5 years ago

Yes, I know that but I didn't want to have to handle that in my solution so I used external libraries. I need to debug it and find out which library is the issue before reporting it to their respective owners. It may be faster to go back to using the original NTP code but I still need to find time for it.

burkadius commented 5 years ago

Hi Mirel, I think I have found a solution for my problem . It always seems to me, that the MC is a in the initialization phase a little bit overloaded . Therefore I installed a delay before "getWeather". There is a uncomment //delay (1500). I activated it and change it to (row 276) delay (10000). After that every thinks is working fine, the current time is correct and the weather information also. Best regards Burkhard

lmirel commented 5 years ago

Interesting.. that it works adding a delay. Did you manage to fine-tune the delay? 10sec seems a bit much.

burkadius commented 5 years ago

Hi Imirel, no, I did not try to tune this delay. It happens only in the start up phase one time ( I think so). After this little change it alway synchronized without any problems. Burkhard

Am 04.04.2019 um 22:53 schrieb lmirel notifications@github.com:

Interesting.. that it works adding a delay. Did you manage to fine-tune the delay? 10sec seems a bit much.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lmirel/MorphingClockRemix/issues/15#issuecomment-480059583, or mute the thread https://github.com/notifications/unsubscribe-auth/AKHrSHIU726jQeeKW1cvynoJtmmgXN3Aks5vdmZggaJpZM4b_AFw.

ThePapatech commented 4 years ago

Sorry to come to this issue so late, but I am having the same issue. no matter what I set Timezone to in params it always shows 4 hours ahead. which is GMT. thank you for any insight.

lmirel commented 4 years ago

I’ve seen this a few times but couldn’t find the problem. it may come from the ntp lib but didn’t have time to investigate. it usually works if I reset or do a power cycle. did you try this to overcome the issue? sorry about this

ThePapatech commented 4 years ago

I have tried power on/off, different timezone numbers, delay, ... a bunch of things. I have the original morphing clock sitting right next to this one and it works fine, and other than being off 4 hours they are in sync. I was thinking that maybe I could hardcode the timezone and see if that matters, but I don't think it should.

lmirel commented 4 years ago

you could try hardcoding it to see. I used a different ntp lib than the original code..

ThePapatech commented 4 years ago

what timezone are you in? what time is it right now

lmirel commented 4 years ago

I’m CET so 20:25 I also use the timelib required by the ntplib so any one of these may have the issue

ThePapatech commented 4 years ago

put it into debug and saw the following which seems like the timezone isn't getting passed. Strange thing thought the other parameters are since it is showing F not C and time is not military

........success! IP Address is: 192.168.1.98 timezone= military= metric= date-format= dst= i:connecting to weather server.. connected. weather:{"coord":{"lon":-71.06,"lat":42.36},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"},{"id":600,"main":"Snow","description":"light snow","icon":"13d"},{"id":701,"main":"Mist","description":"mist","icon":"50d"}],"base":"stations","main":{"temp":35.22,"feels_like":21.16,"temp_min":32,"temp_max":39,"pressure":1030,"humidity":69},"visibility":2414,"wind":{"speed":17.22,"deg":120},"rain":{"1h":0.64},"clouds":{"all":90},"dt":1584991972,"sys":{"type":1,"id":3486,"country":"US","sunrise":1584960084,"sunset":1585004386},"timezone":-14400,"id":4930956,"name":"Boston","cod":200} cond Rain condM 4 temp: 35.22 temp min: 32 temp max: 39,"pressure":1030,"humidity":69 press 1030 humi 69} sunset 1585004386 sunrise 1584960084 display color range [0 .. 65535] showing the weather temperature: 35F temp min: 32 temp max: 39 weather conditions 4 !weather condition icon unknown, show: Rain showing the date Got NTP time: 19:33:01 23/03/2020 random weather reading at min 9 and 39 OTA update skip time now: 1584991981 day mode brightness showing the weather temperature: 35F temp min: 32 temp max: 39 weather conditions 4 !weather condition icon unknown, show: Rain showing the date

lmirel commented 4 years ago

you might need to erase flash and reconfigure, to make sure. btw, are you using the master branch or the ‘no-wm’ branch?

ThePapatech commented 4 years ago

I am using the no-wm branch

ThePapatech commented 4 years ago

could not get the reset to work to get to the wifi configuration.

lmirel commented 4 years ago

I’m using no-wm too on my 2 setups. try erasing flash and reconfig via web or params.h to see if you get any change in behavior for web/browser config http its IP address from pc/mobile

ThePapatech commented 4 years ago

Using the web browser to change params...it says it is set for timezone 4

use the following configuration links daylight on daylight off timezone 0 timezone 1 timezone 2 use /timezone/x for timezone 'x' brightness 0 (turn off display) brightness 10 brightness 50 brightness 100 brightness 200 use /brightness/x for display brightness 'x' from 0 (darkest) to 255 (brightest)

OTA update configuration (every minute) http:// (ip address:port/filename)

wifi configuration ssid: Office pass: Pls@1234

current configuration daylight: timezone: 4

home

set date and time to 2020.03.23 15:53:00 (next minute, disable wifi) using current date and time Mon Mar 23 2020 15:52:55 GMT-0400 (Eastern Daylight Time)

ThePapatech commented 4 years ago

I found that if I set the timezone through the webserver to-1 the time was correct......hmmmm

ThePapatech commented 4 years ago

hmmmm. now reset, had to ply around and this time -2 is correct...think I need to walk away for a bit...thanks for the software...I will take another crack at it later.

lmirel commented 4 years ago

check also daylight setting as they both affect time. what timezone are you in?

ThePapatech commented 4 years ago

Eastern US

Get Outlook for iOShttps://aka.ms/o0ukef


From: lmirel notifications@github.com Sent: Monday, March 23, 2020 4:20:32 PM To: lmirel/MorphingClockRemix MorphingClockRemix@noreply.github.com Cc: ThePapatech fredoniaopen@hotmail.com; Comment comment@noreply.github.com Subject: Re: [lmirel/MorphingClockRemix] Timezone out of sync with configuration (#15)

check also daylight setting as they both affect time. what timezone are you in?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/lmirel/MorphingClockRemix/issues/15#issuecomment-602833888, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALKXMPSURFK23EFLNX66M2DRI7ABBANCNFSM4G74AFYA.

ThePapatech commented 4 years ago

Just noticed this...clock is on non-military but shows different than the original morphing clock when it is 12:xx am.

ThePapatech commented 4 years ago

morphing clocks

lmirel commented 4 years ago

that’s most likely due to timelib as I’m not doing anything different