Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error BlockingIOError: [Errno 11] Resource temporarily unavailable on armbian 25.x (armv7l) #397

Open
lequan81 opened this issue Dec 19, 2024 · 1 comment

Comments

@lequan81
Copy link

Type of Raspberry Pi

Orangepi Zero H3 LTS (armv7l) running latest Armbian 25.x (minimal/IOT version) based on Debian 12 (bookworm)

Linux Kernel version

Linux kernel version 6.6.62
Linux orangepizero 6.6.62-current-sunxi #2 SMP Sun Nov 17 14:08:59 UTC 2024 armv7l GNU/Linux

Expected behaviour

OLED display (SSD1306) show current stats of boards using I2C protocol on i2c-0

Actual behaviour

The screen does not show up, the i2cdetect -y 0 return OLED address at 0x3c
When running i2cdetect -F 0, it returns the result

Functionalities implemented by /dev/i2c-0:
I2C                                 yes
SMBus Quick Command                 yes
SMBus Send Byte                     yes
SMBus Receive Byte                  yes
SMBus Write Byte                    yes
SMBus Read Byte                     yes
SMBus Write Word                    yes
SMBus Read Word                     yes
SMBus Process Call                  yes
SMBus Block Write                   yes
SMBus Block Read                    no
SMBus Block Process Call            no
SMBus PEC                           yes
I2C Block Write                     yes
I2C Block Read                      yes

traceback info:

Traceback (most recent call last):

  File "$user/stats/main.py", line 92, in <module>
    main()
  File "$user/stats/main.py", line 86, in main
    stats()
  File "$user/stats/main.py", line 65, in stats
    with canvas(device) as draw:
  File "$user/stats_env/lib/python3.11/site-packages/luma/core/render.py", line 43, in __exit__
    self.device.display(self.image)
  File "$user/stats_env/lib/python3.11/site-packages/luma/oled/device/__init__.py", line 311, in display
    self.data(list(buf))
  File "$user/stats_env/lib/python3.11/site-packages/luma/core/device.py", line 55, in data
    self._serial_interface.data(data)
  File "$user/stats_env/lib/python3.11/site-packages/luma/core/interface/serial.py", line 128, in data
    write(list(data[i:i + block_size]))
  File "$user/stats_env/lib/python3.11/site-packages/luma/core/interface/serial.py", line 137, in _write_large_block
    self._bus.i2c_rdwr(self._i2c_msg_write(self._addr, [self._data_mode] + data))
  File "$user/stats_env/lib/python3.11/site-packages/smbus2/smbus2.py", line 660, in i2c_rdwr
    ioctl(self.fd, I2C_RDWR, ioctl_data)

BlockingIOError: [Errno 11] Resource temporarily unavailable

And here is my main.py

I believe the Python code worked flawlessly on the previous kernel, 6.2.x. However, after updating to kernel 6.6.62, it is mostly broken, and it seems like something changed that made the current SMBus library seem to be working poorly.

Would you please be so kind to help me on this issue?
Best regards and thanks,
lequan81

@lequan81
Copy link
Author

Update: after waiting for about ~2.5hrs, it seems the python code working as it should for a couple of minutes, then returns with the same errors. Here is the return of journalctl -xeu stats.service:

A start job for unit stats.service has finished successfully.

The job identifier is 652.

Dec 19 21:42:25 orangepizero bash[1910]: Traceback (most recent call last):
Dec 19 21:42:25 orangepizero bash[1910]:   File "/home/admin/stats/main.py", line 92, in <module>
Dec 19 21:42:25 orangepizero bash[1910]:     main()
Dec 19 21:42:25 orangepizero bash[1910]:   File "/home/admin/stats/main.py", line 86, in main
Dec 19 21:42:25 orangepizero bash[1910]:     stats()
Dec 19 21:42:25 orangepizero bash[1910]:   File "/home/admin/stats/main.py", line 65, in stats
Dec 19 21:42:25 orangepizero bash[1910]:     with canvas(device) as draw:
Dec 19 21:42:25 orangepizero bash[1910]:   File "/home/admin/stats_env/lib/python3.11/site-packages/luma/core/render.py", line 43, in __exit__
Dec 19 21:42:25 orangepizero bash[1910]:     self.device.display(self.image)
Dec 19 21:42:25 orangepizero bash[1910]:   File "/home/admin/stats_env/lib/python3.11/site-packages/luma/oled/device/__init__.py", line 311, in display
Dec 19 21:42:25 orangepizero bash[1910]:     self.data(list(buf))
Dec 19 21:42:25 orangepizero bash[1910]:   File "/home/admin/stats_env/lib/python3.11/site-packages/luma/core/device.py", line 55, in data
Dec 19 21:42:25 orangepizero bash[1910]:     self._serial_interface.data(data)
Dec 19 21:42:25 orangepizero bash[1910]:   File "/home/admin/stats_env/lib/python3.11/site-packages/luma/core/interface/serial.py", line 128, in data
Dec 19 21:42:25 orangepizero bash[1910]:     write(list(data[i:i + block_size]))
Dec 19 21:42:25 orangepizero bash[1910]:   File "/home/admin/stats_env/lib/python3.11/site-packages/luma/core/interface/serial.py", line 137, in _write_lar>
Dec 19 21:42:25 orangepizero bash[1910]:     self._bus.i2c_rdwr(self._i2c_msg_write(self._addr, [self._data_mode] + data))
Dec 19 21:42:25 orangepizero bash[1910]:   File "/home/admin/stats_env/lib/python3.11/site-packages/smbus2/smbus2.py", line 660, in i2c_rdwr
Dec 19 21:42:25 orangepizero bash[1910]:     ioctl(self.fd, I2C_RDWR, ioctl_data)
Dec 19 21:42:25 orangepizero bash[1910]: BlockingIOError: [Errno 11] Resource temporarily unavailable
Dec 19 21:42:26 orangepizero systemd[1]: stats.service: Main process exited, code=exited, status=1/FAILURE

Subject: Unit process exited
Defined-By: systemd
An ExecStart= process belonging to unit stats.service has exited.

The process' exit code is 'exited' and its exit status is 1.
Dec 19 21:42:26 orangepizero systemd[1]: stats.service: Failed with result 'exit-code'.

Subject: Unit failed
Defined-By: systems

The unit stats.service has entered the 'failed' state with the result 'exit-code'.

Here is this stats.service

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant