n0bel / PiClock

A Fancy Clock built around a monitor and a Raspberry Pi
MIT License
566 stars 182 forks source link

error. no sunrise and sunset data. #202

Closed xenon462 closed 3 years ago

xenon462 commented 3 years ago

Error: Traceback (most recent call last): File "PyQtPiClock.py", line 1361, in qtstart sunrise = sun.sunrise(dt) File "PyQtPiClock.py", line 46, in sunrise self.calc() File "PyQtPiClock.py", line 123, in calc math.tan(math.radians(declination))))) ValueError: math domain error

The polar night is now beyond the Arctic circle. ClimaCell does not provide sunrise and sunset data.

my coordinates: 68.97033228006596, 33.07604959033541

n0bel commented 3 years ago

Corrected on commit dd0948439553fdb595ddf6cfdb7dec3d8c4ef319

n0bel commented 3 years ago

about 24 hours ago I changed the sunrise/sunset computation to be internal to PiClock. That's where the error was coming from. I've since corrected it. Pull and update and you should be fine.

xenon462 commented 3 years ago

updated: cd PiClock git pull python update.py

error appears after update:

Traceback (most recent call last): File "PyQtPiClock.py", line 1361, in qtstart sunrise = sun.sunrise(dt) File "PyQtPiClock.py", line 46, in sunrise self.calc() File "PyQtPiClock.py", line 123, in calc math.tan(math.radians(declination))))) ValueError: math domain error

in previous versions, you fixed a similar bug. https://github.com/n0bel/PiClock/issues/118

n0bel commented 3 years ago

The error is exactly the same as before. I don't believe the 'git pull' worked, because the line numbers should have changed. Can you verify that line 127 is as follows:

if hourangle0 > 1.0:
xenon462 commented 3 years ago

after updating 'git pull' everything worked correctly. the question can be closed.