How to manually set resolution when not detected properly when creating an AutoEPDDisplay object?
See original GitHub issueI had to buy a loose driver board from WaveShare because I toasted the one supplied with a 9.7" panel. The board they sent works fine, but I think it’s set for 1600x1200 rather than the 1200x825 resolution of the 9.7" panel.
Up until I killed my stock driver board, I used the following code and it worked properly:
from IT8951.display import AutoEPDDisplay
from IT8951 import constants as constants_HD
myepd = AutoEPDDisplay(vcom=self.vcom)
Unfortunately, allowing AutoEPDDisplay to pull the width and height from the driver board results in AutoEPPDisplay pulling the resolution from the board and setting it to 1600x1200. All the images are clearly not formatted correctly; “partial…update” test falls mostly off the screen and the image of Tux is only about 1/4 on the display. Formerly this worked just fine.
$ python3 ./test.py
Initializing EPD...
VCOM set to -1.9
System info:
display size: 1600x1200
img buffer address: 119F00
firmware version: WS_v.0.1
LUT version: 6M14T
I can see that the
__init__
in AutoEPDDisplay()
class sets the property epd=EPD()
and AutoDisplay()
gets passed the epd.width, epd.height
values. What I can’t figure out how to do is properly pass in the width and height arguments so that EPD()
gets them.
I tried to set the width and height manually, but I’m clearly not doing things correctly as the resolution reports that it is correct, but the images are still not scaled correctly:
display = AutoEPDDisplay(vcom=-1.90, rotate=args.rotate, spi_hz=24000000)
display.epd.width=1200
display.epd.height=825
$ python3 ./test.py
Initializing EPD...
VCOM set to -1.9
System info:
display size: 1200x825
img buffer address: 119F00
firmware version: WS_v.0.1
LUT version: 6M14T
Is there a way to do this?
Alternatively, do you have any idea how to bang the resolution into the board firmware?
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
By the way, the line you mention originated from the .h file here, hopefully it can help!
https://github.com/waveshare/IT8951/blob/master/IT8951.h#L104
Maybe the folks over at the papertty project can give some insights. They’re hip-deep into the hardware over there.