-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting to following error after latest upgrade for dark sky removal #252
Comments
what is your latitude / longitude (approximately is ok) I need to replicate the issue. |
lat = 39.359000 |
Sorry I haven't had time to research this yet. I'll get to it by sunday. |
@kmhutch Are those the only errors you see? Which version of Raspberry Pi OS or Raspbian are you using? Also, make sure the tzlocal python package is installed:
|
Yes the pip is upgraded on my piclock pi@piclock:~ $ sudo pip install tzlocal --upgrade Here is what I get in the log: tokens removed pi@piclock:~/PiClock/Clock $ more PyQtPiClock.1.log FYI I also run the pi with the timezone set to UTC. I use the pi clock in my ham shack for weather and UTC time. Its been set that way since I built years ago. Kevin H |
@kmhutch Ah... the UTC timezone is the problem. Same thing happened to me when I changed to UTC. Let's see what we can do. Standyby. |
Looks like the same error I get running the current master with:
Time info from
Results in:
|
Same as running the current branch of
|
Last week I did look into the times and dates, but it did not have any success. |
@n0bel We might need to install a couple more packages to lookup the timezone from coordinates:
|
@kmhutch Said:
The sunrise/sunset code was added in PiClock because not all the weather APIs provided sunrise/sunset (nor moon) information. Darksky of course did provide that information, so older (several years) PiClocks didn't need to calculate sunrise/sunset. They assumed the timezone was the same as the lat/long of course. The current code is very simplistic in PiClock fails completely when the current timezone does not agree with reasonable sunrise/sunset times (like when sunset is sometime tomorrow instead of today (which can easily happen when you are UTC-6). The DarkSky api simply assumed you wanted a result in the local timezone. With the newer Weather APIs, this will also affect the forecast days/times as well. The forecast would show UTC days and times. I doubt this is the desired result. We'd actually need two time zones within PiCLock. This is essentially what @SerBrynden is proposing, with one being calculated automatically. However the solution doesn't fix the forecast days/times. Currently PiClock uses only the timezone set up in the operating system. There is only one timezone. Since this is a 'clock thing' so to speak I'm thinking what is needed is allow for an optional clock timezone in Config.py. This would only affect the clock (analog clock/digital clock/date at the top). The PiOS would be set to local time, but you could set your clock time to something else. |
@kmhutch Since I can't think of a single use case for an alternate timezone for the clock except for UTC, I implemented a much simpler change. In Config.py I added an optional setting clockUTC
If it is missing or zero it is silently ignored. If it is 1, then the clock (analog/digital/top date) will show in UTC. @kmhutch you'll need to do some things. 1) set your timezone in the operating system to your local timezone. (raspi-config, or gui). 2) update PiClock as normal (git pull). 3) Edit your config to add a line clockUTC = 1 This code is in commit 1ec723c |
Kevin, 73, ANY Chance of moving PiClock to python 3? Python 2.7 is a pain and it is not supported any more. |
@kmhutch Would you rather see everything in UTC, such as the hourly forecast times and sunrise/set times? There has been a Python3/PyQt5 version already under https://github.com/n0bel/PiClock/tree/Python3-SerBrynden but it's not quite up-to-date yet. It works with the newer OWM One Cal API 3.0, but not the legacy API 2.5, and it works with Tomorrow.io. But it will still crash if your system time and location are not in the same timezone. I haven't implemented those timezone changes yet, but I've been working on it. |
@kmhutch update.py does not do a git pull. update.py is for after pulling to update/fix any configuration items that need fixing. You would have wanted to do a git pull. |
@kmhutch The Python3/PyQt5 version is updated at https://github.com/SerBrynden/PiClock. All dates and times will be shown in the system timezone so everthing is referenced to the same time (so when you look at the time on the clock, you can easily compare it to the time in the forecast or sunrise/set). This fork will also work with older and newer OpenWeather accounts, and Tomorrow.io. I also added timestamps to the log files. Many more changes, but that's what I can think of right now. Once I've had it running with no problems for a few days, I'll put in a pull request to update the branch in n0bel's repo. 73, |
I am getting the following error in my pi clock log:
Traceback (most recent call last):
File "PyQtPiClock.py", line 1510, in qtstart
sunset = sun.sunset(dt)
File "PyQtPiClock.py", line 54, in sunset
return suntimes.__timefromdecimalday(self.sunset_t)
File "PyQtPiClock.py", line 67, in __timefromdecimalday
return datetime.time(hour=h, minute=m, second=s)
ValueError: hour must be in 0..23
I did enter my open weather api key and I tested it via my browser.
I tried my config.py, I switched back to example config.py, still fails.
I upgrade the recommend pip mods and it failed the same before and after.
I tried the git reset --hard, reran the update.sh, still fails.
Any ideas?
Kevin
The text was updated successfully, but these errors were encountered: