New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DHT11 doesn't show result on web #370
Comments
Can you verify gpiod is running? execute |
I know its running, because the test works just fine. Here is output: pi@raspberrypi:~/Mycodo/mycodo/tests/manual_tests $ ps aux | grep gpiod |
The test script is much older than the current DHT sensor module in Mycodo, and does not use gpiod. Your What is returned when you execute This is what you should see if gpiod is running:
|
sudo pigpiod, returned nothing, but then when running pi@raspberrypi:~/Mycodo/mycodo/tests/manual_tests $ ps aux | grep gpiod |
Ok now getting this error: 2018-01-04 09:31:46,234 - mycodo.input_4 - ERROR - StopIteration raised. Possibly could not read input. Ensure it's connected properly and detected. |
can you open your cron file and paste the contents? Open it with |
|
Can you download this file: https://github.com/joan2937/pigpio/blob/master/EXAMPLES/Python/DHT11_SENSOR/dht11.py Then edit line 157 so it is your DHT11 data pin, instead of "4", then run it and let me know if it works? |
|
Is that what happened? It threw an exception, but then output temp/humidity data? That's weird. |
correct, that is copy/paste |
Can you run it with python 3 from the Mycodo virtualenv to test if it works with python 3?
|
edit: I changed for formatting. Encase in tripple-backtics (```) to display as monospace and preserve whitespaces |
Let me see if I can get it working with python 3 (what Mycodo now runs with as of v5.5.0). |
Can i downgrade mycodo? or just wait? |
To what version? |
i can wait, not a rush really. eta on update? |
I'll try to get something for you to test in the next hour. |
Kyle i appreciate your dedication and quick responses! |
Are you able and willing to give me SSH access to your Pi to perform tests? It will be much quicker for me to just upload a test script and perform tweaks until I can get it working, than to go back-and-forth here with test scripts. Though, I understand if it's a difficulty or a security risk to let a stranger have access to your Pi. |
I think I got rid of that exception. Change line 143 from: def next(self): to def __next__(self): This is the same code I used in Mycodo, so I'm looking for what can be causing the issue. |
Before we get deep into changing code, try deactivating your sensor, then activate it again, in Mycodo. |
I would allow SSH but my firewall doesn't allow me to open ports. sorry. Ive deactivated and re activated non stop even rebooted, changed GPIO ports, etc.. |
your line 143 change is the same thing.... next(self) what am i changing? |
The line 143 change is for the test script I mentioned, at https://github.com/joan2937/pigpio/blob/master/EXAMPLES/Python/DHT11_SENSOR/dht11.py |
Just to confirm, since we started pigpiod and confirmed it was running, you have deactivated the DHT11 sensor and activated it again, in Mycodo? |
correct |
i see line 143 but it already says next(self) what does it need to change to? |
Change the next() in the test script to include the underscores, as it is here |
Kyle i must be missing something this is what i see in your comment: I think I got rid of that exception. Change "next(self)" on line 143 to "next(self)" I don't see any _ underscores |
Great! Can you paste the output from the daemon log, please? |
I'd also like to get it to return a float value instead of an integer, so would you mind testing one more test module? |
Also, the graph tooltips (mouse hover) should show F in addition to all C measurements. |
|
of course ill help just let me know. |
There should have been more log lines after the sensor activated. No big deal, though. Try this module: dht11.txt |
Pay attention to the timestamp to make sure it's actually updating after you replace the module with the new code and restart the mycodo daemon. |
that was the full log since restart. |
Ah, that makes sense. If there were no log lines displayed, that meant there were no errors. |
New file, got 1 reading then:
|
Try this one, please: dht11.txt |
same error as above, this time it didn't even give me an initial reading thou. |
And just to be sure, you're restarting the daemon, then deactivating, and reactivating the sensor, correct? |
Okay. I'm going back to the original code that worked, because the DHT11 accuracy is +-5% and +-2C, so we don't need float values. Please try this: dht11.txt |
back to working just fine :-) |
can you add this to the request list: Make F (Celceuis) default as a setting for us dumb Americans LOL |
Are you into Crypto Currency? send me your ETH or LTC address, |
What do you mean by make it default? As in change the x-axis of the graphs? Unfortunately, that would be very difficult with how the graph code is designed, as all units are hard coded to be SI. If you hover over the graph, it will show you the converted F temperature. This is the compromise I came up with a long time ago that users who requested F were okay with. It also helps to get comfortable with the metric system ;) Sure, and thanks! I have both: |
very good. |
I just pushed the fix that will be incorporated in the next release. I'll make that release soon. You'll be able to upgrade from the Config -> Upgrade menu once it's live. |
Okay, v5.5.5 is live. Thanks for the bug report. There are a lot of sensors Mycodo supports that may not work after moving from python 2 to python 3 (Mycodo v5.5.0+), so I appreciate people who come forward and are willing to help test fixes for them. |
not sure if this is related...but just noticed that my GPIOD wasn't running after the upgrade? |
Hmm. It's definitely an issue that it's not starting at boot. Try starting it with If it's already running, kill it first with |
actually, that may cause an error. Try rebooting, then starting pigpiod |
can you verify pigpiod is in /usr/local/bin by executing |
pigpiod: /usr/bin/pigpiod /usr/local/bin/pigpiod /usr/man/man1/pigpiod.1 |
ok well after reboot it started up, not sure what caused it to fail earlier. will keep an eye out. FYI sent some ETH |
Okay, I was going to suggest rebooting and seeing if the cron entry starts it. That's good news. Thanks! I haven't seen the transaction show up yet, but they can take a while. I'll look out for it. Let me know if you have any other issues. |
Mycodo Issue Report:
Problem Description
Please list: DHT11 doesn't display anything, deamon log shows error
Errors
code lines you've isolated (please use GitHub permalinks for this)
ERROR: 2018-01-04 09:02:06,949 - mycodo.inputs.dht11_4 - ERROR - Could not initialize sensor. Check if gpiod is running. Error: 'NoneType' object has no attribute 'send'
Additional Notes
Is there anything that should be added to make it easier
to address this issue?
Running the manual test
pi@raspberrypi:~/Mycodo/mycodo/tests/manual_tests $ sudo python test_gpio_DHTx.py -g 3 DHT11
works
pi@raspberrypi:~/Mycodo/mycodo/tests/manual_tests $ sudo python test_gpio_DHTx.py -g 3 DHT11
Temperature: 17.0
Humidity: 48.0
Temperature: 17.0
Humidity: 46.0
Temperature: 17.0
Humidity: 53.0
Temperature: 17.0
Humidity: 53.0
Temperature: 17.0
Humidity: 53.0
Temperature: 17.0
Humidity: 53.0
Temperature: 17.0
Humidity: 53.0
Temperature: 17.0
Humidity: 53.0
Temperature: 17.0
Humidity: 53.0
Temperature: 17.0
Humidity: 53.0
The text was updated successfully, but these errors were encountered: