Skip to content

Commit

Permalink
Merge pull request #514 from zdroyer/fix_Si7021_for_HTU21D
Browse files Browse the repository at this point in the history
Fix for #513 : checking presence of Si7021 in case HTU21D is not dete…
  • Loading branch information
ricki-z authored Oct 13, 2019
2 parents 520606d + 503a526 commit e2348f1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
3 changes: 3 additions & 0 deletions airrohr-firmware/Versions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
NRZ-2019-124-B9
* Fix for #513 : checking if Si7021 is present in case HTU21D is not detected

NRZ-2019-124-B8
* bug fixes
* translation updates
Expand Down
16 changes: 13 additions & 3 deletions airrohr-firmware/airrohr-firmware.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/*****************************************************************
Expand All @@ -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>
Expand Down Expand Up @@ -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);
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;
}
}
}

Expand Down

0 comments on commit e2348f1

Please sign in to comment.