Skip to content
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

err 100 #25

Closed
Beguineur opened this issue Aug 24, 2018 · 7 comments
Closed

err 100 #25

Beguineur opened this issue Aug 24, 2018 · 7 comments

Comments

@Beguineur
Copy link

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
Copy link
Owner

It means:

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

I should refine the error code, combining the t.

@Beguineur
Copy link
Author

Beguineur commented Aug 25, 2018 via email

@winlinvip
Copy link
Owner

@Beguineur Please test 1.0.12

@facorazza
Copy link

@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
Copy link
Owner

@marcdraco
Copy link

@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 winlinvip reopened this Jan 5, 2021
@winlinvip
Copy link
Owner

winlinvip commented Jan 5, 2021

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

// 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;
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants