Closed stickbreaker closed 6 years ago
thanks did you check this on an ESP32?
I just went through the code looking at the error detection, ReSTART usage. This code only uses ReSTART once, in the uint16_t Adafruit_Si7021::_readRegister16(uint8_t reg)()
function, it does not do any error detection, so the issue is mute.
I don't have one of these sensors, so I cannot test the code. I just corrected the visible errors. I do not know if the code should use ReSTART (Wire.endTransmission(false)
) to correctly utilize the hardware, but I do know that Wire.endTransmission()
will never return I2C_ERROR_CONTINUE
as a success code.
Chuck.
thanks did you check this on an ESP32?
I tested it on an NodeMCU 32S and it works now.
Just one more thing. I noticed that the latest version you can download from the library manager in the Arduino IDE is just 1.0.1. So at first I was a little confused why the github version has so many more lines of code.
thanks @7h30n3 ! we'll bump and do a release
Hi layada, i use the latest @file Adafruit_Si7021.h v1.1 but i there is no communication between my esp32 and the original Adafruit SI7021 Modul.
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) ets Jun 8 2016 00:22:57
rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:1 load:0x3fff0018,len:4 load:0x3fff001c,len:1100 load:0x40078000,len:10088 load:0x40080400,len:6380 entry 0x400806a4 Contact Si7021 test! [V][esp32-hal-i2c.c:1483] i2cInit(): num=0 sda=21 scl=22 freq=0 [V][esp32-hal-i2c.c:1677] i2cSetFrequency(): freq=100000Hz [V][esp32-hal-i2c.c:1692] i2cSetFrequency(): cpu Freq=240Mhz, i2c Freq=100000Hz [V][esp32-hal-i2c.c:1698] i2cSetFrequency(): Fifo delta=1 Did not find Si7021 sensor!
How can i fix this issue?
BR
@quito96, try using the latest release (November, 2018) from GitHub. Include the .h and .cpp files.
Hi Chuck, i use the latest release from git hub .
sorry, the problem was a defective esp32….
I2C
ReSTART
operations on ESP32 are queued and not executed until an i2c transaction with aSTOP
is processed. To indicate this queuing,Wire.endTransmission(false);
orWire.requestFrom(id,size,false);
returnsI2C_ERROR_CONTINUE
. The prior revision of this library addedReSTART
error checking, BUT, did not useReSTART
operations. So the error detection code was falsely detecting success as an error.