![](/img/trans.png)
[英]Getting IOError: [Errno 121] Remote I/O error with smbus on python (raspberry) while trying to get data over I2C from Arduino
[英]Getting "OSError: [Errno 121] Remote I/O error" when trying to access LCD screens over I2C (python in raspberry)
我一直在更新我不久前在 Github 上发现的一个旧树莓对讲项目,作为一个初学者项目,在我到达操作员基站之前,手持站上的一切都运行良好,有 4 个 LCD 屏幕通过 I2C 多路复用器连接到我的树莓.
由于某些未知原因,当我运行代码时出现此错误:
Traceback (most recent call last):
File "/home/admin/intercom/ic_basestation_pi3.py", line 354, in <module>
bus.write_byte(0x70, 0xFF)
File "/usr/local/lib/python3.9/dist-packages/smbus2/smbus2.py", line 414, in write_byte
ioctl(self.fd, I2C_SMBUS, msg)
OSError: [Errno 121] Remote I/O error
这是发生错误的代码片段(如果需要,我可以发布整个代码/GitHub 存储库)
bus = smbus2.SMBus(1)
bus.write_byte(0x70, 0xFF)
device = ssd1306(port=0, address=0x3c, rotate=0)
clearBG("Start")
我已经检查了我所有的 VCC 和 GND 线以及 I2C 连接器,一切看起来都很好
如果需要,这里是“i2cdetect -y 1”的结果:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
谁能帮我解决这个问题?
仅通过查看 i2cdetect output,您的传感器可能未正确连接。 您应该会看到列出的 3c。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.