zefanja / aqi

Measure AQI based on PM2.5 or PM10 with a Raspberry Pi and a SDS011 particle sensor
GNU General Public License v3.0
94 stars 46 forks source link

Script fails after 15 measures #18

Closed pphase closed 10 months ago

pphase commented 10 months ago

After latest update of my RPI Zero W when the scripts runs I get error:

Traceback (most recent call last):
  File "./aqi.py", line 127, in <module>
    data = json.load(json_data)
  File "/usr/lib/python2.7/json/__init__.py", line 291, in load
    **kw)
  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 am not specialist but I assume that this is something about encoding but don't know how to resolve this.

pphase commented 10 months ago

Resolved by executing this script with sudo via crontab.