I have copied the https://learn.adafruit.com/adafruit-sgp ... iring-test for the CircuitPython and Python Usage section. When running the code on a RPI, I receive the below error. I have tested using the headers and using the QT connection. Any advice or other test methods I can try, or is this product defective?
Traceback (most recent call last):
File "/home/scorp/git/SGP30/main.py", line 14, in <module>
sgp30 = adafruit_sgp30.Adafruit_SGP30(i2c)
File "/usr/local/lib/python3.9/dist-packages/adafruit_sgp30.py", line 91, in __init__
self._device = I2CDevice(i2c, address)
File "/home/scorp/.local/lib/python3.9/site-packages/adafruit_bus_device/i2c_device.py", line 63, in __init__
self.__probe_for_device()
File "/home/scorp/.local/lib/python3.9/site-packages/adafruit_bus_device/i2c_device.py", line 185, in __probe_for_device
raise ValueError("No I2C device at address: 0x%x" % self.device_address)
ValueError: No I2C device at address: 0x58
After working with it for a few more hours, I am able to get it to work with a RPI. I'm still unable to get the SGP30 to work with the trinket 5V. Is there any advice on how to change the I2C speed on the original trinkets to the "fast-mode"? Is this likely an issue? I have verified I can talk to another I2C device (7 segment backpack). Please let me know any information I can post that will be useful.
After working with the circuit a bit more, I am still unsuccessful. I have been able to get things working with the RPI using the 3.3V power instead of the 5V from the trinket. Is anyone familiar with how to correct wire up the 5V circuit and the signal lines? Or topics I can research to get this complete?
Yes, I've tried that setup and code, but the I2C device is never detected. I'm using the built in led to flash at a constant rate if the .begin() succeeds.
adafruit2 wrote: ↑Sun Jun 11, 2023 4:28 pm
the trinket 5v absolutely does not have enough RAM to talk to a sensor - you gotta update to something like the QT Py RP2040 or QT Py SAMD21!
I assumed there wouldn't be enough space on this trinket to do much with the sensors, but I have about 6 of these old trinkets to find projects for. I'm using this buildout to learn more about I2C and daisy chaining the devices. I'm going to look into the QT Py RP2040 or the SAMD21 for a more useful project :).
I did see the note about the 5V and 3V boards. I wasn't able to get the same code to work on my RPI when using the 5V GPIO pin there. I had success when connecting the SGP30 to the 3.3V supply from the pi. I assume that means something is wrong with my wire setup, and very likely need to educate myself on these types of circuits.