X-Git-Url: https://zdv2.bktei.com/gitweb/EVA-2020-02-2.git/blobdiff_plain/ec0759414b8c76c42fe99e1ac9fcd2146899d545..e8fa1c067e150a5ef58ea053fc49e5afa46e81cd:/examples/luftdaten.py?ds=inline diff --git a/examples/luftdaten.py b/examples/luftdaten.py index b7f0565..c5b0387 100755 --- a/examples/luftdaten.py +++ b/examples/luftdaten.py @@ -62,7 +62,7 @@ def read_values(): values["P2"] = str(pm_values.pm_ug_per_m3(2.5)) values["P1"] = str(pm_values.pm_ug_per_m3(10)) except ReadTimeoutError: - pms5003 = PMS5003() + pms5003.reset() pm_values = pms5003.read() values["P2"] = str(pm_values.pm_ug_per_m3(2.5)) values["P1"] = str(pm_values.pm_ug_per_m3(10)) @@ -71,7 +71,7 @@ def read_values(): # Get CPU temperature to use for compensation def get_cpu_temperature(): - process = Popen(['vcgencmd', 'measure_temp'], stdout=PIPE) + process = Popen(['vcgencmd', 'measure_temp'], stdout=PIPE, universal_newlines=True) output, _error = process.communicate() return float(output[output.index('=') + 1:output.rindex("'")])