-
Notifications
You must be signed in to change notification settings - Fork 205
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
Can't get DHT11 Sensor to work #459
Comments
Same here :( |
I had a spare DHT11 so I connected it up, got the same issue, so will have a quick play with it this weekend if I get some time but to chase down a hunch @DeathmannX / @laurensguijt - in your cases, are you running your octoprint server under the I'm guessing it's this:
if you want to give that a shot @laurensguijt - try the dht_simpletest but run with sudo, do you get something like this?
|
hi I have the same problem, the sensor works well with the example in Python, but no data appears in the octoprint interface. it also happens to me with the CPU temperature sensor.I have tried both with sudo activated and without the. 2022-02-12 12:46:20,558 - octoprint.plugins.enclosure - WARNING - ######### current settings version None target settings version 10 ######### |
heya @F3n1x040 (and anyone else watching) Lemme know if this works and I'll do a documentation PR at the very least.. There are two things I had to make sure of.
Toggling sudo would solve the second, but would cause the first issue. If you have the library installed, but you lack access you'll see something like If you need to run with sudo?
If you don't need sudo, or don't want to run with it? (what i'm doing on my box)
gpio or dialout?I did find some links suggesting you need to be part of the dialout group - https://askubuntu.com/a/1313156 but on my RPi it's not dialout, it's gpio. Here's how I double checked:
I don't recall doing that, and that udev config is the same on my other RPi I use for a local DNS proxy. |
hello @tanant, I explain, I have verified that the user who runs octoprint is "pi" and that "pi" has access to GPIO pins. if I run the command "systemctl status octoprint" I get the following:
When looking at the Octoprint log, the following warning and error lines appear: I'm using the plugin without "sudo", but I've tried using it with "sudo" and the log doesn't change I have tried to assign a value to the variable "airquality" in the code of the file "init.py" in the following line:
airquality = 0
But this causes the plugin not to load |
Good spot, I'm not actually sure how it ends up there so we can look at it in a sec once we crush the first error that comes in a lot earlier - i have a suspicion that it's symptomatic rather than the thing we want to fix which is this:
That suggests you're having trouble reading data from the sensor, the rest of the issues sort of cascade from that. To isolate this down, and take enclosure out of the picture, could you do the following?
The 11 is for a DHT11 (22 is for a DHT22). If you supply a bad pin OR the wrong sensor then odds on it'll report If it's the adafruit_dht module, it's the first step i mentioned. (also, if the edits you've made cause the plugin to not load - I'm guessing the python you inserted has mixed spaces and tabs or has an indentation issue? Just a gut feeling.) |
hello @tanant, I have done the test you told me and it has worked correctly. |
Ah, awesome, so does everything now work and you're getting proper readouts in enclosure? If so, was did you end up needing to change from a standard install? |
I don't know what to answer you. I did a standard installation with the octoprint manager plugin, then followed the steps indicated for the DHT11, DHT22 and AM2302 sensors as indicated by the readme.md and in the end I had to modify the file It also happens to me what @plani-de in issue #453, but I get the feeling that this is caused by some kind of conflict with some other script that tries to access the GPIOS or an intermittent failure in sensor communication because when I run the test script https://learn.adafruit.com/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging/python-setup to test the DHT11 sensor this happens: |
Ooooo, hang about, you know what's probably confusing me? #461 was merged about a month ago, and that has the I think somewhere between my notes above, and #461 it should be fixed but while those changes have been merged into master the latest release is 4.13.2 which doesn't have those in them. |
hello, things that happen hehe. the good thing you already know is what has happened. |
For anyone struggling with this, I had to fix two things: First: Even though the dependencies were installed as root and as pi user, I only got it working after disabling sudo mode Second: The
Without the second fix humidity was always reported as 0% Hope that helps someone. |
Hello guys,
After trying pretty much everything I still can't get the sensor temp to display. I have already tried disabling the use SUDO box. The libraries are installed and seem to be working correctly according to the testing script. See attached images underneath:
-Laurens
The text was updated successfully, but these errors were encountered: