-
Notifications
You must be signed in to change notification settings - Fork 7
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
OSError: [Errno 121] Remote I/O error #1
Comments
I'm seeing the same thing. If I run the binary directly, I get this:
...and if I run the sample python script, I get this:
Used pip3 for install per the instructions. Other pertinent info: os-release:
I'm using an older model pi I had sitting around, model B v2.0. |
I'm having the exact same error. Did you manage to solve it? |
My research shows that i2cdetect may not actually be the definitive proof that i2c is working--even if the ID does come up in the grid. The I nearly gave up and sent the sensor back, but opted instead to try UART mode (using the TX/RX pins). That worked super easily using this library: https://avaldebe.github.io/PyPMS/ |
Hey guys, Sorry for late response. I have been gone for my military service. Remote I/O errors mostly related to poor I2C busses. Did any of you try to use pull-up resistors ? |
No worries! I did use pull-up resistors, but sadly I was not successful in gettin I2C to work. UART mode works great, though, so I just went that route. I did not try different power supply or usb cable but I've read sometimes that weak power or cheap cables can also contribute to similar issues. |
I know for sure that the I2C communication is working because with this code everything works fine https://github.com/brannow/sps30. But for my project I need a python library to make the sensor work, so it seems there's a problem with this library itself. |
I am running into the same issue when running
If start a Python Console and play around, it only fails here, everything else works just fine:
It does look like a code issue, maybe not in the sps30 library but in smbus2? |
@Gretel5X Issue may be related to Python version (and all other pip packages that depends on the Python version). Can you try with 3.5 or 3.6 instead of 3.9 or something else. I'm working from home and don't have the hardware at the moment. Edit: Also you can try with 0.3.0 version of smbus2. |
Tried 3.6, 3.7 and 3.9 each with smbus2==0.3.0, it will always get stuck at line 20.. Python 3.5 reached EOL last year, 3.6 will reach it this year so I would not really want to use it anyways |
I remembered that one of the contributor of this project, Felix Belair, sent me an e-mail in June, mentioned that he is struggled with the same problem as you guys. He was able to fix the problem by adding these lines;
to SPS30 class and using the driver like this;
He also said that 1 second rest after each measurement is helpful to prevent crashes. Please let me know if that works for you too so I can update the driver. |
I tried it and I have not gotten any error messages, even without the context manager. Interestingly, my docker container which is running since a few days and got restarted a couple of times (setting auto-cleaning intervall, reading serial etc) did not log any errors like it used to when I started developing the script. Maybe something in the underlying modules changed? Using the context manager is not necessary and should not make a difference anyway, only if you have other parts of the code accessing the i2c bus and you want to close the bus after reading the sps30. It would make sense to add the enter and exit functions anyway to have defined behavior when someone wants to use the context manager. Edit: |
I'm using your script, but get this error. Googling results in more similar experiences. But as far as I can see, no solution.
Strange thing is that I get an DEVICE_SERIAL which in my opinion means that i2c is correct.
Running with sudo gives same error.
The text was updated successfully, but these errors were encountered: