Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raspberry Pi OSError: [Errno 121] Remote I/O error #4

Closed
thEpisode opened this issue Jan 25, 2019 · 14 comments
Closed

Raspberry Pi OSError: [Errno 121] Remote I/O error #4

thEpisode opened this issue Jan 25, 2019 · 14 comments

Comments

@thEpisode
Copy link

thEpisode commented Jan 25, 2019

Hi guys, I followed this tutorial https://learn.adafruit.com/adafruit-veml6075-uva-uvb-uv-index-sensor/python-circuitpython but when I'm trying to use the code I got the following error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/adafruit_bus_device/i2c_device.py", line 68, in __init__
    i2c.writeto(device_address, b'')
  File "/usr/local/lib/python3.5/dist-packages/busio.py", line 65, in writeto
    return self._i2c.writeto(address, buffer, stop=stop)
  File "/usr/local/lib/python3.5/dist-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 38, in writeto
    self._i2c_bus.write_bytes(address, buffer[start:end])
  File "/usr/local/lib/python3.5/dist-packages/Adafruit_PureIO/smbus.py", line 244, in write_bytes
    self._device.write(buf)
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.5/dist-packages/adafruit_bus_device/i2c_device.py", line 74, in __init__
    i2c.readfrom_into(device_address, result)
  File "/usr/local/lib/python3.5/dist-packages/busio.py", line 55, in readfrom_into
    return self._i2c.readfrom_into(address, buffer, stop=stop)
  File "/usr/local/lib/python3.5/dist-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 44, in readfrom_into
    readin = self._i2c_bus.read_bytes(address, end-start)
  File "/usr/local/lib/python3.5/dist-packages/Adafruit_PureIO/smbus.py", line 155, in read_bytes
    return self._device.read(number)
OSError: [Errno 121] Remote I/O error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "veml6075.py", line 8, in <module>
    veml = adafruit_veml6075.VEML6075(i2c, integration_time=100)
  File "/usr/local/lib/python3.5/dist-packages/adafruit_veml6075.py", line 106, in __init__
    self._i2c = I2CDevice(i2c_bus, _VEML6075_ADDR)
  File "/usr/local/lib/python3.5/dist-packages/adafruit_bus_device/i2c_device.py", line 76, in __init__
    raise ValueError("No I2C device at address: %x" % device_address)
ValueError: No I2C device at address: 10

Code used:

import time
import board
import busio
import adafruit_veml6075
 
i2c = busio.I2C(board.SCL, board.SDA)
 
veml = adafruit_veml6075.VEML6075(i2c, integration_time=100)
 
print("Integration time: %d ms" % veml.integration_time)
 
while True:
    print(veml.uv_index)
    time.sleep(1)

I checked the connections and enabled I2C from Raspi config.

Pd: Raspberry Pi 3 B+

@caternuson
Copy link
Contributor

Can you run i2cdetect from the command line and post output here.

i2cdetect -y 1

@thEpisode
Copy link
Author

Sure, the result is:

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

@caternuson
Copy link
Contributor

It's not showing up at all. It may be hardware related. Have you posted this in the forums?
https://forums.adafruit.com/

@thEpisode
Copy link
Author

Umm no, I haven't posted this yet, but what is the problem? what has to be seen in that result?

@caternuson
Copy link
Contributor

The above is a scan of all devices attached to the I2C bus. It should return the address for any found device. In your case, it returned nothing. Most often this a wiring or solder issue. Posting a photo of your setup in the forums would help with figuring that out.

@thEpisode
Copy link
Author

ooohh thanks, I'll be close this issue while my problem are solved, thank you!

@ShaunBorg
Copy link

Hello I have the same problem but mine is detecting the object

@caternuson
Copy link
Contributor

@ShaunBorg Also worth posting in the forums.

@lpnaunau
Copy link

Hi, I'm having also this error and I'm detecting the device as well. I think there is an issue with the Adafruit library. @ShaunBorg did you find a solution ?

@ShaunBorg
Copy link

ShaunBorg commented Apr 23, 2019 via email

@caternuson
Copy link
Contributor

Please post these issue in the forums. It's likely either hardware related or something specific to your RPi setup. Everything checks out with fresh install of Raspian Lite (2019-04-08), blinka install, and this library.

Set up:
rpi_veml6075_test

What running i2cdetect should look like:

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

And running this test code (from guide):

import time
import board
import busio
import adafruit_veml6075

i2c = busio.I2C(board.SCL, board.SDA)

veml = adafruit_veml6075.VEML6075(i2c, integration_time=100)

print("Integration time: %d ms" % veml.integration_time)

while True:
    print(veml.uv_index)
    time.sleep(1)

should look something like this:

pi@raspberrypi:~ $ python3 veml_test.py
Integration time: 400 ms
-0.023346945
0.0258415
0.027867500000000003
0.027137
0.027137
0.025841

@AnastaZIuk
Copy link

Hello I have the same problem but mine is detecting the object

and somebody got an answer what to do in that case?

@danchendrickson
Copy link

I get a the same error in my code. My code will work, I will see the sensor at 0x68 or 0x69, and the code will run. If I then stop the code to make a change (like how it outputs the data to file, unrelated to this section) the sensor gives Errno 121. I2Cdetect then returns all 0s.

@Purvendra
Copy link

I am able to detect the device ID, still getting the same error. Can anyone help me out with this please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants