inky: exception "Timeout waiting for busy signal to clear." thrown when trying to update display with inky.show (Inky Impressions)
Hello,
I have the Inky Impressions display on a Raspberry Pi Zero W running Raspbian 10. I am using Python 3.7.3
I installed the inky library and all dependencies and was initially able to run a script and display an image on the screen. However, now whenever I try to display a new image the following exception is thrown:
Traceback (most recent call last): File “<stdin>”, line 5, in <module> File “/home/pi/.local/lib/python3.7/site-packages/inky/inky_uc8159.py”, line 365, in show self._update(buf.astype(‘uint8’).tolist(), busy_wait=busy_wait) File “/home/pi/.local/lib/python3.7/site-packages/inky/inky_uc8159.py”, line 320, in _update self.setup() File “/home/pi/.local/lib/python3.7/site-packages/inky/inky_uc8159.py”, line 226, in setup self._busy_wait() File “/home/pi/.local/lib/python3.7/site-packages/inky/inky_uc8159.py”, line 309, in _busy_wait raise RuntimeError(“Timeout waiting for busy signal to clear.”) RuntimeError: Timeout waiting for busy signal to clear.
I tried running the example code to clear the display and got the same error.
Any idea on how to fix this issue?
For reference here is my script to display an image:
from os import listdir
from os.path import isfile, join
from PIL import Image
from inky.inky_uc8159 import Inky
IMAGES_DIR = "/home/pi/scripts/picturesforpi2"
images = [i for i in listdir(IMAGES_DIR) if isfile(join(IMAGES_DIR, i))]
print(images)
pic = Image.open(join(IMAGES_DIR, images[0]))
pic = pic.resize((600,448))
inky = Inky()
saturation = 0.5
inky.set_image(pic, saturation=saturation)
inky.show()
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 16 (5 by maintainers)
Commits related to this issue
- Update inky_uc8159.py Increase the default timeout, since 15 seconds doesn't seem to be enough for the 7color display. Fixes issue #103 — committed to PeaceDealer/inky by PeaceDealer 3 years ago
I changed to value to 40s for my Raspberry Pi Zero W and have no timeout warnings anymore (see https://forums.pimoroni.com/t/exception-timeout-waiting-for-busy-signal-to-clear-thrown-when-trying-to-update-display-with-inky-show-inky-impressions/16597/4).
Hi, I have exactly the same issue with a brand new inky impression and pi4b. After the standard installation instructions on https://shop.pimoroni.com/products/inky-impression, then running
7color/clean.py
, this returnsTraceback (most recent call last): File "clear.py", line 14, in <module> inky.show() File "/usr/local/lib/python3.7/dist-packages/inky/inky_uc8159.py", line 365, in show self._update(buf.astype('uint8').tolist(), busy_wait=busy_wait) File "/usr/local/lib/python3.7/dist-packages/inky/inky_uc8159.py", line 329, in _update self._busy_wait() File "/usr/local/lib/python3.7/dist-packages/inky/inky_uc8159.py", line 309, in _busy_wait raise RuntimeError("Timeout waiting for busy signal to clear.")
As @PeaceDealer suggested, raising the default_busy_wait
in/usr/local/lib/python3.7/dist-packages/inky/inky_uc8159.py
from15
to30
resolves the issue and allows the process to complete normally, with no exceptions.I imagine the other suggested fixes, like catching the Exception, are not a good idea as the requested process is still interrupted.
Hey just to chip in, same above.
Tried to run “stripes.py” and “clear.py” getting the exception from that shared libary.
Litterly just unpacked & plugged in display.
Have been using the inky what without issues, and just swapped out the display.
Personally fixed it by going to
/usr/local/lib/python3.7/dist-packages/inky/inky_uc8159.py
and looking fordef _busy_wait
and raising the default timeout to 30I had the same issue with an inky7.
The display - initially - worked, but stopped after a few months of sitting stale on the shelf.
I just removed the busy-wait code in the driver inky_uc8159.py line 307 and replaced it with a 1 second sleep. The display then worked.
I also tried replacing it with a test for the pin being LOW. This did NOT work. The busy pin under test seems to be 0 (LOW) at all times (in other words, it doesn’t do anything after the board runs the reset sequence).
I also tried with the smalled mono inky display. It worked out of the box.