Waveshare EPD Partial Refresh/Update not working

I've been struggeling with partial updates on a waveshare 2.13 inch EPD for a long time now. I have literally spent days reading articles, forums, datasheets, and so forth. No matter what I try, I simply cannot get a partial update working, so I have decided to try my first ever forum topic in search for an answer. I will try my best to describe my problem whilst respecting the forum rules according to PeryyBebbington guide.
If there is anything wrong with my post, please forgive me and let me know what I should consider for any further posts.

Hardware that I use:

µC:

  • I am using the ESP-32 Dev Kit C V2 based on WROOM 32 chip and bought from AZ-delivery

Display:

  • 2.13 Inch E-Paper Display HAT 250 x 122 black and white V3

Connection through SPI like this

Code problems
I can display everything on the EPD without any problems, be it text or a bitmap or a drawing. But I can't display partial updates. I have tried countless example code, directly from Waveshare, or also using the GxEPD and GxEPD2 libraries... partial updates just don't work.
The most simple could I could find was a video of an EPD refreshing the millis on the display. This is the code I currently use (I tried commenting everything the way I understand how the code works):

// ePaper includes
#include <GxEPD2_BW.h> //includes Epaper library
#include "epaper_board.h" //includes library for controlling epaper board?


// font gfx include
#include <Fonts/FreeMonoBold9pt7b.h>


void setup() 
{
  Serial.begin(9600);
  delay(1000);
  // epaper Init
  display.init(9600);  // enable diagnostic output on Serial
  display.setTextColor(GxEPD_BLACK); //set text color to black
  display.firstPage(); // ??? not entirely sure why this function is called
  display.setRotation(1); //sets the rotation of the screen

  delay(1000);

  do // also not sure why a do while loop is used
  {
    display.fillScreen(GxEPD_WHITE); //make screen background white
    display.setTextSize(2);
    display.setCursor(20, 60);        // set cursor(x,y)
    display.print("Millis: ");       //print the text
  } while (display.nextPage());
}

void loop() {
  display.setPartialWindow(115, 50, 200, 40); //this should set the window where the contents within are going to be refreshed
  display.firstPage();   //?

  do {
    display.fillScreen(GxEPD_WHITE); // makes the background of the partial window white so that it doesnt overwrite the numbers
    display.setTextSize(2);
    display.setCursor(120, 60);      // set cursor(x,y)
    display.print(millis());    // should print the current millis of EPS32 uptime
  } while (display.nextPage()); //?
  delay(5000);    // wait 5 seconds until the next refresh
}

This is what's inside the epaper_board.h file:

GxEPD2_BW<GxEPD2_213_B74, GxEPD2_213_B74::HEIGHT> display(GxEPD2_213_B74(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEM0213B74

I would expect the code to display the millis next to the text and refresh it every 5 seconds. But instead it just stays white:

In the serial monitor it seems that the display is indeed trying to update partially, since it says "_Update_Part : 95000" every 5 seconds, although I am not entirely sure what that means:

What am I doing wrong? Or What am I missing? I would be very grateful for some help. Thanks in advance :slightly_smiling_face:

You have a panel with a controller without differential refresh wavetable in OTP.
Try to select other supported panels.
And you should use the init() method with shortened reset pulse.
Report the inking on the flex connector. Try DEPG0213BN.

Thank you for your reply. I appreciate your work.

When you say:

do you mean that my display doesn't support refresh at all? That would explain it, but according to the documentation of my display, it mentions that it supports partial refresh:

This is the documentation of the Waveshare display I have.

And this is where I bought it.

Here is the back of the display

And the inking on the flex connector

I'm sorry for asking, but what do you mean with:

I tried researching what you wrote, but I came up with no helpful results.

Thank you for taking your time to help me.

@jamely, no problem for asking.

My answers are a bit short currently, as I am busy. But with the inking everything is clear now.

I suggest you start with the example GxEPD2_Example.ino.
Take a look at line 140:

  display.init(115200, true, 2, false); // USE THIS for Waveshare boards with "clever" reset circuit, 2ms reset pulse

For explanation search for "clever" reset circuit in this forum.

Select/uncomment line 38 in GxEPD2_display_selection_new_style.h

//#define GxEPD2_DRIVER_CLASS GxEPD2_213_BN // DEPG0213BN  128x250, SSD1680, TTGO T5 V2.4.1, V2.3.1

This supports the panel from DKE (with your inking), that has no differential refresh wavetable in OTP, but needs this wavetable to be programmed into controller registers by the driver code.

Jean-Marc

Make sure you have the actual version of GxEPD2, as available from Library Manager.

2 Likes

Thank you so much! :smiley: It works!

I did exactly what you wrote, and now my code looks like this:

// Neccesary e-paper includes
#include <GxEPD2_BW.h> //includes Epaper library
#include "GxEPD2_display_selection_new_style.h" //this contains the correct board for my display with partial refresh

// font gfx include
#include <Fonts/FreeMonoBold9pt7b.h>



void setup() 
{
  Serial.begin(115200);
  delay(1000);




  // epaper Init
  display.init(115200, true, 2, false); // USE THIS for Waveshare boards with "clever" reset circuit, 2ms reset pulse
  display.setTextColor(GxEPD_BLACK); //set text color to black
  display.firstPage(); // 
  display.setRotation(1); //sets the rotation of the screen

  delay(1000);

  do
  {
    display.fillScreen(GxEPD_WHITE); //make screen background white
    display.setTextSize(2);
    display.setCursor(20, 60);        // set cursor(x,y)
    display.print("Millis: ");       //print the text
  } while (display.nextPage());
}

void loop() {
  display.setPartialWindow(120, 55, 200, 60); //this should set the window where the contents within are going to be refreshed
  display.firstPage();   //?

  do 
  {
    display.fillScreen(GxEPD_WHITE); // makes the background of the partial window white so that it doesnt overwrite the numbers
    display.setTextSize(2);
    display.setCursor(120, 60);      // set cursor(x,y)
    display.print(millis());    // should print the current millis of EPS32 uptime
  } while (display.nextPage()); //?
  delay(5000);    // wait 5 seconds until the next refresh
}

and I only have the GxEPD2_display_selection_new_style.h and GxEPD2_selection_check.h included.

Finaly I can have partial updates on my EPD :grin:

Thanks again!

Thank you for the feedback!

Your processor (ESP32) has enough RAM for full buffered graphics on your display.
See README.md for the explanation for Paged Drawing, Picture Loop and Full Screen Buffer Support, to solve your question marks.

In my examples I always use the page loops, as the general solution in GxEPD2.
But there is also an example GxEPD2_NotPagedExample.ino

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