Page 1 of 1

sgp30 not found [resolved]

Posted: Sun Aug 21, 2022 9:31 am
by iceelon
hello again ...
trying to put an sgp30 into operation for measurement...

Code: Select all

Traceback (most recent call last):
  File "<stdin>", line 22, in <module>
  File "/lib/spg301.py", line 70, in __init__
RuntimeError: SGP30 Not detected
I think it's on this line

Code: Select all

 featureset = self._i2c_read_words_from_cmd([0x20, 0x2f], 0.01, 1)
        if featureset[0] != _SGP30_FEATURESET:
            raise RuntimeError('SGP30 Not detected')
        self.iaq_init()

Re: sgp30 not found

Posted: Sun Aug 21, 2022 7:16 pm
by scruss
what's your wiring?
does I2C.scan() see the device?

Re: sgp30 not found

Posted: Mon Aug 22, 2022 8:33 am
by iceelon
hello
If everything is correct, it is well connected, it detects the device... but nothing continues to give an error in that part... I downloaded the documentation of the sensor to see if I can see where to go...

Re: sgp30 not found

Posted: Mon Aug 22, 2022 1:21 pm
by karfas
iceelon wrote:
Mon Aug 22, 2022 8:33 am
If everything is correct, it is well connected, it detects the device
This makes no sense at all for me. "If everything is correct, it works" - yes, we all assume that. :shock:
But DOES it work ? Do you get the correct address from i2c.scan() ?
iceelon wrote:
Mon Aug 22, 2022 8:33 am
... but nothing continues to give an error in that part
When "nothing" gives you an error, there is no error at all ;)

Serious: What do you get back in featureset[0] ? Maybe you got a slightly different SGP30 sensor.
What do you expect to get back (according to the datasheet) ?

Re: sgp30 not found

Posted: Tue Aug 23, 2022 8:51 am
by iceelon
hello

The library expects a value of 0x20 exactly but sensor returns 0x22 which would indicate “better” featureset than what’s required.



it works now....