Eink-display shows wrong colors

hertugen
Posts: 10
Joined: Thu Jan 06, 2022 10:22 am

Eink-display shows wrong colors

Postby hertugen » Fri Dec 09, 2022 11:44 pm

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

lbernstone
Posts: 831
Joined: Mon Jul 22, 2019 3:20 pm

Re: Eink-display shows wrong colors

Postby lbernstone » Sat Dec 10, 2022 12:29 am

No, but you can find the developer at this forum: https://forum.arduino.cc/t/waveshare-e- ... spi/467865

ESP_Sprite
Posts: 9769
Joined: Thu Nov 26, 2015 4:08 am

Re: Eink-display shows wrong colors

Postby ESP_Sprite » Sun Dec 11, 2022 1:55 am

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.

hertugen
Posts: 10
Joined: Thu Jan 06, 2022 10:22 am

Re: Eink-display shows wrong colors

Postby hertugen » Tue Dec 13, 2022 7:50 am

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.

Who is online

Users browsing this forum: No registered users and 44 guests