Pimoroni BME680: OSError: [Errno 121] Remote I/O error

Hi

I have some problem with Pimoroni BME680.
I verified chatting on Discord my soldering and plugging in position are ok.

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

python read-all.py
Traceback (most recent call last):
File “read-all.py”, line 6, in
sensor = bme680.BME680()
File “build/bdist.linux-armv6l/egg/bme680/init.py”, line 37, in init
File “build/bdist.linux-armv6l/egg/bme680/init.py”, line 141, in set_filter
File “build/bdist.linux-armv6l/egg/bme680/init.py”, line 281, in _set_bits
File “build/bdist.linux-armv6l/egg/bme680/init.py”, line 296, in _get_regs
IOError: [Errno 121] Remote I/O error
pi@relayPi:~/bme680/examples $ python3 read-all.py
Traceback (most recent call last):
File “read-all.py”, line 6, in
sensor = bme680.BME680()
File “/usr/local/lib/python3.4/dist-packages/bme680/init.py”, line 40, in init
self.get_sensor_data()
File “/usr/local/lib/python3.4/dist-packages/bme680/init.py”, line 241, in get_sensor_data
self.set_power_mode(FORCED_MODE)
File “/usr/local/lib/python3.4/dist-packages/bme680/init.py”, line 225, in set_power_mode
self._set_bits(CONF_T_P_MODE_ADDR, MODE_MSK, MODE_POS, value)
File “/usr/local/lib/python3.4/dist-packages/bme680/init.py”, line 281, in _set_bits
temp = self._get_regs(register, 1)
File “/usr/local/lib/python3.4/dist-packages/bme680/init.py”, line 296, in _get_regs
return self._i2c.read_byte_data(self.i2c_addr, register)
OSError: [Errno 121] Remote I/O error

Only once I got this output, then always I/O error
python3 read-all.py
Calibration data:
par_gh1: -13
par_gh2: -19929
par_gh3: 18
par_h1: 638
par_h2: 1036
par_h3: 0
par_h4: 45
par_h5: 20
par_h6: 120
par_h7: -100
par_p1: 36271
par_p10: 30
par_p2: -10474
par_p3: 88
par_p4: 3899
par_p5: -79
par_p6: 30
par_p7: 31
par_p8: -1321
par_p9: -3139
par_t1: 26327
par_t2: 26442
par_t3: 3
range_sw_err: 1
res_heat_range: 1
res_heat_val: 45

Initial reading:
gas_index: None
gas_resistance: None
heat_stable: False
humidity: None
meas_index: None
pressure: None
status: None
temperature: None
Traceback (most recent call last):
File “read-all.py”, line 37, in
sensor.set_gas_heater_temperature(320)
File “/usr/local/lib/python3.4/dist-packages/bme680/init.py”, line 196, in set_gas_heater_temperature
temp = int(self._calc_heater_resistance(self.gas_settings.heatr_temp))
File “/usr/local/lib/python3.4/dist-packages/bme680/init.py”, line 376, in _calc_heater_resistance
var1 = ((self.ambient_temperature * self.calibration_data.par_gh3) / 1000) * 256
TypeError: unsupported operand type(s) for *: ‘NoneType’ and ‘int’

Could you please help?

Do you have an alternate i2c baudrate set in /boot/config.txt something like dtparam=i2c_baudrate=XXX?

getting the same kind of error on my rPi3+

Calibration data:
par_gh1: -21
par_gh2: -14972
par_gh3: 18
par_h1: 652
par_h2: 1033
par_h3: 0
par_h4: 45
par_h5: 20
par_h6: 120
par_h7: -100
par_p1: 36444
par_p10: 30
par_p2: -10442
par_p3: 88
par_p4: 4718
par_p5: -119
par_p6: 30
par_p7: 41
par_p8: -2544
par_p9: -2638
par_t1: 26167
par_t2: 26652
par_t3: 3
range_sw_err: 0
res_heat_range: 1
res_heat_val: 40

Initial reading:
gas_index: None
gas_resistance: None
heat_stable: False
humidity: None
meas_index: None
pressure: None
status: None
temperature: None
Traceback (most recent call last):
File “/home/pi/scripts/read-all.py”, line 37, in
sensor.set_gas_heater_temperature(320)
File “/usr/local/lib/python2.7/dist-packages/bme680/init.py”, line 196, in set_gas_heater_temperature
temp = int(self._calc_heater_resistance(self.gas_settings.heatr_temp))
File “/usr/local/lib/python2.7/dist-packages/bme680/init.py”, line 376, in _calc_heater_resistance
var1 = ((self.ambient_temperature * self.calibration_data.par_gh3) / 1000) * 256
TypeError: unsupported operand type(s) for *: ‘NoneType’ and ‘int’

Could you try running:

python -c "from bme680 import __version__;print(__version__)"

Or in a Python repl running:

import bme680
print(bme680.__version__)

In both your cases I can’t see a t_fine entry in your calibration data which points to the _calc_temperature method failing or not being called, but no error has occured at that point.

python -c “from bme680 import version;print(version)”
1.0.5

No I have no i2c baudrate entry in /boot/config.txt.
The sensor works perfectly in a Raspberry 3, it does not in a Raspberry Zero with Raspbian GNU/Linux 9.4 (Stretch).

How’s it connected to the Raspberry Pi Zero- how’s the Pi Zero header itself connected?

I reinstalled last Raspbian lite distro and rerun the full install script. The Breakout is connected as described in the website, to pins 1, 3, 5, 7, 9. I did not actually connect pin 7, but it should not harm, right?
Now I get this error, both with python3 and python
IOError: [Errno 121] Remote I/O error

See anything with sudo i2cdetect -y 1?

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

Sorry just saw that’s in your first post- facepalm I’m not exactly firing on all cylinders!

Hmm- that’s the default i2c address for the BME680. What on earth is going on- I wonder.

Are you moving the same SD card between both Pi’s when testing?

Do you have any other i2c devices to verify there’s not something wrong with the Pi Zero? Sorry if I retreat the same ground!

You say you don’t have pin 7 hooked up. Are you connecting it to the Pi via jumper wires? Is there a header soldered onto the BME680?

I have a luminosity sensor (tsl2561) to test. I could try and let you know

I soldered the header but nevertheless I’m using jumper wires, I have other jumpers on the second row and the header does not fit well. I have another breakout working on a Raspberry 3, maybe I should try if the problematic one works on the Raspi3 to understand where the problem is (whether the breakout or the Raspberry Zero)

Phil @gadgetoid , didn’t we see a similar problem in another thread where jumper wires were used?
@alex.tower make sure the jumpers are all the same length, and away from anything that might cause electrical interference. Maybe even swap them out just in case one of them is a dud or something?

@alphanumeric yes, jumper wires can be a bit hit and miss! Due to anything from just poor quality connections/worn out cables, to coupling in noise or causing crosstalk between the data/clock lines.

@alex.tower it sounds voodoo but if your jumper cables are still connected in a single ribbon you might want to separate them out into individual strands.

I use the female to female jumpers all the time to connect sensor breakout boards to a Proto Hat or Proto Zero. Male header < jumper > male header. Mine are all separated. I’m fussy about what color wire I use for what function, and the ones I want to use are never all side by side ,lol.
One thing I do do, when its going to become a permanent setup. Is remove the single shells from the ends and plug them all into a multi pin shell. So its all just the one plug with the wires in the correct order.

Sorry, but I use jumper wires on my Raspberry 3 and another BME680 breakout without no issues, I do not think the problem is caused by those.