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

If I got follow Traceback, what should I do? #72

Open
ufo20102020 opened this issue Dec 11, 2023 · 8 comments
Open

If I got follow Traceback, what should I do? #72

ufo20102020 opened this issue Dec 11, 2023 · 8 comments

Comments

@ufo20102020
Copy link

File "/home/pi/waveshare-epaper-display/.venv/bin/cairosvg", line 5, in
from cairosvg.main import main
File "/home/pi/waveshare-epaper-display/.venv/lib/python3.9/site-packages/cairosvg/init.py", line 26, in
from . import surface # noqa isort:skip
File "/home/pi/waveshare-epaper-display/.venv/lib/python3.9/site-packages/cairosvg/surface.py", line 9, in
import cairocffi as cairo
File "/home/pi/waveshare-epaper-display/.venv/lib/python3.9/site-packages/cairocffi/init.py", line 48, in
cairo = dlopen(
File "/home/pi/waveshare-epaper-display/.venv/lib/python3.9/site-packages/cairocffi/init.py", line 45, in dlopen
raise OSError(error_message) # pragma: no cover
OSError: no library called "cairo-2" was found
no library called "cairo" was found
no library called "libcairo-2" was found
cannot load library 'libcairo.so.2': libcairo.so.2: cannot open shared object file: No such file or directory
cannot load library 'libcairo.2.dylib': libcairo.2.dylib: cannot open shared object file: No such file or directory
cannot load library 'libcairo-2.dll': libcairo-2.dll: cannot open shared object file: No such file or directory

@mendhak
Copy link
Owner

mendhak commented Dec 11, 2023

During the .venv/bin/pip3 install -r requirements.txt step, see if there were any errors related to installing CairoSVG. Basically that requirements.txt step should have installed Cairo. If you see that error it's indicating that the install did not happen successfully.
You could try running the step again.

Is this on Raspberry Pi OS latest version?

@ufo20102020
Copy link
Author

When I rerun and I saw "Requirement already satisfied: CairoSVG==2.5.2 in ./.venv/lib/python3.9/site-packages (from -r requirements.txt (line 5)) (2.5.2)"

The OS is latest Lite version.

Thx

@mendhak
Copy link
Owner

mendhak commented Dec 11, 2023

Does it work if you apt install these

libcairo2 libcairo2-dev

@ufo20102020
Copy link
Author

No previous error when installed.

However, it stop process (May be) after "EXPORT To PNG". I added Debug mode and last sentence is:

2023-12-11:16:55:02 DEBUG [display.py:28] Initialize screen
2023-12-11:16:55:03 DEBUG [epd7in5b_V2.py:69] e-Paper busy

Is it a e-paper hardware problem itself or driver problem? I can run waveshare sample without problem.

@mendhak
Copy link
Owner

mendhak commented Dec 11, 2023

When I set LOG_LEVEL=DEBUG I get this towards the end:

---------------------------------------
EXPORT TO PNG
---------------------------------------
2023-12-11:19:05:22 DEBUG    [display.py:28] Initialize screen
2023-12-11:19:05:22 DEBUG    [epd7in5.py:77] e-Paper busy
2023-12-11:19:05:22 DEBUG    [epd7in5.py:80] e-Paper busy release
2023-12-11:19:05:22 DEBUG    [display.py:38] Read image file: screen-output.png
2023-12-11:19:05:22 DEBUG    [PngImagePlugin.py:201] STREAM b'IHDR' 16 13
2023-12-11:19:05:22 DEBUG    [PngImagePlugin.py:201] STREAM b'bKGD' 41 6
2023-12-11:19:05:22 DEBUG    [PngImagePlugin.py:738] b'bKGD' 41 6 (unknown)
2023-12-11:19:05:22 DEBUG    [PngImagePlugin.py:201] STREAM b'IDAT' 59 8192
2023-12-11:19:05:22 INFO     [display.py:40] Display image file on screen
2023-12-11:19:05:24 DEBUG    [epd7in5.py:77] e-Paper busy
2023-12-11:19:05:28 DEBUG    [epd7in5.py:80] e-Paper busy release
2023-12-11:19:05:28 DEBUG    [epd7in5.py:77] e-Paper busy
2023-12-11:19:05:28 DEBUG    [epd7in5.py:80] e-Paper busy release
2023-12-11:19:05:30 DEBUG    [epdconfig.py:111] spi end
2023-12-11:19:05:30 DEBUG    [epdconfig.py:125] close 5V, Module enters 0 power consumption ...

You'll want to make sure you've set the right epaper version in the env.sh, eg is it version 1 or 2, or is it the red one, 2B.

@ufo20102020
Copy link
Author

My e-paper is 7.5in white black red and I set 2B in env.sh already. Below is the debug message after 10 minutes run.


EXPORT TO PNG

2023-12-12:11:44:05 DEBUG [display.py:28] Initialize screen
2023-12-12:11:44:06 DEBUG [epd7in5b_V2.py:69] e-Paper busy
^C2023-12-12:11:52:06 DEBUG [display.py:53] Keyboard Interrupt - Exit
2023-12-12:11:52:06 DEBUG [epdconfig.py:79] spi end
2023-12-12:11:52:06 DEBUG [epdconfig.py:82] close 5V, Module enters 0 power consumption ...

@mendhak
Copy link
Owner

mendhak commented Dec 12, 2023

Hmm I'm not sure now. I don't have a red Waveshare so I can't test anything. But if you're saying the sample works, then the problem is in this repo's code.

Although it doesn't look the same, I'm wondering if there's some similarity with this issue: #70

Unlikely though, in your case it's just hanging and you had to interrupt it. Hmm

@jasompi
Copy link
Contributor

jasompi commented Jan 14, 2024

You might want to reboot the raspberry pi. If you interrupt the the spi driver state might not clean up correctly.

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

3 participants