Page 1 of 1

Eink-display shows wrong colors

Posted: Fri Dec 09, 2022 11:44 pm
by hertugen
Hello.

I have an ESP32, connected to a Waveshare 5.65" 7-color Eink-display.
My problem is that the screen is not always displaying the image/text as intended. If you look at the image below, you can see that it has a very distinct red-like tint and the black appears a tad faded. This issue appears around every 3-4 times, I reboot - and sometimes even more often.
I have previously used a 2.9" b/w and it had no such quirk.

Here is the code, that displays the text:

Code: Select all

void Eink::showErrorOnScreen(String text) {
  display.init();
    display.setTextColor(GxEPD_BLACK);
    display.setRotation(2);
    display.setFont(&FreeSansBold18pt7b);
    int16_t tbx, tby; uint16_t tbw, tbh;
    display.getTextBounds(text, 0, 0, &tbx, &tby, &tbw, &tbh);
  // center bounding box by transposition of origin:
  uint16_t x = ((display.width() - tbw) / 2) - tbx;
  uint16_t y = ((display.height() - tbh) / 2) - tby;
  display.setFullWindow();
    
    //display.setFullWindow();
    display.firstPage();
  do {
    display.fillScreen(GxEPD_WHITE);
    display.setCursor(x, y);
    display.print(text);
  } while (display.nextPage());
}
I noticed that GxEPD2 (which is the library I use) outputs an error to the console after about 10 seconds:
Busy Timeout!
Since the display takes a long time to update, could it be related to the issue? Since it's a 7-color, it takes about twice that long to update fully.
However, shouldn't the displaycontroller have received all relevant information, so that it continues to update the e-ink, no matter what?

Any ideas, what causes this?


Image

Re: Eink-display shows wrong colors

Posted: Sat Dec 10, 2022 12:29 am
by lbernstone
No, but you can find the developer at this forum: https://forum.arduino.cc/t/waveshare-e- ... spi/467865

Re: Eink-display shows wrong colors

Posted: Sun Dec 11, 2022 1:55 am
by ESP_Sprite
hertugen wrote:
Fri Dec 09, 2022 11:44 pm
Since the display takes a long time to update, could it be related to the issue? Since it's a 7-color, it takes about twice that long to update fully.
However, shouldn't the displaycontroller have received all relevant information, so that it continues to update the e-ink, no matter what?
FWIW, what could have happened here is that after the timeout, the library resets the display or puts it to deep slepe or something. This would interrupt the refresh cycle, giving you the image you see.

Re: Eink-display shows wrong colors

Posted: Tue Dec 13, 2022 7:50 am
by hertugen
I've dived a bit deeper into this matter. You may be right - however, I discovered that the code, showing the data is run twice.

Code: Select all

void Eink::showErrorOnScreen(String text) {
  display.init();
  Serial.println("I'm being run once");
  display.setTextColor(GxEPD_BLACK);
  display.setRotation(2);
  display.setFont(&FreeSansBold12pt7b);
  int16_t tbx, tby; uint16_t tbw, tbh;
  display.getTextBounds(text, 0, 0, &tbx, &tby, &tbw, &tbh);
  // center bounding box by transposition of origin:
  uint16_t x = ((display.width() - tbw) / 2) - tbx;
  uint16_t y = ((display.height() - tbh) / 2) - tby;
  display.setFullWindow();
  display.firstPage();
  do {
    Serial.println("I'm being run twice");
    display.fillScreen(GxEPD_WHITE);
    display.setCursor(x, y);
    display.print(text);
  } while (display.nextPage());
}
...which outputs this to the console:

00:07:38.376 -> I'm being run once
00:08:03.464 -> Busy Timeout!
00:08:03.464 -> I'm being run twice
00:08:03.696 -> I'm being run twice


Also, if you look at the timecode, you can see that from the display is told to initialize, it takes 25 seconds, before the timeout occurs and the do/while-loop is run. I have found no explanation on this, but suspect that these two iterations somehow conflicts with each other and try to update the same display, simultaneously.