SUMMER SALE • UP TO 20% OFF • Ends 31st AUGUST 2025 *excludes trade customers
Support Forum

Share your projects and post your questions

The Forum

Tutorial MCP23017 verses PCA9535

The IO Pi Plus is a 32 channel MCP23017 GPIO expander for the Raspberry Pi

10/08/2022

Posted by:
inobu

inobu Avatar

In the tutorial I was getting this error

Traceback (most recent call last):
File "/home/pi/led.py", line 5, in <module>
bus = IOPi(0x21)
File "/usr/local/lib/python3.9/dist-packages/IOPi/IOPi.py", line 117, in __init__
self.__bus.write_byte_data(self.__ioaddress, self.IOCON, self.__conf)
File "/usr/local/lib/python3.9/dist-packages/smbus2/smbus2.py", line 455, in write_byte_data
ioctl(self.fd, I2C_SMBUS, msg)
OSError: [Errno 121] Remote I/O error

Trying to see what was wrong I noticed the IOPi is written for the MCP23017. Pulling up the

datasheet for the current IO PiZero PCA9535 the command structure is different. Is the IO32

tutorial valid?



Inobu

11/08/2022

Posted by:
inobu

inobu Avatar

102:~ $ sudo i2cdetect -y 1


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

11/08/2022

Posted by:
inobu

inobu Avatar

ok, I found the problem. I was linked to the old tutorial

I should have been here.

https://www.abelectronics.co.uk/kb/article/1099/io-zero-32-tutorial-1---the-blinking-led

Inobu

Forum Notice – Closure to New Posts

As part of our compliance with the UK’s Online Safety Act, the AB Electronics UK support forum is now closed to new posts and replies.

We understand the importance of continued support for our products, so if you have a technical query or require assistance, please use the Contact Form or consult our Knowledge Base for helpful articles and documentation.

We appreciate your understanding and continued support.


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.

Home

Shop

Learn

Forum

FAQ

Contact

0 item

Your cart is empty

Please browse our shop to order from the wide range of Raspberry Pi boards and accessories.

Subtotal:£0.00
View Basket Continue to Checkout