OpenSprinkler › Forums › Third-Party Software › wrong dates with WeatherUnderground API
Tagged: weather, WeatherUnderground, wrong dates
- This topic has 9 replies, 4 voices, and was last updated 4 years, 5 months ago by Ray.
-
AuthorPosts
-
October 9, 2017 at 12:59 am #47985
AnonymousInactivein “Last Weather Call” and “Last Successful Weather Call”, I’m getting wrong dates, i.e., 6 Feb 2106. Also time is forward about 1 1/2 hrs. Should I delete my WeatherUnderground key and reinstall this feature?
October 9, 2017 at 3:43 pm #48013
SamerKeymasterWhat times are shown for the device time? Also can you possibly make a backup of your configuration and send us that via email ([email protected])? I want to check the timestamp the controller is showing compared to the date displayed on the app (as they app maybe parsing the timestamps incorrectly due to timezone issues).
October 10, 2017 at 12:20 am #48020
AnonymousInactiveUnfortunately I recently lost the controller hardware completely and I’m looking to replace asap. Support ticket for this issue is being processed separately. I won’t know what’s going on inside software configurations until the unit is up and running again.
In the interim, I’m hooking up a spare Rainbird controller to keep my garden going. Thanks for the response!
April 9, 2020 at 9:34 am #65061
akomParticipantI know this is old, but I’m having the same issue with the unified firmware. When OS boots up it gets correct time from (my local) NTP server and displays correct time in the web UI. Sometime after (hours or minutes), the time switches to this: Feb 06, 2106 02:58:49. This is repeatable.
This is all I have in the serial debug output:
NTP Syncing…
X.X.X.X
NTP done.
1586435525(That’s the output from boot, there is no further output when the time gets screwed up).
I have not configured a Weather Underground key (assuming that this is OK), and the forecast is displayed correctly and for correct dates.
Attached is the diagnostic screen. Note that OS has been up for only about an hour, but “Last Request” and “Last Reboot” are both completely wrong (screenshot is from April 9, 2020)Happy to provide further details or let me know what I should try on my end.
(I’m running the latest master firmware with some tweaks for my relays, nothing to do with NTP. I can load clean master branch as well for a test)
Attachments:
April 9, 2020 at 9:37 am #65064
RayKeymasterCan you go to Settings page and check under Advanced, NTP server, what’s the NTP server IP there? The latest firmware has a logic where if NTP IP is 0.0.0.0 it uses the default ntp.pool.org, otherwise it uses your specific NTP IP. At factory reset, it set NTP IP to 0.0.0.0 so it uses the default ntp.pool.org. However, if you upgraded from a previous version of the firmware, it may have some other NTP IP there, which may have stopped working reliably.
April 9, 2020 at 11:23 am #65065
akomParticipantThanks for the reply.
I had it configured to use my NTP server (on my local LAN) that is known to function correctly (all my DHCP clients use it).
I’ve now set it to 0.0.0.0 and will monitor stability.April 9, 2020 at 11:25 am #65067
RayKeymasterI just realized something: because you are using your own hardware build, it doesn’t seem like you have an RTC chip (DS1307 or PCF8563 or any RTC). The firmware writes NTP time into RTC and syncs with RTC once every hours or so. If you don’t have RTC, it will certainly get incorrect time. You can comment out any code in main.cpp that has to do with RTC.
April 9, 2020 at 5:20 pm #65083
akomParticipantThat must be it (it eventually happened with 0.0.0.0 as well). I’ll dig through the code.
Thanks again!
April 10, 2020 at 8:19 am #65094
akomParticipantConfirmed that was it.
I worked around it in a way that would still work on official boards, and would also help if an RTC failed:=================================================================== --- main.cpp (revision 798d2fea340b9bccdb317a7bac285a5d3c31d33a) +++ main.cpp (date 1586518946000) @@ -297,9 +297,14 @@ pd.init(); // ProgramData init - setSyncInterval(RTC_SYNC_INTERVAL); // RTC sync interval - // if rtc exists, sets it as time sync source - setSyncProvider(RTC.get); + if (RTC.detect()) { + setSyncInterval(RTC_SYNC_INTERVAL); // RTC sync interval + // if rtc exists, sets it as time sync source + setSyncProvider(RTC.get); + } + // else no RTC: relying on NTP and for the clock to be somewhat accurate. + // May need to reduce NTP interval if the drift is bad + os.lcd_print_time(os.now_tz()); // display time to LCD os.powerup_lasttime = os.now_tz();
Happy to make a PR if that’s appropriate.
Many thanks for the guidance.
April 11, 2020 at 5:16 pm #65118
RayKeymasterSure, go ahead. I am also considering adding an option to disable RTC to provide some flexibility: we did encounter a couple of cases where the RTC chip went defective (it’s detectable but doesn’t work properly) causing the timing to be messed up. Adding the option can help bypass the problem.
-
AuthorPosts
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › Third-Party Software › wrong dates with WeatherUnderground API