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

Sensor communication crashes randomly #14

Open
jgrulich opened this issue Oct 22, 2019 · 7 comments
Open

Sensor communication crashes randomly #14

jgrulich opened this issue Oct 22, 2019 · 7 comments

Comments

@jgrulich
Copy link

I'm testing the OLED Demo now. I have ESP core 2.5.2 and CCS811 lib 1.0.2 and the sensor communication fails after some time. The SDA line remains LOW and therefor blocks I2C buss. The OLED therefor stops working too. I've tested both 80MHz and 160MHz CPU freq.
I've tested than basic CCS811_test demo and it fails too. To bring it working again I need to hard reset the CCS811 board.

@jgrulich
Copy link
Author

Based on some info about the I2C stretching, I've tried to use this:
`
Wire.setClock(100000);
Wire.setClockStretchLimit(500);
Wire.begin();
delay(100);

if(!ccs.begin()){

`
But no change. I've tried to use another sensor and ESP boards too.

@ladyada
Copy link
Member

ladyada commented Oct 22, 2019

try on a non-ESP board. ESP has somewhat unusual I2C support

@jgrulich
Copy link
Author

Don't have native Arduino to test. But it's confirmed that it is the lib what is wrong. I've used this one instead and it works now for 12 hours. https://github.com/LucAce/CCS811

@ladyada
Copy link
Member

ladyada commented Oct 23, 2019

thanks, can you see what is different?

@jgrulich
Copy link
Author

Guess that the ccs.available() is wrongly detected, probably from the previous data read and than remains active by mistake. Than it crashes when tried to read new data too soon.
It's not so easy to identify, because the other lib is much more complex and the structure of commands is different. This ccs.available() command is not implemented there and it uses this instead:
while (!ccs.isDATA_READY()) { delay(1000); ccs.readStatusRegister(); }

@wangmings
Copy link

Have the above problems been solved?

@JaySee56
Copy link

Have the same problem with a ProMini, 8MHz, IDE 1.8.13, Adafruit_CCS811.h

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

4 participants