kiwx
Junior Member
Posts: 65
|
Post by kiwx on Oct 16, 2020 4:32:14 GMT -8
I first noticed that my PiZero was losing time. It started slowly, but the blynk timestamp just kept losing a few seconds to a minute per update. After about an hour, the updates to blynk stopped all together. When I checked the log file, the apschedular was complaining about the maximum allowed runs for "sampleanddisplay" function. Reboot. Then about an hour later, same issue.
After many reboots and turning on debug mode, it seems that something has changed at weatherunderground. When SkyWeather would send the API call, the logs would just stop until the scheduler would start throwing errors.
Solution:
WeatherUnderground_Present = False
In config.py/conflocal.py depending on your setup.
This resolved the time loss and blynk update issues for now. It's been running for 13 hours without issue. I will do more research into the actual cause today hopefully.
I want to use wunderground, maybe there needs to be a better error trap around the statement or something.
Thanks.
|
|
smurphy
Full Member
Posts: 169
Raspberry Pi: Yes
Other Device: many ...
|
Post by smurphy on Oct 16, 2020 10:09:05 GMT -8
What I did was add the ntp-server. Problem is that as the PI Zero has not real-time clock on board (the one keeping the time with battery), the time will be off on boot. What I did on my setup, is using ntpdate in /etc/rc.local file, pointing to a known ntp server. Once that is set, I start the ntp server.
# Setting system time (after a reboot) # systemctl stop ntp ntpdate 192.168.2.2 sleep 1 systemctl start ntp
With this, the time is set before weatherpi software starts. And the ntpd updates the time if it is out of sync.
|
|
kiwx
Junior Member
Posts: 65
|
Post by kiwx on Oct 18, 2020 16:33:33 GMT -8
Good suggestion, but doesn't resolve this issue. The SkyWeather.py script is stopping on the WU update call. This sends the PiZero into high CPU usage and the only noticeable effect is that the time starts slipping. Eventually blynk updates stop, and there are errors in the log about scheduler reaching maximum events for "sampleanddisplay". By setting the config file to not update WU, everything is working again, as well as ntp calls, and blynk.
|
|
|
Post by SDL on Oct 21, 2020 10:29:39 GMT -8
Kiwx,
I would try taking the WU update code and moving it to a separate program. Run it and see if it is is a SkyWeather problem or a WU problem. I'm suspicious. If it isn't a WU problem I'll have to instrument it.
BP
|
|
kiwx
Junior Member
Posts: 65
|
Post by kiwx on Nov 14, 2020 11:52:45 GMT -8
I moved the code to its own function and created a schedule for it to call the function every minute. I have had no issues since this and WU is being updated quick enough.
|
|