tomhartley/AirPi

Error on raspbian buster

laimerIT opened this issue · 3 comments

Hello,

i made a fresh install with RaspberryPi B+ and my AirPi PCB 1.4 and get the following error. On Debian Jessie it runs great.
All configs checkt, no sensor problem

DEBUG:main: ERROR: Failed to obtain data from these sensors: DHT22-hum, DHT22-temp
ERROR: Failed to obtain data from these sensors: DHT22-hum, DHT22-temp
DEBUG:main: Dataset to output to <outputs.print.Print object at 0xb62eeaf0>:
DEBUG:main: [{'description': 'A combined temperature and humidity sensor.', 'symbol': '%', 'value': None, 'breach': False, 'readingtype': 'sample', 'sensor': 'DHT22-hum', 'unit': '% Relative Humidity', 'name': 'Relative_Humidity'}, {'description': 'A combined temperature and humidity sensor.', 'symbol': 'C', 'value': None, 'breach': False, 'readingtype': 'sample', 'sensor': 'DHT22-temp', 'unit': 'Celsius', 'name': 'Temperature-DHT'}]
Time : 2021-02-06 14:10:00
DEBUG:main: ERROR: Exception during output: Unknown format code 'f' for object of type 'str'
DEBUG:main: ERROR: Failed to obtain data from these sensors: DHT22-hum, DHT22-temp
ERROR: Failed to obtain data from these sensors: DHT22-hum, DHT22-temp
DEBUG:main: Dataset to output to <outputs.print.Print object at 0xb62eeaf0>:
DEBUG:main: [{'description': 'A combined temperature and humidity sensor.', 'symbol': '%', 'value': None, 'breach': False, 'readingtype': 'sample', 'sensor': 'DHT22-hum', 'unit': '% Relative Humidity', 'name': 'Relative_Humidity'}, {'description': 'A combined temperature and humidity sensor.', 'symbol': 'C', 'value': None, 'breach': False, 'readingtype': 'sample', 'sensor': 'DHT22-temp', 'unit': 'Celsius', 'name': 'Temperature-DHT'}]
Time : 2021-02-06 14:10:20
DEBUG:main: ERROR: Exception during output: Unknown format code 'f' for object of type 'str'

It is the third sensor i have tested, sumtimes its ok

Time : 2021-02-06 14:45:01
DEBUG:main: ERROR: Exception during output: Unknown format code 'f' for object of type 'str'
INFO:main: Success: Data successfully obtained from all sensors.
DEBUG:main: Dataset to output to <outputs.print.Print object at 0xb62eeaf0>:
DEBUG:main: [{'description': 'A combined temperature and humidity sensor.', 'symbol': '%', 'value': 45.400001525878906, 'breach': False, 'readingtype': 'sample', 'sensor': 'DHT22-hum', 'unit': '% Relative Humidity', 'name': 'Relative_Humidity'}, {'description': 'A combined temperature and humidity sensor.', 'symbol': 'C', 'value': 22.700000762939453, 'breach': False, 'readingtype': 'sample', 'sensor': 'DHT22-temp', 'unit': 'Celsius', 'name': 'Temperature-DHT'}]
Time : 2021-02-06 14:45:21
Relative Humidity : 45.40 % (sample)
Temperature-DHT : 22.70 C (sample)

INFO:main: Success: Data output in all requested formats.
INFO:main: Success: Data successfully obtained from all sensors.
DEBUG:main: Dataset to output to <outputs.print.Print object at 0xb62eeaf0>:
DEBUG:main: [{'description': 'A combined temperature and humidity sensor.', 'symbol': '%', 'value': 45.400001525878906, 'breach': False, 'readingtype': 'sample', 'sensor': 'DHT22-hum', 'unit': '% Relative Humidity', 'name': 'Relative_Humidity'}, {'description': 'A combined temperature and humidity sensor.', 'symbol': 'C', 'value': 22.700000762939453, 'breach': False, 'readingtype': 'sample', 'sensor': 'DHT22-temp', 'unit': 'Celsius', 'name': 'Temperature-DHT'}]
Time : 2021-02-06 14:45:41

Greetings from Bavaria

When the sensor read cannot get a value it returns 'None'. Hence the formatting error.
Have you updated the Adafruit-DHT python library? Last version is 1.4.0 from 2018.
Adafruit has frozen the Adafriuit_DHT python library, since now they use circuit-python for all their platforms.

i think it uses the "import dhtreader" dhtreader.so
Can i change to circuit-python ?

sampling is running over night, an now the values printed out. Last days wenn i stop an start, value could not read from the sensor.
I changed the sensor 3 times, i run the nest days an write the output.