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

Cannot Open Display #6

Closed
holmesha opened this issue May 1, 2022 · 13 comments
Closed

Cannot Open Display #6

holmesha opened this issue May 1, 2022 · 13 comments

Comments

@holmesha
Copy link

holmesha commented May 1, 2022

Per my last message I hooked up a slightly larger 7.5in display. I altered the epd name in the systemsix.py file and the eink_utils.py file as well as the display size to 800, 480. It seems to successfully pull the weather and calendar info, but unfortunately I can't get it to display. I get the following error:

INFO:app:systemsix.update_display(); updating display.
option parsing failed: Cannot open display:
^CTraceback (most recent call last):
File "/home/pi/SystemSix/systemsix.py", line 557, in
main()
File "/home/pi/SystemSix/systemsix.py", line 553, in main
time.sleep(5)

Any ideas on where I might be going wrong? I know you said to try turning off the display to test run it, but I'm running this out of a Mac terminal and I'm not sure how to get that to display without the e-ink screen. Thanks!!

@EngineersNeedArt
Copy link
Owner

My guess is that you need to include the correct e-ink driver that matches your 7.5" display. Can you share with me the change you made in that regard?

@EngineersNeedArt
Copy link
Owner

This line will have to be changed to match your display:

import lib.epd5in83_V2 as eInk

@EngineersNeedArt
Copy link
Owner

I see these possible driver libraries:

epd7in5.py
epd7in5_HD.py
epd7in5_V2.py
epd7in5b_HD.py
epd7in5b_V2.py
epd7in5bc.py

If I had to guess, I would start with epd7in5_V2.py.

@holmesha
Copy link
Author

holmesha commented May 1, 2022

Unfortunately it seems to be something else. I changed it in both the systemsix and eink_utils files to epd7in5b_v2.py. I confirmed that was the one when I used it with the Waveshare demo code.

@EngineersNeedArt
Copy link
Owner

EngineersNeedArt commented May 1, 2022

So the demo code from Waveshare worked? Would be interesting to see how that code differs from SystemSix's code. Perhaps they initialize the panel differently.

BTW, I haven't tried Mac Terminal but I did try using PyCharm CE on the Mac.
If you flip USE_EINK_DISPLAY to False there is the line of code final_image.show() that, at least in PyCharm, opened the image with Preview on the Mac.

@holmesha
Copy link
Author

holmesha commented May 1, 2022

Thank you so much! I'm sure you have better things to do on a Sunday afternoon, but I appreciate it. I'll definitely give PyCharm a try to make sure nothing else is wonky.

Yep the Waveshare demo worked and I was actually able to get 13bytes' calendar to work. I'll compare the display code. Wondering also if there may be an updated driver. Thanks again!

@holmesha
Copy link
Author

holmesha commented May 1, 2022

I updated the driver and I get a new error

WARNING:app:display() missing 1 required positional argument: 'imagered'
INFO:app:systemsix.update_display(); trying to module_exit().
Traceback (most recent call last):
File "/home/pi/SystemSix/systemsix.py", line 556, in
main()
File "/home/pi/SystemSix/systemsix.py", line 547, in main
update_or_start(True)
File "/home/pi/SystemSix/systemsix.py", line 533, in update_or_start
update_display(period)
File "/home/pi/SystemSix/systemsix.py", line 369, in update_display
raise e
File "/home/pi/SystemSix/systemsix.py", line 356, in update_display
epd.display(epd.getbuffer(ink_image))
TypeError: display() missing 1 required positional argument: 'imagered'

@EngineersNeedArt
Copy link
Owner

Interesting. 13bytes calendar used a display that had red in addition to black. The call to display the image, maybe it's epd.display(), took an extra image argument. You would pass the black image and a separate red image.

You might try just passing None, like epd.display(epd.getbuffer(ink_image), None)

Or if None is not allowed, just create an empty image for the red image and pass it.

@EngineersNeedArt
Copy link
Owner

Something like:

red_image = Image.new(mode="RGBA", size=(800, 480), color='white')

Then:

epd.display(epd.getbuffer(ink_image), red_image)

@holmesha
Copy link
Author

holmesha commented May 2, 2022

Thank you so much again. If this doesn't work I will cut my losses and buy the same screen!

@EngineersNeedArt
Copy link
Owner

It's clear to me you are close.

BTW, code above probably should be:

red_image = Image.new(mode="RGBA", size=(800, 480), color='white')
epd.display(epd.getbuffer(ink_image), epd.getbuffer(red_image))

I forgot the epd.getbuffer() for the red image. You can see it in 13Bytes code.

@holmesha
Copy link
Author

holmesha commented May 2, 2022

That did it, thank you! Beautiful.

I'm going to mess around with the size of the picture a little bit to reflect the larger screen, but it is amazing!

@EngineersNeedArt
Copy link
Owner

Very cool. Happy to have tried to help.

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

2 participants