Bme680


#1

When I try to run the read-all.py in the examples folder for the BME680 I get “OSError [Errno 121] Remote I/O error” with some traceback stuff.

Any idea why?

I’m using the Adafruit BME680 if that matters


#2

How’s it wired to your Pi, and what do you see if you run: sudo i2cdetect -y 1


#3

This is my first effort with I2C, so forgive me if a simple “77” would have done. I get

Blockquote 0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- – -- – -- – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – 77


#4

As for the wiring, I have:
3VDC --> 3Vo
GND --> GND
SCL --> SCK
SDA --> SDI

Like so:


#5

Our board uses the i2c addres 0x76 and Adafruit’s uses 0x77.

You need to change: sensor = bme680.BME680()

To: sensor = bme680.BME680(i2c_addr=0x77)


#6

Thank you, that worked like a charm!


#7

Where does the data log to? I ran read-all.py and I let it punch out values for about 8 hours while I was busy with other things. Where are all of those values at now, or does it log at all?

Edit: Now that I’m reading through the Getting Started With the BME680 guide more closely, I see that I can redirect the output to a .csv by using

python read-all.py > bme680-data.txt

Does that mean that all of those values that I collected for 8 hours are lost?


#8

Yes, those values are lost unfortunately.

The python read-all.py > bme680-data.txt is not a very robust way of logging, since the read-all.py script will be buffering internally you’ll log any errors generated by the Python script, and the script will not be recovered if it does fail somehow.

Ideally Python should create and handle its own log file, but for the sake of simplicity you should probably just import sys in read-all.py and after print()ing out the data, call sys.stdout.flush()