简体   繁体   English

尝试通过 I2C(覆盆子中的 python)访问 LCD 屏幕时出现“OSError:[Errno 121] 远程 I/O 错误”

[英]Getting "OSError: [Errno 121] Remote I/O error" when trying to access LCD screens over I2C (python in raspberry)

I have been updating an old raspberry intercom project I found on Github a while ago as a beginner project, everything was working good on the handheld stations until I got to the Operator basestation, witch has 4 LCD screens connected to my raspberry via an I2C Multiplexer.我一直在更新我不久前在 Github 上发现的一个旧树莓对讲项目,作为一个初学者项目,在我到达操作员基站之前,手持站上的一切都运行良好,有 4 个 LCD 屏幕通过 I2C 多路复用器连接到我的树莓.

For some unknown reason when I run the code I get this error:由于某些未知原因,当我运行代码时出现此错误:

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

Here is the code snippet from where the error is ocurring (I can post the whole code/GitHub repo if needed)这是发生错误的代码片段(如果需要,我可以发布整个代码/GitHub 存储库)


bus = smbus2.SMBus(1)
bus.write_byte(0x70, 0xFF)
device = ssd1306(port=0, address=0x3c, rotate=0)

clearBG("Start")

I have checked all of my VCC & GND lines and the I2C connectors and it all seems fine我已经检查了我所有的 VCC 和 GND 线以及 I2C 连接器,一切看起来都很好

If needed here's the result from "i2cdetect -y 1":如果需要,这里是“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: -- -- -- -- -- -- -- --   

Can anyone please help me to fix this issue?谁能帮我解决这个问题?

Just from looking at the i2cdetect output, your sensors are probably not connected correctly.仅通过查看 i2cdetect output,您的传感器可能未正确连接。 You should see 3c listed.您应该会看到列出的 3c。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM