I am having a similar problem to this only I am using the DHT Sensor. I have updated the firmware to the newest version.
When I run the example script, the temperature and humidity values are polled but eventually I get the same IOError.
Here’s my test.py code :
from grovepi import *
This outputs an IOError after 20-30 seconds.
I have a second script which takes the DHT Values [temperature, humidity] and adds them to into a mysql database.
Traceback (most recent call last):
File "temperature_port2.py", line 49, in <module>
cur.execute("INSERT INTO sensor_data(sensorid, value) VALUES('2', %s)", (tem perature))
File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execu te
self.errorhandler(self, exc, value)
File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in de faulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.OperationalError: (1054, "Unknown column 'nan' in 'field list' ")
I’ll upload a video from a Putty terminal that shows the error in real time. The script works 100% until it encounters the IOError / [nan,nan] problem.
Any help would be much appreciated.
My DHT is connected to D2.