I need some help. I was working on my weather station build and had everything working and moved everything from bread board to the final build. My BME280 suddenly gave me this error message:
Code: Select all
Traceback (most recent call last):
File "/home/pi/weather/WebSensor/test_bme280.py", line 9, in <module>
bme280.load_calibration_params(bus,address)
File "/usr/local/lib/python3.5/dist-packages/bme280/__init__.py", line 153, in load_calibration_params
compensation_params.dig_T1 = read.unsigned_short(0x88)
File "/usr/local/lib/python3.5/dist-packages/bme280/reader.py", line 40, in unsigned_short
return self._bus.read_word_data(self._address, register) & 0xffff
File "/usr/local/lib/python3.5/dist-packages/smbus2/smbus2.py", line 453, in read_word_data
ioctl(self.fd, I2C_SMBUS, msg)
OSError: [Errno 121] Remote I/O errorCode: Select all
import bme280
import smbus2
from time import sleep
port = 1
address = 0x77 # Adafruit BME280 address. Other BME280s may be different
bus = smbus2.SMBus(port)
bme280.load_calibration_params(bus,address)
while True:
bme280_data = bme280.sample(bus,address)
humidity = bme280_data.humidity
pressure = bme280_data.pressure
ambient_temperature = bme280_data.temperature
print(humidity, pressure, ambient_temperature)
sleep(1)
At first I thought i was the soldering and I replaced the sensor with another BME280. Same issue, same with a third BME280 although that one worked for a brief day.
So I ordered new BME280s and same result. Then I installed a brand new "rasbian stretch" and same result, I thought maybe its the PI and used the new install SD-card in a new PI with a new sensor - same result. So now I am perplexed. That would make it now 4 sensors dead including the one I just took out of the package.
BTW - the cmd of i2cdetect shows the following:
Code: Select all
pi@raspberrypi:~ $ 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: -- -- -- -- -- -- -- --