Now, it does work, but often it fails to get reading from the sensor.
I've tried to take a look at the log files in /home/pi/DHT22-TemperatureLogger/Debugger/Logs/ , and everytime it fails there's this error:
Does anyone know what could cause it? I've scheduled a reading every 5 minutes with crontab and it seems to fail randomly. I've tried to change the voltage to 5.5v and the cable is very short, so the connection shouldn't be the issue (I haven't tried a different GPIO pin yet, though).
Code: Select all
21-05-18 11:10:02 INFO Sensors.SensorReader Start reading values for sensor type 22 in gpio 27 21-05-18 11:10:42 ERROR Sensors.SensorReader Failed to get readings for sensor: Inside Traceback (most recent call last): File "/home/pi/DHT22-TemperatureLogger/Sensors/SensorReader.py", line 58, in getSensorReadings temperature,humidity = self._getSensorReadings(sensorType,gpio) File "/home/pi/DHT22-TemperatureLogger/Sensors/SensorReader.py", line 133, in _getSensorReadings sensorReadings = subprocess.check_output(['sudo',self.adafruitPathConfig,sensorType,gpio]) File "/usr/lib/python2.7/subprocess.py", line 219, in check_output raise CalledProcessError(retcode, cmd, output=output) CalledProcessError: Command '['sudo', u'/home/pi/Adafruit_Python_DHT/examples/AdafruitDHT.py', u'22', u'27']' returned non-zero exit status 1 21-05-18 11:10:42 INFO Sensors.SensorReader Sensor readings collected 21-05-18 11:10:42 INFO Sensors.SensorDataHandler Successfully read: 0 sensors. Failed to read: 1 sensor(s) 21-05-18 11:10:42 ERROR Sensors.SensorDataHandler Failed to get readings from any of the sensors. Execution terminated