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 “”, line 5, in
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()

I have exactly the same issue on my RPi Zero W with Raspberry Pi OS Lite ( Release date: May 7th 2021 / Kernel version: 5.10) and an Inky impression display.

Any help would be highly appreciated.

Check out the suggested fixes in my github issue. Removing the busy pin check or increasing the wait time seems to be a good workaround.

I’m not entirely sure what you mean. I’ve found /usr/local/lib/python3.7/dist-packages/inky/inky_uc8159.py and around line 307 I see

   def _busy_wait(self, timeout=15.0):
        """Wait for busy/wait pin."""
        t_start = time.time()
        while not self._gpio.input(self.busy_pin):
            time.sleep(0.01)
            if time.time() - t_start >= timeout:
                raise RuntimeError("Timeout waiting for busy signal to clear.")

What exactly did you modify here? Something like

def _busy_wait(self, timeout=15.0):
   time.sleep(1)

or did you modify the time.sleep(0.01) to time.sleep(1)?

Yes, either replace that whole code block within the function with the time.sleep, or just change the time.sleep that is there to 30 and leave the rest of the code.

Both fixes have seemed to work for people.

With the value of 30 I had still sometimes a timeout message. I changed (around line 302) it to

def _busy_wait(self, timeout=40.0):

This seems to work reliable.

Thanks for the support