-
-
Notifications
You must be signed in to change notification settings - Fork 315
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
Fix for #513 : checking presence of Si7021 in case HTU21D is not dete… #514
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,7 +105,7 @@ | |
* | ||
************************************************************************/ | ||
// increment on change | ||
#define SOFTWARE_VERSION_STR "NRZ-2019-124-B8" | ||
#define SOFTWARE_VERSION_STR "NRZ-2019-124-B9" | ||
const String SOFTWARE_VERSION(SOFTWARE_VERSION_STR); | ||
|
||
/***************************************************************** | ||
|
@@ -128,6 +128,7 @@ const String SOFTWARE_VERSION(SOFTWARE_VERSION_STR); | |
|
||
#if defined(ESP8266) | ||
#include <FS.h> // must be first | ||
#include <WiFiClientSecureAxTLS.h> | ||
#include <ESP8266WiFi.h> | ||
#include <ESP8266WebServer.h> | ||
#include <ESP8266mDNS.h> | ||
|
@@ -3935,8 +3936,17 @@ static void powerOnTestSensors() { | |
if (cfg::htu21d_read) { | ||
debug_outln_info(F("Read HTU21D...")); | ||
if (!htu21d.begin()) { | ||
debug_outln_error(F("Check HTU21D wiring")); | ||
htu21d_init_failed = true; | ||
debug_outln_info(F("Read Si7021 replacement for HTU21D ...")); | ||
Wire.beginTransmission(HTU21DF_I2CADDR); | ||
Wire.write(HTU21DF_READREG); | ||
Wire.endTransmission(); | ||
Wire.requestFrom(HTU21DF_I2CADDR, 1); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so this seems to be a ugly workaround for wouldn't it be better to submit this as a PR to that library? then this code needs no modification and more users of that library also the ability to benefit from your bug fix. |
||
if( Wire.read() == 0x3A){ | ||
debug_outln_error(F("Found Si7120 instead of HTU21D")); | ||
} else { | ||
debug_outln_error(F("Check HTU21D wiring")); | ||
htu21d_init_failed = true; | ||
} | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another way to workaround this for now is