Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Problem with CCS811: Device returned a error
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: Problem with CCS811: Device returned a error

by Napsty on Tue Mar 31, 2020 7:52 am

FYI I just connected the BME 680 sensor and I can read data. So it's either a problem in both (???) CCS811 sensors or some compatibility issue with either Raspberry Pi 3b+ or an updated python library.

Napsty
 
Posts: 15
Joined: Fri Dec 13, 2019 9:41 am

Re: Problem with CCS811: Device returned a error

by adafruit_support_carter on Tue Mar 31, 2020 12:33 pm

What value are you using for the I2C buadrate?
https://learn.adafruit.com/circuitpytho ... stretching

adafruit_support_carter
 
Posts: 17112
Joined: Tue Nov 29, 2016 2:45 pm

Re: Problem with CCS811: Device returned a error

by Napsty on Tue Mar 31, 2020 1:55 pm

adafruit_support_carter wrote:What value are you using for the I2C buadrate?
https://learn.adafruit.com/circuitpytho ... stretching


It's on 10K:

Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi:~ $ cat /boot/config.txt | grep dtparam
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=spi=on
dtparam=audio=on
dtparam=i2c_arm_baudrate=10000
dtparam=i2c_baudrate=10000

Napsty
 
Posts: 15
Joined: Fri Dec 13, 2019 9:41 am

Re: Problem with CCS811: Device returned a error

by adafruit_support_carter on Tue Mar 31, 2020 3:12 pm

Hmmm. That worked here testing with a Pi 3B+ and 10k clock on the I2C bus.

Code: Select all | TOGGLE FULL SIZE
pi@pi3:~ $ python3
Python 3.7.3 (default, Dec 20 2019, 18:57:59)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import board
>>> import adafruit_ccs811
>>> ccs = adafruit_ccs811.CCS811(board.I2C())
>>> ccs.temperature
28.23476832466565
>>>


I have:
Code: Select all | TOGGLE FULL SIZE
dtparam=i2c_arm=on
dtparam=i2c_arm_baudrate=10000

in config.txt.

Maybe try removing that second baud rate set line. Do you have anyway to scope the I2C signals?

[EDIT] I should also mention that I was able to recreate the error you are getting using the default baudrate. It only worked once I forced 10k.

adafruit_support_carter
 
Posts: 17112
Joined: Tue Nov 29, 2016 2:45 pm

Re: Problem with CCS811: Device returned a error

by Napsty on Wed Apr 01, 2020 1:22 am

First of fall thank you for your continued support here. It feels you want to get to the bottom of this problem as much as I do and I really appreciate that!
As a matter of fact, I added the second baudrate line just yesterday when I ran through the guide again. https://learn.adafruit.com/adafruit-ccs ... iring-test mentions:
Code: Select all | TOGGLE FULL SIZE
dtparam=i2c_baudrate=10000

But https://learn.adafruit.com/circuitpytho ... stretching mentions:

Code: Select all | TOGGLE FULL SIZE
dtparam=i2c_arm_baudrate=10000

But I agree, it could have something to do that the Raspi is ignoring this setting and does not do the clock stretching (anymore). As I mentioned at the begin of this topic, the sensor used to work for a couple of weeks at least.

Is there something like a I2C reset I could do on the Raspi?

I will now try to set the config.txt like you have and maybe even set a lower baud rate (as its mentioned in https://learn.adafruit.com/circuitpytho ... stretching).

Napsty
 
Posts: 15
Joined: Fri Dec 13, 2019 9:41 am

Re: Problem with CCS811: Device returned a error

by adafruit_support_carter on Wed Apr 01, 2020 11:41 am

Good point about it initially working. Maybe something has happened to make it become less reliable. Your usage doesn't look abnormal and the length of time in use was fairly short. What we'd probably do is try a replacement and see what happens. If that one dies again after use in a similar way, then it would indicate something with your application.

Unfortunately, we can't ship replacements right now due to state mandated lock down. Do you need a solution to this near term, or can you wait until we reopen for normal operations?

adafruit_support_carter
 
Posts: 17112
Joined: Tue Nov 29, 2016 2:45 pm

Re: Problem with CCS811: Device returned a error

by Napsty on Wed Apr 01, 2020 12:10 pm

But this is already the replacement. ;)

Napsty
 
Posts: 15
Joined: Fri Dec 13, 2019 9:41 am

Re: Problem with CCS811: Device returned a error

by adafruit_support_carter on Wed Apr 01, 2020 12:26 pm

Ha! Indeed.

Hmmm. So....not sure. Are you still testing things with your project setup? Similar to the photo posted?

adafruit_support_carter
 
Posts: 17112
Joined: Tue Nov 29, 2016 2:45 pm

Re: Problem with CCS811: Device returned a error

by Napsty on Wed Apr 01, 2020 12:45 pm

Yes it's the same setup.
Sake behavior on the original and the replacement CCS811 sensor.

Right now I disconnected the CCS811 and connected a BME860 sensor, which is running perfectly for over 24h.
If I read correctly, the BME860 sensor does not need a lower clock stretching, which would point into the direction of a problem with i2c clock speed?

Napsty
 
Posts: 15
Joined: Fri Dec 13, 2019 9:41 am

Re: Problem with CCS811: Device returned a error

by adafruit_support_carter on Thu Apr 02, 2020 12:40 pm

Clock stretching is a feature of the I2C protocol. The Raspberry Pi is known to have a bug in handling clock stretching. So, in order to use sensors that clock stretch, the kluge is to slow the clock speed down. The idea is that the clock pulse length becomes roughly the same as any clock stretch length the sensor would do, and so just get passively dealt with.

The BME sensor probably does not clock stretch and thus is fine with higher clock speeds.

adafruit_support_carter
 
Posts: 17112
Joined: Tue Nov 29, 2016 2:45 pm

Re: Problem with CCS811: Device returned a error

by TDRider03 on Wed Aug 26, 2020 11:26 pm

I seem to be having similar troubles with the CCS811... I've tried 2 different boards (new, from Mouser) , same result - device won't respond to the read ID command ... in fact, won't ack the address (0x5a). Tried scanning all addresses (note attached is deceiving, it really is 7 bit address of 0x5a). scope traces from connections to board .. 3.3 Vdc solid ... pretty much out of ideas
Attachments
Capture.PNG
Capture.PNG (37.71 KiB) Viewed 85 times

TDRider03
 
Posts: 1
Joined: Wed Aug 26, 2020 11:17 pm

Re: Problem with CCS811: Device returned a error

by adafruit_support_carter on Thu Aug 27, 2020 12:01 pm

@TDRider03 Please start a new thread for your issue.

Since this thread was last visited, there is now a new options which may help with the clock stretching issue. Software I2C on the Pi via the i2c-gpio overlay is now available. See discussion here:
https://github.com/adafruit/Adafruit_Bl ... -622096854
The support is via this new library:
https://github.com/adafruit/Adafruit_Py ... tended_Bus

adafruit_support_carter
 
Posts: 17112
Joined: Tue Nov 29, 2016 2:45 pm

Re: Problem with CCS811: Device returned a error

by Napsty on Fri Aug 28, 2020 1:47 am

Thanks for that info @adafruit_support_carter! Will try that when I find the time.

Napsty
 
Posts: 15
Joined: Fri Dec 13, 2019 9:41 am

Please be positive and constructive with your questions and comments.