pimoroni / inky

Combined library for V2/V3 Inky pHAT and Inky wHAT.
https://shop.pimoroni.com/?q=inky
MIT License
595 stars 122 forks source link

Lots of "Busy Wait: Held high" warnings with every screen redraw (Inky Impression) #205

Open peepay opened 1 month ago

peepay commented 1 month ago

Hello, I contacted support and they just confirmed the same behavior and asked me to report an issue here.

With the 5.7" Inky Impression and the latest version (2.0.0) of the Inky library, the commands output a lot of warnings with every screen redraw:

(pimoroni) pi@raspberrypi:~/inky/examples/7color $ python3 image.py --file ~/photo.jpg Detected 7-Colour (UC8159) /home/pi/.virtualenvs/pimoroni/lib/python3.11/site-packages/inky/inky_uc8159.py:331: UserWarning: Busy Wait: Held high. Waiting for 1.00s warnings.warn(f"Busy Wait: Held high. Waiting for {timeout:0.2f}s") /home/pi/.virtualenvs/pimoroni/lib/python3.11/site-packages/inky/inky_uc8159.py:331: UserWarning: Busy Wait: Held high. Waiting for 0.20s warnings.warn(f"Busy Wait: Held high. Waiting for {timeout:0.2f}s") /home/pi/.virtualenvs/pimoroni/lib/python3.11/site-packages/inky/inky_uc8159.py:331: UserWarning: Busy Wait: Held high. Waiting for 32.00s warnings.warn(f"Busy Wait: Held high. Waiting for {timeout:0.2f}s") (pimoroni) pi@raspberrypi:~/inky/examples/7color $

The screen redraws correctly, but the warnings do concern me.

Note: The warnings shown here are produced after running the image.py file from your examples, but the same warnings show even when I run the commands to load and display the image manually in python myself, so it is not limited only to the provided image.py file.

Interestingly, if there are more screen redraws in a single script (such as in the cycle.py file from your examples), only the first redraw produces the warnings.

I checked the source at the referenced line and a related comment says "_If the busypin is *high* (pulled up by host) then assume we're not getting a signal from inky and wait the timeout period to be safe." but I am not sure what that means.

(If that matters, I'm using RPi Zero 2W and Bookworm.)

grandmastermarco commented 1 week ago

same for me. new setup on same hardware (RPi Zero 2W Bookworm 64bit headless - new os) lots of error messages "...Busy Wait: Held high...." with example 7color scripts and also custom scripts.

but screen responds normally.

Gadgetoid commented 1 week ago

Interestingly, if there are more screen redraws in a single script (such as in the cycle.py file from your examples), only the first redraw produces the warnings.

This is definitely interesting.

Broadly the warnings are only there so we know this is happening and can use it as an extra diagnosis step if the display is not working. If it is working then they're safe to ignore.

I believe you can use Python's warnings module to suppress them:

import warnings
warnings.filterwarnings("ignore")
kedare commented 4 days ago

Confirmed on a new raspberry pi zero 2wh + inky impression73, on the example scripts:

python stripes.py -t impressions73
Failed to detect an Inky board. Trying --type/--colour arguments instead...

/home/kedare/.virtualenvs/pimoroni/lib/python3.11/site-packages/inky/inky_ac073tc1a.py:285: UserWarning: Busy Wait: Held high. Waiting for 1.00s
  warnings.warn("Busy Wait: Held high. Waiting for {:0.2f}s".format(timeout))
/home/kedare/.virtualenvs/pimoroni/lib/python3.11/site-packages/inky/inky_ac073tc1a.py:285: UserWarning: Busy Wait: Held high. Waiting for 0.40s
  warnings.warn("Busy Wait: Held high. Waiting for {:0.2f}s".format(timeout))
/home/kedare/.virtualenvs/pimoroni/lib/python3.11/site-packages/inky/inky_ac073tc1a.py:285: UserWarning: Busy Wait: Held high. Waiting for 45.00s
  warnings.warn("Busy Wait: Held high. Waiting for {:0.2f}s".format(timeout))
peepay commented 4 days ago

Failed to detect an Inky board.

That's a fundamental difference compared to my issue - the board is detected in my case.

Does it actually redraw the screen correctly for you, or not?

kedare commented 3 days ago

Yes it does when I force via -t

The failed to detect is an error appart but I do have the held high issue too.

peepay commented 1 day ago

Okay, I did not have to force anything, though.

Let's leave it up to the Pimoroni staff to say whether it's related or not.