Does anyone know if the software can read and use the data from a DHT11 sensor? I have some of these from another project:
https://www.amazon.com/gp/product/B01DKC2GQ0/ref=ppx_yo_dt_b_asin_title_o02_s01?ie=UTF8&psc=1
When I plug it into the pi and setup the hardware in hydrosys for temp and humidity I don't get any readings.
Just wondering if anyone used one of these with success or if you have any tips.
That'd require a bit of work to get working with both sensors I think. Probably would need a way to specify the sensor type in the web interface.
Wow thank you!! go in the file.
So new question. Can you use DTH11 and DTH22 at the same time? I want to see the different data on the 2.
Ok, so looks like the file is in the normal location. "nano /home/pi/env/autonom/HWcontrol.py" should let you edit the file.
Once you're in nano push ctrl w to search, put in Adafruit_DHT.DHT22 and push enter. Change the line sensor = Adafruit_DHT.DHT22 to sensor = Adafruit_DHT.DHT11. Then push ctrl to quit and save the changes.
What is this?
this is what i got so far. Thanks for help
pi@hydrosys4-172:~ $ /home/pi/env/autonom/HWcontrol.py
from: can't read /var/mail/__future__
from: can't read /var/mail/__future__
from: can't read /var/mail/builtins
from: can't read /var/mail/builtins
from: can't read /var/mail/builtins
from: can't read /var/mail/past.utils
/home/pi/env/autonom/HWcontrol.py: line 11: import: command not found
/home/pi/env/autonom/HWcontrol.py: line 12: import: command not found
/home/pi/env/autonom/HWcontrol.py: line 13: import: command not found
from: can't read /var/mail/math
/home/pi/env/autonom/HWcontrol.py: line 18: import: command not found
/home/pi/env/autonom/HWcontrol.py: line 19: import: command not found
/home/pi/env/autonom/HWcontrol.py: line 22: syntax error near unexpected token ` ('
/home/pi/env/autonom/HWcontrol.py: line 22: `logger = logging.getLogger("hydrosy s4."+__name__)'
No but maybe it's in a different location? Try "sudo find / -name HWcontrol.py" and see if that points you in the right direction?
i cant seem to fidn these files. Did you have to install something extra?
Well a reboot seemed to get it going, must've had something cached somewhere (I'd already tried deleting all .pyc files). The DHT11 is working fine with that change.
In case anybody else runs across this in ~/env/autonom/HWcontrol.py change the line sensor = Adafruit_DHT.DHT22 to sensor = Adafruit_DHT.DHT11 and reboot if it doesn't work right away.
Hi, you are working on the right file. Seems strange that after modification you cannot see effect in the output. As you can see the code has a check on the output in case this is out of range to avoid false reading. Also the procedure includes a buffer with stored readings used in case the reading requests are too fast for the sensor to follow. This is one of the oldest part of the code there :) it might show its age. Let me know.
Hi, I'm working on setting this up for my garden, looks very promising. I have a few DHT11 sensors sitting around and am having troulbe getting it working with hydrosys since their output is different from the DHT22 apparently.
With the DHT11 connected I get the incorrect values from Adafruit_DHT when specifying it as a DHT22.
pi@hydrosys4-172:~/Adafruit_Python_DHT/examples $ python AdafruitDHT.py 11 24 Temp=23.0* Humidity=50.0% pi@hydrosys4-172:~/Adafruit_Python_DHT/examples $ python AdafruitDHT.py 22 24 Temp=589.6* Humidity=1254.4%
I tried modifying HWcontrol.py line 292 to sensor = Adafruit_DHT.DHT11 and tried modifying the error log message to add any values received but nothing I do in that file seems to have an effect. Can you help point me in the right direction to get it going?
Just in case here's the error log when I try to test the sensor from the web interface
23:26:55 hydrosys4.HWcontrol - ERROR Failed to get DHT22 reading, values in wrong range 23:26:56 hydrosys4.HWcontrol - ERROR Failed to get DHT22 reading
Thank you!
Hi Daniel,
As I understood, the DHT11 and DHT22 should have the same interface, but unfortunately I only tested the SW with the DHT22 so I cannot confirm if this is going to work.
Note that there was a problem with previous version of Hydrosys SW relevant to the reading of the DHT sensor, make sure you are using the last version.