0

DHT does not work with root user using Raspberry Zero WH
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

DHT does not work with root user using Raspberry Zero WH

by javanxd on Wed Sep 15, 2021 2:58 pm

Hello,

me and others are facing the following problem, that the most recent Adafruit DHT Library (the other libs are "deprecated") does not work with root user on Raspberry Pi Zero W.

I described all the other details in the GitHub issue: https://github.com/adafruit/Adafruit_CircuitPython_DHT/issues/73 Because this did not receive any reply after 1 months I am creating this topic on the Adafruit forum. It would be great if someone from the Adafruit DHT Library team can work on this issue. Hopefully this receives some attention from an official or an DHT Library developer.

I noticed that I am not the only one affected by this issue:

javanxd
 
Posts: 2
Joined: Wed Sep 15, 2021 2:50 pm

Re: DHT does not work with root user using Raspberry Zero WH

by adafruit_support_mike on Sun Sep 19, 2021 2:56 pm

The library is deprecated because the DHT sensors don't really use I2C, and the RasPi's microprocessor I2C interface doesn't support the kind of timing control necessary to make things work properly.

If the DHT sensors were high quality or had some feature that was hard to reproduce, it might be worth creating and maintaining a kernel module to make it work, but they aren't. They're middle-of-the-road sensors that whose features can be reproduced by other devices of similar price that are more compatible with the RasPi.

We see no advantage in spending time and effort encouraging people to use a sensor in a context where its performance is mediocre at best and buggy in general.

That said, all of our code is Open Source. Anyone who wants to improve it is free to do so, and in the OSS environment the correct answer to "why doesn't someone do X?" is "why don't you?"

adafruit_support_mike
 
Posts: 63725
Joined: Thu Feb 11, 2010 2:51 pm

Re: DHT does not work with root user using Raspberry Zero WH

by javanxd on Sun Sep 19, 2021 4:28 pm

adafruit_support_mike wrote:in the OSS environment the correct answer to "why doesn't someone do X?" is "why don't you?"


I spent many hours debugging it, researching for this issue (referenced other issues) until I figured out that the problem only occurs if I run it as "root" user. If I would have the knowledge I would have already fixed it because I am maintaining other OSS projects which are dependent on this Adadruit DHT library.

The library I am referring to is not deprecated: https://github.com/adafruit/Adafruit_CircuitPython_DHT
The other library (https://github.com/adafruit/Adafruit_Python_DHT ) is deprecated, now suggesting to use the lib from above.

javanxd
 
Posts: 2
Joined: Wed Sep 15, 2021 2:50 pm

Please be positive and constructive with your questions and comments.