Closed muelli01 closed 2 years ago
There are some things to check:
Thanks for the hints.
During boot/wakeup (display init) I can see the display going full white, then black and that as well turns that column black. That and the GxEPD2 demos and my little hello world test working, I would say a faulty display/controller is not the case here. Which leaves me even more puzzled.
OK, it’s puzzling and because I have a test setup I’ve just tried the code and it works as expected. Your using this line in display_init: display.init(115200, true, 2, false);
What is the serial port log saying towards the end, is it taking just 3-4 secs in total or longer, for example if you watch it in real time does it have a pronounced delay before entering sleep.
BTW what ESP board type are you using?
Your using this line in display_init: display.init(115200, true, 2, false);
Exactly
Serial output from the end:
11:01:21.295 -> _PowerOn : 39001 11:01:22.985 -> _Update_Full : 1517001 11:01:23.051 -> _PowerOff : 19001 11:01:23.051 -> _PowerOff : 0 11:01:23.051 -> Entering 220-secs of sleep time 11:01:23.051 -> Awake for : 5.388-secs 11:01:23.051 -> Starting deep-sleep period...
I use this ESP32 board: https://www.az-delivery.de/products/esp32-developmentboard It is nothing special.
OK, nothing strange there then. Unfortunately my display board has no version number on it, it's about 3-months old, but works ok. Try this:#
At line 127: display.display(false); // Full screen update mode
Change it to:
display.firstPage(); do { } while (display.nextPage());
Page buffer shows the same result.
edit: my display has Rev 2.1 printed on the back
OK, try a delay after: display.firstPage(); do { } while (display.nextPage()); delay(500);
It could be the display is slower now and needs times to complete the display before the ESP goes to sleep.
I notice in the specification that a full refresh takes 4-secs, and yet mine takes ~1-sec, the actual specification was 1.2-secs
well I suppose you ment this, right?
display.firstPage(); do { DisplayWeather(); } while (display.nextPage());
Would a delay after showing the buffer even make sense? I tried it and no matter what delay I put there (0.5s - 10s), effect is the same....
What display object line have you used?
The delay makes sense because if the display has not completed its update and the cpu goes to sleep before the display completes then it can leave a partial image on the display, giving it time enables it to complete, but it seems it's not that. You can call DisplayWeather() multiples times during the page refresh, but I don't think that is the issue, it is something to do with your new display, but what?
I've just checked the GxEPD2 non-paged update example and its identical, to my implementation, so this is not a software issue.
These problems are almost always to do with the Busy line, what are your pin definitions?
What display object line have you used?
// Connections for e.g. LOLIN D32 static const uint8_t EPD_BUSY = 4; // to EPD BUSY static const uint8_t EPD_CS = 5; // to EPD CS static const uint8_t EPD_RST = 16; // to EPD RST static const uint8_t EPD_DC = 17; // to EPD DC static const uint8_t EPD_SCK = 18; // to EPD CLK static const uint8_t EPD_MISO = 19; // Master-In Slave-Out not used, as no data from display static const uint8_t EPD_MOSI = 23; // to EPD DIN
GxEPD2_BW<GxEPD2_420, GxEPD2_420::HEIGHT> display(GxEPD2_420(/CS=D8/ EPD_CS, /DC=D3/ EPD_DC, /RST=D4/ EPD_RST, /BUSY=D2/ EPD_BUSY));
Ah OK, got the sense of the delay now. Just preventing an immediate sleep... Display update is reasonably fast around 1s i guess. So it seems it is in the range of your sample.
You can call DisplayWeather() multiples times during the page refresh, but I don't think that is the issue, it is something to do with your new display, but what?
Calling it multiple times makes no difference in theory, as this just fills the pageBuffer (and does not in reallity, I checked). It must have something to do with the display itself, but then again...why are the examples working? Weird.
Moved busy from 4 to 34, same result. I guess I just have to live with this phenomenon...
Does the GxEPD2_Example.ino work? Does the GxEPD2_NotPagedExample.ino (exactly the same as mine)?
There were a few complaints that Waveshare changed the display reset to suit the RPi boards and that stopped microcontroller boards like ESP8266/32 from working with the display, then GxEPD2 was modified to try and get around the problem, with the line: display.init(115200, true, 2, false); So try changing it back to default which is: display.init();
edit:
So try changing it back to default which is: display.init();
Already did, still the same.
Got some interesting results on these examples.
First, they both basically work and stuff is shown on the screen. BUT.... ...when an new image is shown, I can see faint shadows of what was before on this screen and the image is slightly grey-ish. Right up until the moment when the time runs out and a new image should be shown. Then, for the last few moments, the image turns to really dark black on those places, where the new image will be show. Even, if those parts of the new image are white, they still turn the old image black at those places. Hard to explain. Check attached foto for what I mean about shadows etc
I can offer to make a video and upload to youtube, so you see the examples running
Video would be good. I’m thinking it’s a faulty display. Is it a Waveshare? If so their warranty is very good even after a few years, they replaced mine if I send pictures.
Here is the video of some examples: https://youtu.be/7ORqsbZp_FY
And with the weather display?
and here a reset cycle of the weather display: https://youtu.be/aOFrm2Vo9JI
Not much to see here :)
So the code is working then, if the panel is displaying grey or streaks then it’s faulty you need to contact the supplier.
Indeed, they got back to me with some generic code from https://www.waveshare.com/wiki/E-Paper_ESP32_Driver_Board that starts a webserver, lets you select the display and upload an grey/black image and displays it. the complete line goes to grey. It is cleary not a code problem or library problem.
Thanks for your effort!
I have a strange issue with a Waveshare 4.2 display module. This is the module I use: https://www.waveshare.com/product/displays/e-paper/epaper-2/4.2inch-e-paper-module.htm
One column seems to be displayed in gray scale tone, others are black as they should be. Looks like this (highlighted the column): https://postimg.cc/cKW0ZtNp
First I thought the display or controller/driver was faulty, but when I tried a simple "hello world" programm or displayed some bitmap, everything showed black as the other columns. Code on display init seems fine here, so I am quite puzzled on how to fix this. My only idea is, that there is something not 100% correct in the refresh code for this certain display. Might not even be an issue for this repo, but more for gxEPD2? Would appreciate any hint or advice.