I’ve been working on putting together an indoor air quality sensor array using the Enviro+, PMS5003, Pimoroni SGP30, and roscoe81’s really well featured “enviro-monitor” code.
After quite a few missteps I feel like I’m very close to making this all work, but I’m stymied by what I believe to be an issue with the SGP30.
The Relevant Code (I think)
eco2_tvoc_baseline = [] # Initialise tvoc_co2_baseline format: get - [eco2 value, tvoc value, time set] set
# - [tvoc value, eco2 value]
valid_eco2_tvoc_baseline = False
from sgp30 import SGP30
import sys
def crude_progress_bar():
sys.stdout.write('.')
sys.stdout.flush()
# Create an SGP30 instance
sgp30 = SGP30()
display_startup("Northcliff\nEnviro Monitor\nSensor Warmup\nPlease Wait")
print("SGP30 Sensor warming up, please wait...")
sgp30.start_measurement(crude_progress_bar)
sys.stdout.write('\n')
The Python Error Message
Traceback (most recent call last):
File "/home/pi/enviro-monitor/Northcliff_AQI_Monitor_Gen.py", line 1741, in <module>
sgp30.start_measurement(crude_progress_bar)
File "/home/pi/.local/lib/python3.7/site-packages/sgp30/__init__.py", line 140, in start_measurement
self.command('init_air_quality')
File "/home/pi/.local/lib/python3.7/site-packages/sgp30/__init__.py", line 76, in command
self._i2c_dev.i2c_rdwr(msg_w)
File "/home/pi/.local/lib/python3.7/site-packages/smbus2/smbus2.py", line 658, in i2c_rdwr
ioctl(self.fd, I2C_RDWR, ioctl_data)
OSError: [Errno 121] Remote I/O error
I’ve done some reading on the “Remote I/O error” and I’m trying to understand how to apply some of that information here, but I’m a bit baffled at the moment. Perhaps a clue here, but when I measure voltage before I run the code it measures 2.9V, but after running it drops to .74V. This seems odd to me.
Here’s a picture of the wiring, but I can take any specific shots you might think would be more helpful.
Photo
Ultimately I’m out of my depth here, but I think with some helpful suggestions I can get things working. I’ve got such a cool (IMO) enclosure designed up for this that I look forward to sharing, but I can’t until this works.
Addendum: I am using the pimoroni-SGP30 python drivers.