GxEPD2 GDEY042T81 (Waveshare 4.2 BW v2.2) - partial update issue

Hello,

I'm using GDEY042T81 (Waveshare 4.2 BW v2.2) with Wemos D1 Pro (with 3.3k pull-down on CS and 1k pull-up on RST).

I would like to use the partial update feature and I've reduced the code from GxEPD2_NotPagedExample example - what I'm seeing is that I get a garbage output only on first pass and first partial "box", all successive partial updates are just fine.

Changing display.displayWindow(box_x, box_y, box_w, box_h); to display.display(true); makes no difference.

After trial and error I've noticed that everything is fixed if I call display.display(true); just after initial non-partial update (e.g. put it between helloWorld(); and showPartialUpdate();). It also seems that I need to call the display.display(true); after each display.display(false); to fix any partial update issues.

Am I doing something wrong?

Thank you,
Best Regards,

Sample code:

#define ENABLE_GxEPD2_GFX 0

#include <GxEPD2_BW.h>
#include <Fonts/FreeMonoBold18pt7b.h>

#define GxEPD2_DISPLAY_CLASS GxEPD2_BW

static const uint8_t EPD_BUSY = D1;
static const uint8_t EPD_CS = D8;
static const uint8_t EPD_RST = D4;
static const uint8_t EPD_DC = D2;
static const uint8_t EPD_SCK = D5;
static const uint8_t EPD_MISO = -1;
static const uint8_t EPD_MOSI = D7;

#define GxEPD2_DRIVER_CLASS GxEPD2_420_GDEY042T81 // GDEY042T81 400x300, SSD1683 (no inking)

GxEPD2_BW<GxEPD2_DRIVER_CLASS, GxEPD2_DRIVER_CLASS::HEIGHT> display(GxEPD2_DRIVER_CLASS(/*CS=D8*/ EPD_CS, /*DC=D3*/ EPD_DC, /*RST=D4*/ EPD_RST, /*BUSY=D2*/ EPD_BUSY));

void setup()
{
  display.init(115200, true, 2, false);
  
  helloWorld();
  //display.displayWindow(0, 0, 400, 300);
  //display.display(true);
  showPartialUpdate();
  
  display.powerOff();
}

void loop()
{
}

const char HelloWorld[] = "Hello World!";

void helloWorld()
{
  display.setRotation(0);
  display.setFont(&FreeMonoBold18pt7b);
  display.setTextColor(GxEPD_BLACK);

  int16_t tbx, tby; uint16_t tbw, tbh;
  display.getTextBounds(HelloWorld, 0, 0, &tbx, &tby, &tbw, &tbh);
  
  uint16_t x = ((display.width() - tbw) / 2) - tbx;
  uint16_t y = ((display.height() - tbh) / 2) - tby;
  
  display.setFullWindow();
  display.fillScreen(GxEPD_WHITE);
  display.setCursor(x, y);
  display.print(HelloWorld);
  display.display(false);
}

void showPartialUpdate()
{
  uint16_t box_x = 10;
  uint16_t box_y = 15;
  uint16_t box_w = 150;
  uint16_t box_h = 30;
  uint16_t cursor_y = box_y + box_h - 6;
  float value = 13.95;

  display.setFont(&FreeMonoBold18pt7b);
  display.setTextColor(GxEPD_BLACK);

  for (uint16_t pass = 0; pass < 2; pass++)
  {
    for (uint16_t r = 0; r < 4; r++)
    {
      display.setRotation(r);
      for (uint16_t i = 1; i <= 10; i += 1)
      {
        display.fillRect(box_x, box_y, box_w, box_h, GxEPD_WHITE);
        display.setCursor(box_x, cursor_y);
        display.print(value * i, 2);
        display.displayWindow(box_x, box_y, box_w, box_h);
        //display.display(true);
        delay(500);
      }
      delay(1000);
      display.fillRect(box_x, box_y, box_w, box_h, GxEPD_WHITE);
      display.displayWindow(box_x, box_y, box_w, box_h);
      //display.display(true);
      delay(1000);
    }
  }
}
1 Like

@0xh4o7zkp , Hi, welcome to the forum!

I am quite sure I tested the actual release with all examples and all display panels.
But not with all processors, only ESP32 Wemos LOLIN Lite and Arduino UNO.
And not with Waveshare display boards.

I will check your issue, maybe tomorrow.

Does your issue also occur with GxEPD2_Example?
-jz-

Hello,

I've checked the GxEPD2_Example - the only modification is that I didn't use GxEPD2_display_selection_new_style.h but just used the includes/settings from previous example.

After running the example I cannot see the partial output from helloFullScreenPartialMode(), only the centered "Hello World!" is visible.

Then when it goes to to helloArduino() - "Hello World!" is visible, but the text with "Hello Arduino!" is garbled.

Same for helloEpaper()- "Hello World!" is visible, but the text with "Hello E-Paper!" is garbled.

All other screens seems to be just fine.

Now, adding the display.display(true) as a first instruction in helloFullScreenPartialMode() fixes all the partial refresh issues (exactly like in previous example).

Would you like to have some videos of this behavior? Should I check anything else?

Thanks,
Best Regards,

Thanks for the additional information. I will check your issue, maybe tomorrow.
I am just back from shopping, and I have a medical check (skin check) this afternoon.
No time left for my hobby.
-jz-

No problem, thanks and take care :slight_smile:

I confirm that this issue exists with the released version 1.5.5.
Your example really helped to see it clearly, thanks to the big font.

It is the same issue as in this topic, with the explanation in this post:
https://forum.arduino.cc/t/gxepd2-gdey029t94-ssd1680-weird-partial-update-behaviour/1223604/9.
The fix is in version 1.5.6 on GitHub. For your issue, it is enough to download and replace GxEPD2_420_GDEY042T81.cpp.
Or you can download the complete version 1.5.6 as zip-file, and install with the Library Manager method Add .ZIP Library...
Version 1.5.6 will receive more fixes and additions.
-jz-

I've checked the latest version from GitHub, I can confirm that the issue is gone and partial refresh works for both examples - great job!

Thanks again,
Best Regards,

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.