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.

Problem with CCS811: Device returned a error

by Napsty on Fri Dec 13, 2019 9:50 am

Hello,

I bought a CCS811 a while ago and it worked for a couple of weeks.
It is wired to a Raspberry Pi 3b+ and i2c rate was adjusted (followed the how to on https://learn.adafruit.com/adafruit-ccs ... r/overview).

Since a couple of weeks ago I noticed problems with longevity of the sensor. Meaning: The sensor works fine for a couple of minutes (sometimes a few hours), then suddenly returns an error. Using the adafruit-circuitpython-ccs811 python module (version 1.1.4):

Code: Select all | TOGGLE FULL SIZE
  File "/usr/local/lib/python3.5/dist-packages/adafruit_ccs811.py", line 115, in __init__
    raise RuntimeError("Device returned a error! Try removing and reapplying power to "
RuntimeError: Device returned a error! Try removing and reapplying power to the device and running the code again.


The sensor is successfully detected on the i2c bus:

Code: Select all | TOGGLE FULL SIZE
$ sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- 5a -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --                         


Only physically detaching the Raspberry Pi from the power source and then restarting helps. But then again, after a few minutes or hours the same problem appears.

Any ideas, hints, solutions?

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

Re: Problem with CCS811: Device returned a error

by Napsty on Sat Dec 14, 2019 10:37 am

Update: I upgraded to the latest CircuitPython packages using pip3 but the same error (Device returned a error! ...) is shown.
Currently installed pip3 packages:

Code: Select all | TOGGLE FULL SIZE
Adafruit-Blinka (3.2.0)
adafruit-circuitpython-busdevice (4.0.1)
adafruit-circuitpython-ccs811 (1.1.6)
adafruit-circuitpython-register (1.7.1)
Adafruit-PlatformDetect (1.3.8)
Adafruit-PureIO (1.0.4)
cryptography (1.7.1)
idna (2.2)
keyring (10.1)
keyrings.alt (1.3)
pip (9.0.1)
pyasn1 (0.1.9)
pycrypto (2.6.1)
pygobject (3.22.0)
python-apt (1.1.0b5)
pyxdg (0.25)
rpi-ws281x (4.2.2)
RPi.GPIO (0.7.0)
SecretStorage (2.3.1)
setuptools (33.1.1)
six (1.10.0)
spidev (3.4)
sysv-ipc (1.0.1)
wheel (0.29.0)

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

Re: Problem with CCS811: Device returned a error

by adafruit_support_carter on Mon Dec 16, 2019 7:39 pm

It may be connection related. Can you post a photo showing our setup and how everything is connected.

Does the same issue show up if you run the example from the library?
https://github.com/adafruit/Adafruit_Ci ... pletest.py

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

Re: Problem with CCS811: Device returned a error

by Napsty on Sat Dec 21, 2019 12:06 pm

Yes, the same error happens with the example python script.
However I see constant connection on i2cdetect (5a).
I read about problems with ccs811 (not only on Adafruit forums) and maybe this sensor is not a reliable as others. I ordered a BME voc sensor now but still would prefer that the ccs811 sensor would work as it did in the first few weeks.

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 Jan 08, 2020 7:19 pm

Checking back in on this. Did the BME behave better? Can you post a photo of the CCS811 setup?

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

Re: Problem with CCS811: Device returned a error

by Napsty on Wed Jan 08, 2020 7:24 pm

Did not have the time yet to test the BME sensor.

You can find the ccs811 setup here:
https://www.claudiokuenzler.com/graph/n ... _small.jpg

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 Jan 08, 2020 8:05 pm

Can you post another photo of the solder job on the header pins:
solder.jpg
solder.jpg (25.55 KiB) Viewed 283 times


Is this assembly subject to any kind of vibration that might cause connection issues with the wires? (since the breakout is free hanging)

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

Re: Problem with CCS811: Device returned a error

by Napsty on Thu Jan 09, 2020 2:34 pm

Currently not at the location of this setup so the solder picture will have to wait. No, there are no vibrations occurring. The same happens if I fix the sensor by the way. As you can see from above post, the connection i2c can be seen on 5a, so this works. Interestingly after a power off/power on (disconnect/reconnect poe) the first sensor request works and I get a response from it including tvoc and co2 values. All further requests fail.

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 Jan 14, 2020 3:39 pm

Not sure. It might be related to the clock stretching issue, but you've slowed the bus down and it was originally working. Could also have something to do with environment it's being used in, since it sounds like it was working for a period of time before having issues.

You don't currently have access to this hardware?

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

Re: Problem with CCS811: Device returned a error

by Napsty on Tue Jan 14, 2020 5:54 pm

Correct, currently in another country. However I can access the Raspberry Pi from here if that helps.

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 Jan 14, 2020 6:16 pm

I think what you've done so far is about as far as you can go without access to the hardware.

Do you have a second set of hardware you could use to try and recreate the issue?

Wonder if connecting to the reset line to be able to programmatically control that might help?

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

Re: Problem with CCS811: Device returned a error

by Napsty on Fri Jan 31, 2020 7:42 am

I have now fixed the sensor on the side so it is not hanging and dangling on the dupont cables anymore. However the effect is still the same: After a reboot the sensor shows data once, but then the mentioned error shows up again.

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

Re: Problem with CCS811: Device returned a error

by adafruit_support_carter on Fri Jan 31, 2020 2:42 pm

We can replace it. Since it originally worked and then stopped working, it may have something to do with your setup. Verify that the replacement works as expected upon arrival.

Send an email to support@adafruit.com with a link to this thread and your order number and they can send you a replacement CCS811.

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

Re: Problem with CCS811: Device returned a error

by Napsty on Sat Feb 01, 2020 9:38 am

OK will do, thanks for your help!

I will also try with the new BME680 sensor, too. Maybe this sensor has a better longevity.

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

Re: Problem with CCS811: Device returned a error

by Napsty on Tue Mar 31, 2020 6:30 am

Hi Carter

Meanwhile I got the CCS811 replacement, soldered it, connected to the Raspi GPIO connectors and... same error.
I can constantly see the 5a connection in i2cdetect:

Code: Select all | TOGGLE FULL SIZE
$ sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- 5a -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --


I updated the Raspbian version (apt-get update) and also updated the pip3 packages.
I got the current version from the git repo Adafruit_CCS811_python and adjusted the print function for python3, but same error:

Code: Select all | TOGGLE FULL SIZE
$ python3 Adafruit_CCS811_python/examples/CCS811_example.py
Traceback (most recent call last):
  File "Adafruit_CCS811_python/examples/CCS811_example.py", line 6, in <module>
    ccs =  Adafruit_CCS811()
  File "/usr/local/lib/python3.5/dist-packages/Adafruit_CCS811/Adafruit_CCS811.py", line 92, in __init__
    raise Exception("Device returned an Error! Try removing and reapplying power to the device and running the code again.")
Exception: Device returned an Error! Try removing and reapplying power to the device and running the code again.


Even just the simplest code brings that error up:

Code: Select all | TOGGLE FULL SIZE
pi@raspberrypi:~ $ python3
Python 3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import busio
>>> import adafruit_ccs811
>>> from board import *
>>> i2c_bus = busio.I2C(SCL, SDA)
>>> ccs =  adafruit_ccs811.CCS811(i2c_bus)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/adafruit_ccs811.py", line 120, in __init__
    "Device returned a error! Try removing and reapplying power to "
RuntimeError: Device returned a error! Try removing and reapplying power to the device and running the code again.
>>>

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

Please be positive and constructive with your questions and comments.