Support Forum

Share your projects and post your questions

Register   or   Sign In
The Forum

Can no longer reference an I2C address which isn't present.

916 Views - Created 04/02/2021

04/02/2021

Posted by:
PeterB

PeterB Avatar

Location:
Philippines

I have an application running on Pi3/ArchLinuxARM (using ABE Python libraries maybe six to twelve months old).

I am moving the application to Pi4/RasPiOS Lite, and up to date ABE libraries..

I find that a call such as "iop1=IOPi(0x20)" now fails if address 20 doesn't exist on the I2C bus whereas it didn't cause a problem previously. Clearly, I will be able program around this, but it caught me out.

Is this change because of Pi3 -> Pi4 (unlikely), ArchLinux -> Debian (possible) or updated libraries (most likely)?

The error reported is:


 Traceback (most recent call last):
   File "Main.py", line 57, in <module>
     main()
   File "Main.py", line 21, in main
     Initialise.Load()
   File "/home/automate/Initialise.py", line 89, in Load
     exec(string[1])
   File "<string>", line 1, in <module>
   File "/usr/local/lib/python3.7/dist-packages/IOPi/IOPi.py", line 117, in __init__
     self.__bus.write_byte_data(self.__ioaddress, self.IOCON, self.__conf)
 OSError: [Errno 121] Remote I/O error

04/02/2021

Posted by:
andrew

andrew Avatar

Location:
United Kingdom

andrew Twitter  andrew Website  

Hello Peter

I have made some changes to the IO Pi library over the last year, mostly optimizing the code and adding more validation and error handling.

Having said that the "OSError: [Errno 121] Remote I/O error" message is not one of the changes I have made and I believe it is a part of the I2C class that comes with Python so the error showing up now could be due to the move from ArchLinux to Debian.

You can find a list of the changes that I made to the IO Pi library in the change log in our GitHub repository. The last time I made a change to the library that would break backward compatibility was in 2017 when the IOPi class was renamed from ABE_IOPi.

06/02/2021

Posted by:
PeterB

PeterB Avatar

Location:
Philippines

Thanks for that info, Andrew. When I have the new environment fully debuged and running live, I will have a go at updating the ABE librariy on the ArchLinux (current live) system, just to prove your deduction.

This would suggest that there is some customisation of (fairly) standard libraries for different distributions.

Sign in to post your reply

Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view.
Download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.