ESP8266 DeepSleep Partial Update with gxepd2

Hi!
I know I am not the first one to ask, but I just couldn't get it working.
I am trying to partially update the displayed temperature on my epaper display but it just doesn't work. Every time the esp wakes up it fully refreshes the whole screen.

GxEPD2_BW<GxEPD2_150_BN, GxEPD2_150_BN::HEIGHT> display(GxEPD2_150_BN(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 5, /*BUSY=D2*/ 4));

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

  if (rtcMemory.begin()) {
    Serial.println("Initialization done! Previous data found.");
  } else {
    Serial.println("Initialization done! No previous data found. The buffer is cleared.");
    // Here you can initialize your data structure
  }
  BootCountStruct *data = rtcMemory.getData();
  bootCount = data->bootCount;
  //Initialize Display and Serial
  if( bootCount == 0 ){
    display.init(115200, true);
  } else {
    display.init(115200, false);
  }
  Serial.println();
  Serial.println("Hello World!");
  Serial.println(bootCount);
  display.setRotation(0);
  display.setFullWindow();
    //Background
    display.firstPage();
    do {
      display.fillScreen(GxEPD_BLACK);
      display.drawBitmap(0, 0, Background, 200, 200, GxEPD_WHITE);
    } while (display.nextPage());
  //Server Conections
  ConnectWiFi();
  mqttClient.setServer(MQTT_SERVER, 1883);
  ConnectMqtt();

  //Read Sensor
  sensors.begin();
  sensors.requestTemperatures(); 

  //Display and Publish Data
  float sensorTemperature = sensors.getTempCByIndex(0);
  updateTemp(sensorTemperature);

  //After everything go take a nap
  GoToDeepSleep();
}

I know it is not the whole code, but I just want to know how I need to initialize the E-Paper so it knows what is already drawn(the background should already be drawn) and doesn't redraw the bitmap.
Thanks in advance!

PS: I am using a D1 Mini

Requests full update.

You can use partial update of full window by calling setPartialWindow(uint16_t x, uint16_t y, uint16_t w, uint16_t h) with full screen dimensions.
-jz-

Please do not post incomplete code!

How should I know what this does. Grrr.

But your background seems to get updated unconditionally.

Thats everything I needed Thanks!!

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