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

NRZ-2019-124-B7: Adafruit Si7021 / HTU21D stopped working after update to this version #513

Closed
zdroyer opened this issue Oct 9, 2019 · 4 comments

Comments

@zdroyer
Copy link

zdroyer commented Oct 9, 2019

After the last beta update on October 1st, 2019, my temp+hum. sensor Si7021 (https://www.adafruit.com/product/3251 , HTU21D compatible), stopped working.

I changed the sensor to a no-name clone and it worked (and still is working).
But I tested the "faulty" sensor with another NodeMCU, and it seems that the 2019-124-B7 firmware is "faulty": when I switched back to the stable firmware (in the config), the Adafruit sensor works properly. I switched the firmware stable<->beta7 several times and the result is always the same: stable - works, beta - doesn't.

It seems the htu21d.begin method of the sensor fails (line 3937).
Here is the serial debug output:

mounting FS...
opened config file...
parsed json...
output debug text to displays...
6
Connecting to ****
..............
WiFi connected
IP address: 192.168.43.46
Setting time using SNTP
Thu Jan  1 08:00:07 1970

..........
NTP time  ... not found
twoStageAutoUpdate
Success downloading: /airrohr/beta/latest_en.bin.md5
NewFW md5: 90b0c22407b1ff707a94fadd7e0206a3
Sketch md5    : 90b0c22407b1ff707a94fadd7e0206a3
No newer version available.
Starting Webserver... 192.168.43.46

ChipId: *******
Read HTU21D...
Check HTU21D wiring
Send to :
luftdaten.info
Madavi.de```

@ricki-z
Copy link
Member

ricki-z commented Oct 10, 2019

Could you please check the latest beta version NRZ-2019-124-B8?
We are using the Adafruit HTP21D library and I have tested the latest beta with an HTU21D. The values are read. Both APIs (Luftdaten and Madavi) show the values.

zdroyer pushed a commit to zdroyer/sensors-software that referenced this issue Oct 10, 2019
…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
@zdroyer
Copy link
Author

zdroyer commented Oct 10, 2019

B8 checked - still not working.
In the meantime I found the solution: #514

@zdroyer
Copy link
Author

zdroyer commented Oct 10, 2019

The Si7021 is compatible with HTU21D in reporting the measured values, but returns 0x3A if asked for read register ( https://github.com/adafruit/Adafruit_Si7021/blob/master/Adafruit_Si7021.cpp vs. https://github.com/adafruit/Adafruit_HTU21DF_Library/blob/master/Adafruit_HTU21DF.cpp)
The stable version of the airrohr firmware simply ignored the result of htu21d.begin(), while B7 remembers it and sets a flag, which prevents from reading the values from the sensor later in the program. In #514 I just added additional check in case Si7021 is installed. Here is the debug output of the patched B8:

NRZ-2019-124-B8.1
mounting FS...
opened config file...
parsed json...
output debug text to displays...
6
Connecting to *****
.......
WiFi connected
IP address: 192.168.0.52
Setting time using SNTP
Thu Jan  1 08:00:03 1970

..........
NTP time  ... not found
Starting Webserver... 192.168.0.52

ChipId: 2491543
Read HTU21D...
Read Si7021 replacement for HTU21D ...
Found Si7120 instead of HTU21D
Send to :
luftdaten.info
Madavi.de
----

BTW.
axTLS is deprecated now. I tried to move to BearSSL - it compiled but crashed on the first attempt to connect to opensensemap.org :-(

dirkmueller added a commit to dirkmueller/sensors-software that referenced this issue Oct 12, 2019
ricki-z added a commit that referenced this issue Oct 13, 2019
Fix for #513 : checking presence of Si7021 in case HTU21D is not dete…
ricki-z added a commit that referenced this issue Oct 13, 2019
ricki-z added a commit that referenced this issue Oct 13, 2019
…_for_HTU21D

Revert "Fix for #513 : checking presence of Si7021 in case HTU21D is not dete…"
@zdroyer
Copy link
Author

zdroyer commented Oct 14, 2019

B9 fixes the problem.
Made a PR for the Adafruit library to fix the problem, as @dirkmueller suggested:
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

No branches or pull requests

2 participants