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

Fix for #513 : checking presence of Si7021 in case HTU21D is not dete… #514

Merged
merged 2 commits into from
Oct 13, 2019

Conversation

zdroyer
Copy link

@zdroyer zdroyer commented Oct 10, 2019

…cted. Added include for axTLS.

Si7021 is compatible with HTU21D, but it returns 0x3A instead of 0x2 on I2C command 0xE7, thats why the .begin() function failed

…HTU21D is not detected. Added include for axTLS.

Si7021 is compatible with HTU21D, but it returns 0x3A instead of 0x2 on I2C command 0xE7, thats why the .begin() function failed
Copy link
Member

@ricki-z ricki-z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove the axTLS header file. This include is done by WifiSecureClient if axTLS::WiFiClientSecure is used.
We will change to BearSSL in the next version. At the moment the resulting binary would be too large for OTA.
Numbering: please use B9 for next version and update the VERSION.md file

@zdroyer
Copy link
Author

zdroyer commented Oct 10, 2019

Well, I tried to compile the firmware without the axTLS header, but in the latest library 2.5.2 the (https://github.com/esp8266/Arduino/blob/2.5.2/libraries/ESP8266WiFi/src/WiFiClientSecure.h) the #include "WiFiClientSecureAxTLS.h" is commented out because of defaulting to BearSSL.

Regarding the version string, mea culpa, correcting it now.

@dirkmueller
Copy link
Collaborator

@zdroyer yes, the current build needs to be built against arduino core 2.4.2. the pr for 2.5.2 compatibility is #506

Wire.beginTransmission(HTU21DF_I2CADDR);
Wire.write(HTU21DF_READREG);
Wire.endTransmission();
Wire.requestFrom(HTU21DF_I2CADDR, 1);
Copy link
Collaborator

@dirkmueller dirkmueller Oct 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this seems to be a ugly workaround for
https://github.com/adafruit/Adafruit_HTU21DF_Library/blob/master/Adafruit_HTU21DF.cpp#L49

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.

Copy link
Collaborator

@dirkmueller dirkmueller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see inline comment..

@@ -3935,8 +3936,17 @@ static void powerOnTestSensors() {
if (cfg::htu21d_read) {
debug_outln_info(F("Read HTU21D..."));
if (!htu21d.begin()) {
Copy link
Collaborator

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

if(!... && htu21d.readHumidity() < 1.0f)

@dirkmueller dirkmueller mentioned this pull request Oct 12, 2019
@dirkmueller
Copy link
Collaborator

@zdroyer I sent an alternative PR which should address this regression you found as well. Please let me know if there are any issues with that.

@zdroyer
Copy link
Author

zdroyer commented Oct 14, 2019

@zdroyer I sent an alternative PR which should address this regression you found as well. Please let me know if there are any issues with that.
Hey Dirk
Pretty clever trick - works for me! Thanks.
I'll make a PR to the Adafruit lib and I hope the lib will be updated and your extended sensor init condition will not be needed anymore.

@zdroyer
Copy link
Author

zdroyer commented Oct 14, 2019

@zdroyer I sent an alternative PR which should address this regression you found as well. Please let me know if there are any issues with that.

The PR is waiting for Adafruit acceptance: adafruit/Adafruit_HTU21DF_Library#16

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

Successfully merging this pull request may close these issues.

3 participants