Black Lives Matter - Action and Equality.
0

BMP180 OSError: [Errno 121] Remote I/O error
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

BMP180 OSError: [Errno 121] Remote I/O error

by GarXik on Wed May 20, 2020 3:52 pm

Hello,

At the moment I am trying to get readings of pressure from a BMP180 on a Raspberry Pi (OS : Noobs)

So far, I have been successful with connecting the device with the pins and the I2C is detecting the BMP180.

When I check using i2cdetect this is shown:
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

which most likely means that the BMP180 is connected properly and I successfully enabled I2C.

However when I try to run the example code of the Adafruit_Python_BMP on the github page this error is shown:
Code: Select all | TOGGLE FULL SIZE
Traceback (most recent call last):
  File "simpletest.py", line 37, in <module>
    sensor = BMP085.BMP085()
  File "/usr/local/lib/python3.7/dist-packages/Adafruit_BMP-1.5.4-py3.7.egg/Adafruit_BMP/BMP085.py", line 69, in __init__
  File "/usr/local/lib/python3.7/dist-packages/Adafruit_BMP-1.5.4-py3.7.egg/Adafruit_BMP/BMP085.py", line 72, in _load_calibration
  File "/usr/local/lib/python3.7/dist-packages/Adafruit_GPIO-1.0.4-py3.7.egg/Adafruit_GPIO/I2C.py", line 202, in readS16BE
  File "/usr/local/lib/python3.7/dist-packages/Adafruit_GPIO-1.0.4-py3.7.egg/Adafruit_GPIO/I2C.py", line 179, in readS16
  File "/usr/local/lib/python3.7/dist-packages/Adafruit_GPIO-1.0.4-py3.7.egg/Adafruit_GPIO/I2C.py", line 166, in readU16
  File "/usr/local/lib/python3.7/dist-packages/Adafruit_PureIO-1.1.5-py3.7.egg/Adafruit_PureIO/smbus.py", line 224, in read_word_data
OSError: [Errno 121] Remote I/O error


Is there something I am missing or a solution to this problem please?
Any help is appreciated.

GarXik
 
Posts: 3
Joined: Wed May 20, 2020 3:39 pm

Re: BMP180 OSError: [Errno 121] Remote I/O error

by mikeysklar on Wed May 20, 2020 4:04 pm

Hello GarXik,

Your subject and description sounds like you are using the BMP180 sensor. However, the code errors you are sharing are trying to access the BMP085. I believe all of our CircuitPython and Python examples are currently based on the BMP280 which should be backwards compatible with the 085/180 models as well. Can you try the setup/examples from this page (bmp280_simpletest.py).

https://learn.adafruit.com/adafruit-bmp ... ython-test

Code: Select all | TOGGLE FULL SIZE
import time

import board

# import digitalio # For use with SPI
import busio

import adafruit_bmp280

# Create library object using our Bus I2C port
i2c = busio.I2C(board.SCL, board.SDA)
bmp280 = adafruit_bmp280.Adafruit_BMP280_I2C(i2c)

# OR create library object using our Bus SPI port
# spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
# bmp_cs = digitalio.DigitalInOut(board.D10)
# bmp280 = adafruit_bmp280.Adafruit_BMP280_SPI(spi, bmp_cs)

# change this to match the location's pressure (hPa) at sea level
bmp280.sea_level_pressure = 1013.25

while True:
    print("\nTemperature: %0.1f C" % bmp280.temperature)
    print("Pressure: %0.1f hPa" % bmp280.pressure)
    print("Altitude = %0.2f meters" % bmp280.altitude)
    time.sleep(2)

mikeysklar
 
Posts: 1068
Joined: Mon Aug 01, 2016 8:10 pm

Re: BMP180 OSError: [Errno 121] Remote I/O error

by GarXik on Wed May 20, 2020 4:12 pm

Hmm I thought the BMP180 would still work using the resources given for BMP085 found here: https://learn.adafruit.com/using-the-bm ... on-library


So for me to work using the BMP 280 I have to install CircuitPython and Adafruit_Blinka?

Thank you.

GarXik
 
Posts: 3
Joined: Wed May 20, 2020 3:39 pm

Re: BMP180 OSError: [Errno 121] Remote I/O error

by GarXik on Wed May 20, 2020 4:36 pm

Hello I have just tried running the code given at the end here : https://learn.adafruit.com/adafruit-bmp ... ython-test (The one using i2c)

Please note that I installed Ada_Blinka and ran the Blinka test and it worked fine.

When running the code the following errors were yielded :
Code: Select all | TOGGLE FULL SIZE
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/adafruit_bus_device/i2c_device.py", line 184, in __probe_for_device
    self.i2c.writeto(self.device_address, b"")
  File "/home/pi/.local/lib/python3.7/site-packages/busio.py", line 101, in writeto
    return self._i2c.writeto(address, buffer, stop=stop)
  File "/home/pi/.local/lib/python3.7/site-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 46, in writeto
    self._i2c_bus.write_bytes(address, buffer[start:end])
  File "/usr/local/lib/python3.7/dist-packages/Adafruit_PureIO-1.1.5-py3.7.egg/Adafruit_PureIO/smbus.py", line 308, in write_bytes
OSError: [Errno 121] Remote I/O error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/adafruit_bus_device/i2c_device.py", line 190, in __probe_for_device
    self.i2c.readfrom_into(self.device_address, result)
  File "/home/pi/.local/lib/python3.7/site-packages/busio.py", line 89, in readfrom_into
    return self._i2c.readfrom_into(address, buffer, stop=stop)
  File "/home/pi/.local/lib/python3.7/site-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 53, in readfrom_into
    readin = self._i2c_bus.read_bytes(address, end - start)
  File "/usr/local/lib/python3.7/dist-packages/Adafruit_PureIO-1.1.5-py3.7.egg/Adafruit_PureIO/smbus.py", line 179, in read_bytes
OSError: [Errno 121] Remote I/O error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/mu_code/BMPTestAda.py", line 5, in <module>
    sensor = adafruit_bmp280.Adafruit_BMP280_I2C(i2c)
  File "/usr/local/lib/python3.7/dist-packages/adafruit_bmp280.py", line 406, in __init__
    self._i2c = i2c_device.I2CDevice(i2c, address)
  File "/usr/local/lib/python3.7/dist-packages/adafruit_bus_device/i2c_device.py", line 69, in __init__
    self.__probe_for_device()
  File "/usr/local/lib/python3.7/dist-packages/adafruit_bus_device/i2c_device.py", line 192, in __probe_for_device
    raise ValueError("No I2C device at address: %x" % self.device_address)
ValueError: No I2C device at address: 77

GarXik
 
Posts: 3
Joined: Wed May 20, 2020 3:39 pm

Re: BMP180 OSError: [Errno 121] Remote I/O error

by mikeysklar on Thu May 21, 2020 3:57 pm

The last error in the excerpt you provided looks like your BMP180 sensor was not being seen on the i2c bus at 0x77. Had something changed with your setup where the sensor was not plugged in and powered up?

Can you post a photo of your wiring?

mikeysklar
 
Posts: 1068
Joined: Mon Aug 01, 2016 8:10 pm

Please be positive and constructive with your questions and comments.