Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8041

Python • Generic i2c bus problem

$
0
0
Good morning, I am having problems using an OLED 1306 through the I2C bus. I have the same configuration on two Raspberry 5s, one 4GB and one 8GB. On the 8GB, after installing the python3-luma.oled package and activating I2C via raspi-config, I can run the code to display data on the OLED. However, on the 8GB, doing exactly the same thing, same Raspberry bootloader, everything updated, and when I put in the same card, it gives me the following error:

Starting OLED display example...
Traceback (most recent call last):
File "/home/carlos/Freenove_Computer_Case_Kit_for_Raspberry_Pi/Code/oled.py", line 139, in <module>
oled = OLED()
^^^^^^
File "/home/carlos/Freenove_Computer_Case_Kit_for_Raspberry_Pi/Code/oled.py", line 14, in __init__
self.device = ssd1306(self.serial)
^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/luma/oled/device/__init__.py", line 176, in __init__
self.command(
File "/usr/lib/python3/dist-packages/luma/core/device.py", line 48, in command
self._serial_interface.command(*cmd)
File "/usr/lib/python3/dist-packages/luma/core/interface/serial.py", line 96, in command
self._bus.write_i2c_block_data(self._addr, self._cmd_mode,
File "/usr/lib/python3/dist-packages/smbus2/smbus2.py", line 643, in write_i2c_block_data
ioctl(self.fd, I2C_SMBUS, msg)
BlockingIOError: [Errno 11] Resource temporarily unavailable

I have checked /boot/firmware/config.txt and /boot/firmware/cmdline.txt and they are identical and all the software and firmware of the raspberries are updated in the same way and at the same version.
However, the result of running i2cdetec -y 1 and ic2detect -F 1 gives me the same result. What could be happening? Thank you very much.

Statistics: Posted by private1492 — Fri Jul 25, 2025 10:23 am



Viewing all articles
Browse latest Browse all 8041

Trending Articles