SMBUS on the RPI gives IOError: [Errno 121] Remote I/O error

前提是你 提交于 2019-12-06 10:55:45

I ran into the same problem. I figured out that error code 121 is stated when none of the slaves ACKs the command send by the Master. This happens if you are trying to contact a not used address or the command is not what the slaves expect.

In my case I tried to send a reset command to a TLC59116. These ICs expect the command "0xA5 0x5A" on address 0x6B.

So I tried to send with a similar snippet like yours:

import smbus
bus = smbus.SMBus(0)
address = 0x6B
data = [0xA5,0x5A]
bus.write_i2c_block_data(address, 0, data)

But in raw communication this command leads to a Msg [0x00 0xA5 0x5A], with leading start registeraddress, which these ICs did not allow and answer correct with NACK -> Error 121.

O.T.: I solved my problem with sending

bus.write_data(address,0xA5,0x5A)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!