n0bel / PiClock

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

PiClock stopped working, JSON parsing issue #214

Closed vanosg closed 3 years ago

vanosg commented 3 years ago

Hi, visited a friend whom I gave a PiClock to, and the data stopped displaying "a while ago". Looking at the logs, I see this:

(this hasn't been updated since '19, so the line numbers may not exactly match the current codebase)

getting current and forecast:Tue Mar 30 17:48:20 2021
<url>
wxstart for radar1
wxstart for radar2
wxstr is: 
Traceback (most recent call last):
  File "PyQtPiClock.py", line 256, in wxfinished
    wxdata = json.loads(wxstr)
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

I added the 'wxstr is:' debug line, it looks like it is blank. But, if I visit the URL it displays in the log manually, the JSON code is there.

Any thoughts? Thanks so much for all the hard work you've invested, it shows!

vanosg commented 3 years ago

Figured it out; DNS broke on the system and it couldn't resolve hostnames.