sgp30 not found [resolved]

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
Post Reply
iceelon
Posts: 30
Joined: Tue Jul 12, 2022 11:42 am

sgp30 not found [resolved]

Post by iceelon » Sun Aug 21, 2022 9:31 am

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()
Last edited by iceelon on Tue Aug 23, 2022 9:54 am, edited 1 time in total.

User avatar
scruss
Posts: 360
Joined: Sat Aug 12, 2017 2:27 pm
Location: Toronto, Canada
Contact:

Re: sgp30 not found

Post by scruss » Sun Aug 21, 2022 7:16 pm

what's your wiring?
does I2C.scan() see the device?

iceelon
Posts: 30
Joined: Tue Jul 12, 2022 11:42 am

Re: sgp30 not found

Post by iceelon » Mon Aug 22, 2022 8:33 am

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...

User avatar
karfas
Posts: 193
Joined: Sat Jan 16, 2021 12:53 pm
Location: Vienna, Austria

Re: sgp30 not found

Post by karfas » Mon Aug 22, 2022 1:21 pm

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) ?
A few hours of debugging might save you from minutes of reading the documentation! :D
My repositories: https://github.com/karfas

iceelon
Posts: 30
Joined: Tue Jul 12, 2022 11:42 am

Re: sgp30 not found

Post by iceelon » Tue Aug 23, 2022 8:51 am

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....

Post Reply