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