Waveshare e-paper displays with SPI

Hi Jean-Marc

I have a question regarding lager displays. In short:
Is there a display that is larger than 7.5inch and it is compatible with an ESP32?

I checked some displays:

Waveshare 12.48inch, black white 1304×984
This display would be nice and it seems, it is also supported by your library. But how can i use this display without using this large blue board where my Lolin D32 will not fit. Yes, i can probably use some jumper-cables.

Good Display also has an Adapter for this display, but it seems it is not compatible with ESP32 at the moment. I asked Good Display about this, but waiting for an answer.

Waveshare 10.3inch, black white 1872×1404
This display has an SPI Interface but the operating voltage is 5V. Would it be potentially compatible with an ESP32? Do we need to use this IT8951 Controller?

Waveshare 9.7inch, black-white 1200x825
This display has an SPI Interface but the operating voltage is 5V. Would it be potentially compatible with an ESP32? Do we need to use this IT8951 Controller?

I would happy to sponsor one or two displays to get this work with GxEPD2 but it seems, it is not an easy task for the ESP32.

Maybe also other people of this community have experience with larger displays. Would be cool to get some tipps.
Thank you.

Lukas

Hi Lukas,

Waveshare 12.48inch, black white 1304×984
This display would be nice and it seems, it is also supported by your library. But how can i use this display without using this large blue board where my Lolin D32 will not fit. Yes, i can probably use some jumper-cables.

Yes, the b/w version is supported by GxEPD2. I don't know what you mean by the "large blue board".
The ESP32 socket is for a e-Paper ESP32 Driver Board. The Lolin D32 has a different pinout.
I have some ESP32 boards with matching pinout, one is marked "ESP-32S" on the backside. I think these are known as ESP32 DevKit.
There is a connector and cable for connection of any processor board with SPI. I think it is on the 5V side of the level converters, but should also work with 3.3V processors. Use a voltage divider on the BUSY line, or at least a series resistor.
See also: Black and White ePaper,Monochrome E Ink_Good Display
Note that this panel is End Of Life.
You could use the bare panel with this Connection board adapter HAT connect for 12.48 inch e-ink display module DESPI-C1248 (hard to find, is on their older web-site).
Can also be found here: Demo Kit.

Waveshare 10.3inch, black white 1872×1404
This display has an SPI Interface but the operating voltage is 5V. Would it be potentially compatible with an ESP32? Do we need to use this IT8951 Controller?

Yes, you need the IT8951 controller board, and it needs to be the (parameterized) version for that display. The panel has parallel interface. Support could be added to GxEPD2, if I have the panel with controller.

Waveshare 9.7inch, black-white 1200x825
This display has an SPI Interface but the operating voltage is 5V. Would it be potentially compatible with an ESP32? Do we need to use this IT8951 Controller?

Yes, same answer.

Did you notice this large size 11.6 inch epaper screen module SPI resolution 960x640, GDEH116T91?

Jean-Marc

Hi Jean-Marc

Thank you for your answers. I probably order the 12.48 and see if i can get this to work.

Thanks also for 11.6inch paper. I was not aware of this. They even have one with red color. At the moment it is not supported by GxEPD2. Could you do this, if you have the display sponsored? And it will be compatible with the DESPI-CO2, right?

Have a nice Sunday!

Lukas

Hi Lukas

Yes, I could add support to GxEPD2; Good Display provides demo source for it.
And yes, it can be used with DESPI-C02, this is used with the evaluation boards of Good Display.
You can check by taking a look at the reference circuit on page 10 of the GDEH116Z91-210119.pdf specs.
The component values are slightly different, typical for the SSD e-paper controllers. RESE should be 2 ohms, will work with the 3 ohms position most likely.

Jean-Marc

Hi Jean-Marc

I have now ordered this Display twice and i will forward one display to you as soon as i will get it. Looking forward.

Lukas

Hi Jean-Marc,

I have a problem using your GxEPD2 library to position a character using a font u8g2_font_logisoso92_tn from the u8g2 library. It can be any font, but I want to use the largest. I'm testing the example on ESP32 (PlatformIO, EPD Waveshare 2.9").

The library works fine except for that one thing. I would like to display the time in HH: MM format. For this, I need a method to determine the size of a single character in order to position it on the display.

I am using the example "GxEPD2_U8G2_Fonts_Example". However, after setting the font:

u8g2Fonts.setFont(u8g2_font_logisoso92_tn);

the getTextBounds method of the GxEPD2_BW class for a single character returns unexpected / incorrect results, namely: width = 6, height = 8. I get the same result when calling:

u8g2Fonts.u8g2.gfx-> getTextBounds (...)

I also checked:

u8g2Fonts.u8g2.font_info.max_char_width
u8g2Fonts.u8g2.font_info.max_char_height

however, these are the maximum and minimum font sizes, which are not useful to me because I want to know the actual ones character sizes, e.g. a colon to center it.

How to measure text boundaries / size using fonts from u8g2 library?

Your example doesn't have this information - and I don't know if it's impossible with u8g2 fonts or am I missing something?

Marius

Hi Marius,

thank you for this interesting question.

For now I can't answer with anything more meaningful; I have to check and investigate this myself.
I hope I can provide an answer in the next few days.

But maybe someone else has tried this and has a solution?

Jean-Marc

I found:

    int16_t getUTF8Width(const char *str);

in U8g2_for_Adafruit_GFX.h

I will check this.

@mariusmys

getTextBounds(...) is a method of Adafruit_GFX. See Adafruit_GFX.h.

It returns the bounding box the text would take if you use display.print(...).

If you use u8g2Fonts.print(...) you need to use U8G2_FOR_ADAFRUIT_GFX methods to get the bounding box.

See this example:

const char HelloWorld[] = "Hello World!";
const char HelloArduino[] = "Hello Arduino!";
const char HelloEpaper[] = "Hello E-Paper!";

void helloWorld()
{
  //Serial.println("helloWorld");
  uint16_t bg = GxEPD_WHITE;
  uint16_t fg = GxEPD_BLACK;
  u8g2Fonts.setFontMode(1);                 // use u8g2 transparent mode (this is default)
  u8g2Fonts.setFontDirection(0);            // left to right (this is default)
  u8g2Fonts.setForegroundColor(fg);         // apply Adafruit GFX color
  u8g2Fonts.setBackgroundColor(bg);         // apply Adafruit GFX color
  u8g2Fonts.setFont(u8g2_font_helvR14_tf);  // select u8g2 font from here: https://github.com/olikraus/u8g2/wiki/fntlistall
  int16_t tw = u8g2Fonts.getUTF8Width(HelloWorld); // text box width
  int16_t ta = u8g2Fonts.getFontAscent(); // positive
  int16_t td = u8g2Fonts.getFontDescent(); // negative; in mathematicians view
  int16_t th = ta - td; // text box height
  //Serial.print("ascent, descent ("); Serial.print(u8g2Fonts.getFontAscent()); Serial.print(", "); Serial.print(u8g2Fonts.getFontDescent()); Serial.println(")");
  // center bounding box by transposition of origin:
  // y is base line for u8g2Fonts, like for Adafruit_GFX True Type fonts
  uint16_t x = (display.width() - tw) / 2;
  uint16_t y = (display.height() - th) / 2 + ta;
  //Serial.print("bounding box    ("); Serial.print(x); Serial.print(", "); Serial.print(y); Serial.print(", "); Serial.print(tw); Serial.print(", "); Serial.print(th); Serial.println(")");
  display.firstPage();
  do
  {
    display.fillScreen(bg);
    u8g2Fonts.setCursor(x, y); // start writing at this position
    u8g2Fonts.print(HelloWorld);
  }
  while (display.nextPage());
  //Serial.println("helloWorld done");
}

The example GxEPD2_U8G2_Fonts_Example.ino will be updated in the next release.

Thank you for getting my attention to this missing information.

Jean-Marc

Hi Jean Marc,

Your example works as expected.

In fact, during the analysis, I found the getUTF8Width() function, but at first (by the name) I recognized that it is used to handle strings, but not to measure the width of a string in pixels, it only returns the string length expressed as the number of characters in the string. Especially "UTF8" confused me.

Thanks for your quick reply and tips.

Marius

Hello,
I am looking for advice on a current project. I am trying to replicate James Bruton E-paper message board display. I tried using the pi as he has done but I ran into a lot of problems with python. I also wanted to go with something that I could run off batteries so I am trying to use the ESP8266 board and display on a 7.5” display. If someone one could help me with the project as a whole that would be amazing but even right now I am struggling just to run the demo code. I get the IP address on the serial monitor but when I try to log in I just get the message that the site can’t be reached and yes I am the same wifi network.

Kyle

@kds00, Hi Kyle,

if your goal is to get people watch that lengthy advertising video, you did a great job, but I don't like this.

If you want help with code, post that code.

If you have problems with an example, cite the example.

Jean-Marc

I don't know why you feel the need to be so rude but whatever. I guess I will continue to struggle with this project and never come back to ask here for help. I hope you feel good about yourself.

hello,

Just to share that i experienced issue with exemple code GxEPD2_HelloWord (and others exemple codes too):

  • ESP8266 12-F (from Az-delivery)
  • e-Paper HAT: rev2.1
  • waveshare 7.5 v2 (800x480)
  • library GxEPD2: v 1.3.0 (exemple used : GxEPD2_HelloWord)

thanks to the forum (special thx to Jean-Marc), i changed init() to set to 2ms and works fine now

 void setup()
{
  //display.init();
  display.init(115200, true, 2, false);
  helloWorld();
  display.hibernate();
}

Hi Jean-Marc,

I want to use a waveshare ePaper display (GDEH029A1) with your GxEPD2 library and the Adafruit micro SD-breakout board http://https://www.adafruit.com/product/254 with the following library and a DS3231 (http://https://github.com/adafruit/RTClib). Via rotary encoder the timespan between the savings can be adjusted. The readings are from a BME 280.

The program should update the display every 5 seconds while logging the data to the micro-SD card. Everything works fine a few times, but nevertheless that I do, after a while it jumps into my code "error writing datalog.txt". It´s not stable and it should be stable and reliable. I use an Arduino Mega.

My code is attached. Are the librarys not compatible or is there a better way to initialize the display other than do...while. I tried a lot and nothing worked properly, do you have any suggestions?

Thank you!!

ePaper_SD_problem.ino (9.75 KB)

Hi flori_2121,

If you have problems with an e-paper display and want help, I need complete information.
Please provide clickable links to the e-paper panel or module you have, and to the connection module if separate.
And how you handle level conversion from the Arduino Mega.

Did you test and make sure that the display examples work, e.g. GxEPD2_Example.ino?

Did you make sure your program works correctly without the e-paper display?
Your previous posts leave some doubts on this.

After you have answered these questions I may take the time to have a look at your code.
BTW: if the code is short enough, you have a better chance that it gets looked at, if you post it directly in a code window.

Jean-Marc

Hi Jean-Marc,

I am using this display: http://https://eckstein-shop.de/Waveshare-29-inch-296x128-E-Ink-E-Paper-Display-Modul-SPI-fuer-Raspberry-Pi-Arduino?gclid=Cj0KCQiA7YyCBhD_ARIsALkj54rGvPhZ4Z0qwyjJilN476GHnuRUgjE_mKbU8Y-t4KXrsX1Xf6NDl_MaAv0JEALw_wcB

I already got some sketches to work and my program which I attached runs for a short time and then jumps to the mode where no data is recorded.
But it works for a short time and then not anymore, this is wondering me a lot.
So my question is if there is experience if the GXEPD2 is compatible with the library SD.h. My program runs everything correctly for a short time and then not anymore.
Both devices run over the SPI bus, but do not share a CS pin.

As a stand alone both devices work great, in the combination they run only for a short period and then no more data is stored on the SD card, the display is still actualizing. This is my problem, maybe there are experiences or you see what I can do differently in my sketch.... My guess is that the problem is somehow related to the command "display.print(uhrzeit)", but I can´t understand why it should be really the problem.

void Display_1() {



  display.setPartialWindow(0, 0, display.width(), display.height());
  display.firstPage();

  do {

    display.fillScreen(GxEPD_WHITE);
    display.setCursor(150, 20);
    display.print(Speicherzeit);
    display.setCursor(0, 60);
    display.print(F("Uhrzeit"));
    display.setCursor(0, 80);
    display.print(F("Temperatur:"));
    display.setCursor(0, 100);
    display.print(F("Luftdruck:"));
    display.setCursor(0, 120);
    display.print(F("Luftfeuchte:"));
    display.setCursor(140, 60);
    display.print(uhrzeit);
    display.setCursor(140, 80);
    display.print(temp);
    display.setCursor(140, 100);
    display.print(pressure);
    display.setCursor(140, 120);
    display.print(humidity);

    // °-Zeichen selbst erstellt, da nicht in ASCII-Code
    display.fillCircle(252, 70, 2, GxEPD_BLACK);  //Xpos,Ypos,r,Farbe
    display.fillCircle(252, 70, 1, GxEPD_WHITE);  //Xpos,Ypos,r,Farbe
    display.setCursor(255, 80);
    display.print(F("C"));
    display.setCursor(250, 100);
    display.print(F("hPa"));
    // %-Zeichen schön erstellen
    display.setCursor(252, 120);
    display.print(F("/"));
    display.fillCircle(253, 110, 2, GxEPD_BLACK);  //Xpos,Ypos,r,Farbe
    display.fillCircle(253, 110, 1, GxEPD_WHITE);  //Xpos,Ypos,r,Farbe
    display.fillCircle(261, 120, 2, GxEPD_BLACK);  //Xpos,Ypos,r,Farbe
    display.fillCircle(261, 120, 1, GxEPD_WHITE);  //Xpos,Ypos,r,Farbe

    display.setCursor(0, 40);
    display.print(F("Datenerfassung: aktiv"));

  }

  while (display.nextPage());
}

Is there a way how I address my display without the do... while expression like I do it now, namely that it "refreshes" the content for the viewer without flickering once like it did at the beginning with display.init like this

P.S.: I would have liked it in the forum as code, unfortunately it is too big (number of characters is limited).

@flori_2121,

you need to provide a complete schematic of your wiring. With all your devices.
It looks like you may have multiple conflicts.

From C:\Users\xxx\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.3\variants\mega\pins_arduino.h:

#define PIN_SPI_SS    (53)
#define PIN_SPI_MOSI  (51)
#define PIN_SPI_MISO  (50)
#define PIN_SPI_SCK   (52)

static const uint8_t SS   = PIN_SPI_SS;
static const uint8_t MOSI = PIN_SPI_MOSI;
static const uint8_t MISO = PIN_SPI_MISO;
static const uint8_t SCK  = PIN_SPI_SCK;

You use SS for e-paper and 53 for SD.

If you use c-style strings and string formatting and copying, you should use the length checked functions.

You can do without paged drawing with your small e-paper on Arduino MEGA. But this is not related to full refresh or differential refresh.

Jean-Marc

I would suggest you modify your code so that you can enable/disable each HW component individually.
Then you can verify for each component if it works separately, and which combinations fail.
Make extensive use of diagnostic output to Serial Monitor, to see what happens.

Your post is a cross-post from this post: Re: Neuling: Sandwich-Aufbau mit Sensoren.
You need at least cross-link your posts, so responders to your posts are aware of this.

Hi Jean-Marc,

thank you for your answer.
My actual wiring looks like this:
DS3231 (I2C) & BME280 (I2C):
SDA -> 20
SCL -> 21

microSD (SPI): ePaper:
CD -> 2 BUSY -> 7
CS -> 53 RST -> 9
DI -> 51 DC -> 8
DO -> 50 CS -> 10
CLK -> 52 CLK -> 52
DIN -> 51

You use SS for e-paper and 53 for SD.

Do you mean I have to switch the SS (CS) of the eInk to 53 for the hardware SPI and the CS of the microSD to 10 and than it works? I thought different devices just need another SS pin and it doesn't matter which one, or is the display SS-Pin fixed to 53 because of HW SPI?

And do I have to define the Pins like you did here:

#define PIN_SPI_SS    (53)
#define PIN_SPI_MOSI  (51)
#define PIN_SPI_MISO  (50)
#define PIN_SPI_SCK   (52)

You can do without paged drawing with your small e-paper on Arduino MEGA. But this is not related to full refresh or differential refresh.

Is it than also possible to refresh the display every 5 seconds? I found the display.display update and there I have to name all my variables right? Like in the example GxEPD2_NotPagedExample....

Thanks for your help!

I asked for a schematics. I will not answer anymore, as you use cross-posting.
If you have connected the e-paper CS to 10, you just need to change the CS parameter in the constructor to 10, too.

Sorry I didn't know about the cross link.

But it seems now in the first moment as if the change of the CS pins of the devices ePaper and microSD has fixed the error.... Disaster, I have spent a very long time here but apparently it works now.
So the display is now on hardware SPI and the microSD logger selects its CS via pin 10 and it seems to work!

Thanks for the information and sorry about the cross link.