-
Notifications
You must be signed in to change notification settings - Fork 586
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 not working #748
Comments
Yes, 1-wire currently does not work too well. I believe we will need to fix this first though: #197 and then update DHT code |
Good morning Krzysztof, thank you for your feedback. Cheers |
@tshaug it's currently on our roadmap for the next release but we prioritize based on demand so definitely this issue will bump the priority a bit. 1-wire in general is quite not reliable (it's timing based and we're not working under real-time OS so any thread/context switch at a bad time can destroy the reading process). Having said that there are two ways we can go about improving the current state of DHT11:
The fastest way to get it would probably be to contribute, otherwise we are talking about around 1 year timeline with a I believe in general using kernel driver implementation will not be super hard and I can help with that - all you need to do is to read and parse couple of files from under Alternative and simpler solution might be to change thermometer to anything not 1-wire based (I2C/SPI/analog). You can see supported thermometers here: https://github.com/dotnet/iot/tree/master/src/devices#thermometers |
Good morning Krzysztof thank you for your explanation and the alternatives. Cheers |
@tshaug for humidity sensors see: My personal preference: I'd take something from https://github.com/dotnet/iot/blob/master/src/devices/Bmxx80/README.md family (i.e. BME280) but if you just need humidity it might be better to get something cheaper |
Hi Krzysztof thank you once again for yur advice. Thanks again |
@tshaug cool to hear. Please also make sure to look at #753 and #752 If you are only reading humidity/temperature then it won't affect you - for pressure the first issue mentions that you also need to change the power mode before using it - otherwise you'll get incorrect pressure reading. The issues will likely result in some usability improvements and therefore some APIs will change shortly (there won't be anything drastic but if you happen to upgrade Iot.Device.Bindings package soon you might notice that something works a bit differently). If you just copy & paste the sample code then you don't need to change anything |
@krwq do you want to close this one as a dupe of the other existing issues of DHT? |
Yes, I think there is no new work this issue introduces comparing to other issues although this one describes user facing problem a bit clearer |
Hi everybody, yes can be closed. |
Describe the bug
Hi everybody,
I installed the latest version of system.Device.GIO (v.1.0.0) and Iot.Device.Bindings (1.0.0)
Reading the DHT11 fails using the mentioned assemblies and .NET core 2.2 and 3.0
I used two different breakout boards (have DHT11 each). I have been using them with WIndows IOT so they could be "ok" (regarding the wiring).
I always receive no temp and humidity and IsLastReadSuccessful is always false.
I randomly receive results, like this (5 seconds delay between each measurement):
Guiding Proxy Console 1.2
Temp: NaN
Humi: NaN
ok?: False
Temp: NaN
Humi: NaN
ok?: False
Temp: 23
Humi: 44
ok?: True
Temp: 23
Humi: 44
ok?: True
Temp: 23
Humi: 44
ok?: True
Temp: 23
Humi: 44
ok?: True
Temp: 23
Humi: 44
ok?: True
Temp: NaN
Humi: $NaN
ok?: False
Temp: 23
Humi: 44
ok?: True
Temp: NaN
Humi: NaN
ok?: False
Any ideas?
Thank you very much!
Thomas
Steps to reproduce
Expected behavior
print temp and humidity
Actual behavior
Temp: NaN
Humi: NaN
(same behaviour for .NET Core 2.2 and 3.0)
Versions used
Add following information:
2.2 and 3.0
2.2
.NET Core SDK (reflecting any global.json):
Version: 2.2.102
Commit: 96ff75a873
Runtime Environment:
OS Name: raspbian
OS Version: 9
OS Platform: Linux
RID: linux-arm
Base Path: /home/pi/dotnet/sdk/2.2.102/
.NET Core 3.0
.NET Core SDK (reflecting any global.json):
Version: 3.0.100-rc1-014190
Commit: c4d43f672d
Build machine:
.NET Core SDK (reflecting any global.json):
Version: 3.0.100
Commit: 04339c3a26
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
System.Device.Gpio
package = 1.0.0Iot.Device.Bindings
package = 1.0.0The text was updated successfully, but these errors were encountered: