winlinvip / SimpleDHT

Simple, Stable and Fast Arduino Temp & Humidity Sensors for DHT11 and DHT22. http://learn.adafruit.com/dht
MIT License
144 stars 61 forks source link

err 100 #25

Closed Beguineur closed 3 years ago

Beguineur commented 6 years ago

I tried with arduino DTH11 rev 1.0.10 and got the following error

Sample DHT11... Read DHT11 failed, err=100

I don't know what err 100 means

winlinvip commented 6 years ago

It means:

// Error to wait for start low signal.
#define SimpleDHTErrStartLow 100

I should refine the error code, combining the t.

Beguineur commented 6 years ago

Thank you having improve !

I am not a specialist and I still don't understand I tried rev 1.0.11 the result is as follows :

Sample DHT11... Read DHT11 failed, err=4112

Sample DHT11... Read DHT11 failed, err=3088

Sample DHT11... Read DHT11 failed, err=4112

Sample DHT11... Read DHT11 failed, err=3088

it still doesn't work .... can you help ? Philippe

Le sam. 25 août 2018 à 04:09, winlin notifications@github.com a écrit :

It means:

// Error to wait for start low signal.

define SimpleDHTErrStartLow 100

I should refine the error code, combining the t.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/winlinvip/SimpleDHT/issues/25#issuecomment-415924216, or mute the thread https://github.com/notifications/unsubscribe-auth/Aosoy68q53hYF-8OaB5km6ALZkw42dkNks5uULHjgaJpZM4WLld1 .

-- Cordialement Philippe Tiberghien

winlinvip commented 5 years ago

@Beguineur Please test 1.0.12

facorazza commented 5 years ago

@winlinvip Could we open this one up again? I have the same issue and would like to know what err=4112 and err=3088 mean?

winlinvip commented 4 years ago

@Imperator26 https://github.com/winlinvip/SimpleDHT/blob/master/SimpleDHT.h#L30

marcdraco commented 3 years ago

@winlinvip

I busted a DHT22 (no idea how ... but there you go) and I've seen both the 3088 and the 4112 errors.

Reading the code, xx12 makes sense but xx88? I can't see any of your defines where that's set. I'm curious as although the sensors unquestionably misbehaving, it does give some sort of reading (it's just off by a few degrees).

I use a switch... case ladder to help me with the issue (failing to pull start low) but I'll be darned if I get it to 3088 again - but even if I did, you don't define that! Any thoughts? I'm not really good enough to debug someone else's code.

winlinvip commented 3 years ago

新增了宏定义获取错误时间和错误码:

// Get the time duration from error.
#define SimpleDHTErrDuration(err) ((err&0xff00)>>8)
// Get the error code defined bellow.
#define SimpleDHTErrCode(err) (err&0x00ff)

使用参考Example:

  if ((err = dht11.read(&temperature, &humidity, NULL)) != SimpleDHTErrSuccess) {
    Serial.print("Read DHT11 failed, err="); Serial.print(SimpleDHTErrCode(err));
    Serial.print(","); Serial.println(SimpleDHTErrDuration(err)); delay(1000);
    return;
  }