e-Ink display acting really stangely

So, i'm trying to get a 3 colour e-ink display to show some text that changes every few minutes, or when triggered. I'm using a ESP32 and the GxEPD2 library, and I can get it to display some text on boot after a long wait, but that's about it. Nothing in the main loop triggers properly, and anything following the display command in the set-up can take up to 10 minutes to trigger (if at all).

even the initial boot can take several minutes and about 30 seconds of rapid flickering to display anything.

I've been trying to wrangle this for a few days now and i'm out of ideas. I've not been able to find particularly useful docs on how the library is supposed to be implimented or anything beyond the examples, so maybe i'm just missing something obvious?

I'm working off the 'hello world' example that come swith the library,

#include <GxEPD2_BW.h>
#include <GxEPD2_3C.h>
#include <GxEPD2_4C.h>
#include <GxEPD2_7C.h>
#include <Fonts/FreeMonoBold9pt7b.h>

// select the display class and display driver class in the following file (new style):
#include "GxEPD2_display_selection_new_style.h"

// or select the display constructor line in one of the following files (old style):
#include "GxEPD2_display_selection.h"
#include "GxEPD2_display_selection_added.h"

// alternately you can copy the constructor from GxEPD2_display_selection.h or GxEPD2_display_selection_added.h to here
// e.g. for Wemos D1 mini:
//GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> display(GxEPD2_154_D67(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH0154D67

// for handling alternative SPI pins (ESP32, RP2040) see example GxEPD2_Example.ino

void setup()
{
  //display.init(115200); // default 10ms reset pulse, e.g. for bare panels with DESPI-C02
  display.init(115200, true, 2, false); // USE THIS for Waveshare boards with "clever" reset circuit, 2ms reset pulse
  helloWorld();
  // display.hibernate();
}

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

void helloWorld()
{
  display.setRotation(1);
  display.setFont(&FreeMonoBold9pt7b);
  display.setTextColor(GxEPD_BLACK);
  int16_t tbx, tby; uint16_t tbw, tbh;
  display.getTextBounds(HelloWorld, 0, 0, &tbx, &tby, &tbw, &tbh);
  // center the bounding box by transposition of the origin:
  uint16_t x = ((display.width() - tbw) / 2) - tbx;
  uint16_t y = ((display.height() - tbh) / 2) - tby;
  display.setFullWindow();
  display.firstPage();
  do
  {
    display.fillScreen(GxEPD_WHITE);
    display.setCursor(x, y);
    display.print(HelloWorld);
  }
  while (display.nextPage());
}

void loop() {
  display.print("PING!");

};

and it's all wired up like this:

If you don't tell the screen that you will print something, it won't print. You have to send a command for the display to begin receiving data, then refresh after the data is sent. Change your loop for something like:

void loop() {
  if (put your trigger here) {
    do {
      display.fillScreen(GxEPD_WHITE);//erase screen
      display.setCursor(x, y);
      display.print("PING!");
    } while (display.nextPage());
  }
};
1 Like

Ah! yes, that makes sense. I just tried that and there was a 5 minute wait bewteen the inital textblock being displayed (in the setup function) and the first block from the main loop, and it also involved 30 seconds of the whole display flashing black and white rapidly. I've not worked with an ESP32 or e-ink bofore, but I assume that's not normal? i've not seen that happen in any of the example videos.

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