EPAPER display Lilygo t5 slowed down

Good morning everyone, I have a problem with a lilygo t5 V.2.31 card with its epaper display.
I can't understand why, when I insert lines, even just text, into the loop, the card slows down considerably. when I go to print on the serial port, I am very slow, almost a second for each line, this is then reflected in the code that for simplicity I removed. Can anyone explain to me why without the loop part I have the printout at a few hundredths of a second and with a simple TEST writing on the loop the printout is almost a second?`

Thank you all and have a nice day.

#include <Arduino.h>
#include <GxEPD2_BW.h>
#include <U8g2_for_Adafruit_GFX.h>

#define SCREEN_WIDTH 122
#define SCREEN_HEIGHT 250
GxEPD2_BW<GxEPD2_213_BN, GxEPD2_213_BN::HEIGHT> display(GxEPD2_213_BN(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // DEPG0213BN 122x250, SSD1680, TTGO T5 V2.4.1, V2.3.1


U8G2_FOR_ADAFRUIT_GFX u8g2Fonts;


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

  display.init();
  display.setTextColor(GxEPD_BLACK);
  display.firstPage();
  display.setRotation(3);

  u8g2Fonts.begin(display);

  uint16_t bg = GxEPD_WHITE;
  uint16_t fg = GxEPD_BLACK;
  u8g2Fonts.setForegroundColor(fg);
  u8g2Fonts.setBackgroundColor(bg);
  do {

    display.fillScreen(GxEPD_WHITE);
    u8g2Fonts.setFont(u8g2_font_ncenB18_te);
    u8g2Fonts.setCursor(10, 40);
    u8g2Fonts.print("T:  ");
  } while (display.nextPage());
  display.hibernate();

}

void loop() {

// If I enable these lines I have a slowdown in calculations and serial output ///
  
  /*

    u8g2Fonts.setCursor(40, 40);
    // u8g2Fonts.print(altitude);
      u8g2Fonts.print("test");

     display.display(true); // partial update
  */
  Serial.println("  test  ");

}

Because all the time is spent in continuous partial refreshes of the screen (without any change of content).

Please format your code before posting. Or afterwards, to fix your post.

And it would be a good idea to enable diagnostic output. And post it with your issue.

1 Like

To elaborate slightly, you shouldn't call display.display(true) every loop. Only "every now and then", when you need to display new data.

Thank you very much, maybe I understand, I only have to write on the display when I have new data.
Now I'll try to change everything and let you know.

Thanks again !!!!!

Hi @jordi_rca , welcome to the forum!

You may have hit a real issue with the GxEPD2_213_BN.cpp driver class.

This driver class is for the SSD1680 controller, and was last updated in Version 1.5.4.
This update is known for issues with SSD controllers.
One of the known issues was not present on this panel, as I can see on the result of the last test.
But the fix for this issue, and other fixes for SSD controllers have not been applied to this class.

If you provide your test-code in an updated style, I will test your issue and hopefully provide a fix.
Make sure it is in a real code window (<code/> command symbol), not in a look alike that can't be copied.

I am constantly short on time, so I need complete information and easy reproduceable tests to analyze issues.
-jz-

    static const uint16_t partial_refresh_time = 750; // ms, e.g. 736721us

Is not much less than your second!

Verified using diagnostic output:

14:31:13.814 ->  test 
14:31:14.596 -> _Update_Part : 726000
14:31:14.596 ->  test 

-jz-

Exactly, "Update_Part: 726000" appears for me too
And here's the code.

#include <Arduino.h>
#include <Adafruit_BMP280.h>
#include <GxEPD2_BW.h>
#include <U8g2_for_Adafruit_GFX.h>


#define SCREEN_WIDTH 122
#define SCREEN_HEIGHT 250
GxEPD2_BW<GxEPD2_213_BN, GxEPD2_213_BN::HEIGHT> display(GxEPD2_213_BN(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // DEPG0213BN 122x250, SSD1680, TTGO T5 V2.4.1, V2.3.1

#define BMP_SDA 21
#define BMP_SCL 22

U8G2_FOR_ADAFRUIT_GFX u8g2Fonts;
Adafruit_BMP280 bmp; // I2C
float altitude;
float Temperature;

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

  unsigned status;
  status = bmp.begin(0x77);
  if (!status) {
    Serial.println(F("Could not find a valid BMP280 sensor, check wiring or "
                     "try a different address!"));
    while (1) delay(10);
  }

  display.init();
  display.setTextColor(GxEPD_BLACK);
  display.firstPage();
  display.setRotation(3);
  u8g2Fonts.begin(display); // connect u8g2 procedures to Adafruit GFX

  uint16_t bg = GxEPD_WHITE;
  uint16_t fg = GxEPD_BLACK;
  u8g2Fonts.setForegroundColor(fg);         // apply Adafruit GFX color
  u8g2Fonts.setBackgroundColor(bg);
  do {
    display.fillScreen(GxEPD_WHITE);

    u8g2Fonts.setFont(u8g2_font_luIS08_tf);   //font is set
    u8g2Fonts.setCursor(10, 40);
    u8g2Fonts.print("ALTITUDE");

    u8g2Fonts.setFont(u8g2_font_luIS08_tf);   //font is set
    u8g2Fonts.setCursor(10, 80);
    u8g2Fonts.print("TEMPERATURE");

  } while (display.nextPage());

  display.hibernate();



}

void loop() {
  altitude = bmp.readAltitude(1013.25);
  Temperature = bmp.readTemperature();

  u8g2Fonts.setFont(u8g2_font_luIS08_tf);   //font is set
  u8g2Fonts.setCursor(100, 40);
  u8g2Fonts.print(bmp.readAltitude(1013.25));

  u8g2Fonts.setCursor(100, 80);
  u8g2Fonts.print(bmp.readTemperature(), 1);


  display.display(true); // partial update
  display.hibernate();
  display.firstPage();



  Serial.println(bmp.readAltitude(1013.25));
  Serial.println(bmp.readTemperature(), 1);

}

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