Waveshare e-paper displays with SPI

"Beratungsresistent". I can't help users that are resistant to advice.
You might take a look at header files. They contain some comments. Might be insufficient for you.

@ZinggJM I'll admit that I'm fairly new to the Arduino platform, but where do you read out the 'board information' (e.g. the value that you compare to the ESP32 / ESP8266 etc if statements)? I'd be curious to see what my board actually reports back there.

@madewhatnow, Hi,

I once asked in a topic for this information. There is a rule for ARDUINO_ARCH_xxx, based on the directory the platform is in. And some other rules, I forgot about. Maybe I find and add the topic link later.

But in practice I use brute force: I enable verbose for compilation in preferences, and then look at the compilation output.

Jean-Marc

There was a recent request for Arduino to provide documentation about this sort of thing. I shared my current thoughts on the matter along with some links to related resources and requests in a reply there:

Thanks to both of you!

Hello, anybody has a way how to make custom fonts including special characters like "ěščřžýáí" that could be used in Adafruit GFX library and thus used with those E-ink displays?

I found multiple font generators but they work only with standard ASCII. Like this tutorial

or this simple online generator
https://rop.nl/truetype2gfx/

They work fine but I couldn't find something similar where I can export those special characters.
Thanks

The Waveshare board 2.9" b/w will not be supported by GxEPD2.

The panel used doesn't seem to have the waveform for differential update in OTP, which is different compared to the corresponding panel from Good Display.

I can't verify this, as I don't have the actual Waveshare board, and Waveshare didn't answer my question for a free sample.

I am considering to close this topic. Please use Good Dispay ePaper for Arduino - #499 by ZinggJM instead.

Jean-Marc

Urgent important addition: I have to apologize to Waveshare Sales Team

I got an answer from Waveshare Sales Team, but I did not notice. My Outlook mail system malfunctioned. It didn't show that the Spam folder was not empty. Once clicked on the Spam folder, the answer was there, together with 14 more mails from the Arduino Forum.

The same happened again just now: after clicking the Spam folder, I saw the notice for the post following this post.

They offer me a free sample with my next order. Many thanks!

This seems difficult times for me, so please be patient with me!

Jean-Marc

I have a question about waveshare 7.5 inch(b) HD e-paper, if I use the official example provided in the link the black color is extremely pale (and redish). Therefore I tried using GxEPD2 to test if it works better. I ran the minimum example and the only thing I changed was setting the text color to white and the background to black (fillScreen(GxEPD_BLACK)), but now I get red background instead of black. This is the constructor I used
GxEPD2_3C < GxEPD2_750c_Z90, GxEPD2_750c_Z90::HEIGHT / 4 > display(GxEPD2_750c_Z90(/*CS=D8*/ 5, /*DC=D3*/ 17, /*RST=D4*/ 16, /*BUSY=D2*/ 4)); // GDEH075Z90 880x528
, wiring should be correct but I will provide pictures if somebody wants to double check. I tried writting my own library as well, but again I get red color instead of black.

@arduinomegalul

I took notice of your post. I will check and answer later.

Jean-Marc

@ZinggJM
Thank you, appreciate it. BTW i forgot to mention before, the board used is ESP 32

@arduinomegalul, Hi,

thank you for the links, picture and information.

I don't see clearly enough the position of the RESE switch. It should be on the 3 ohms position according to the reference circuit on the panel specs from Good Display.

I assume the Waveshare HAT has level converters and a LDO for 3.3V. Is your VCC line on a 5V pin? The panel of this size needs stable and strong enough 3.3V supply to work ok.
You may need the shortened reset pulse for the "clever" reset circuit, see README.md.
I am sure my panel works ok with GxEPD2. But I can re-test if your issue persists.

Jean-Marc

Added: if you connect VCC to 5V, you should add a series resistor e.g. 4k7 to the BUSY line, to protect the ESP32.

Thank you for the quick response, I tried swapping the display config on the HAT (I'm not sure if that is the RESE switch I assume it is) and now everything works perfectly, I was sure it needs to be on option B since I have a 7.5 inch display. I will provide a picture of the switch in case someone runs to the same problem. Thank you once again.

Yes, this 7.5" e-paper display is different, because of the controller it uses. Thanks for the feedback.

Hello,
I have the following 7.5inch BW Waveshare e-Paper Display together with the Waveshare Driver Board ESP8266:

I have 2 problems (GxEPD2 library):

  • When I draw a fullscreen picture 800x480 with "display.drawBitmap", the picture on the display has an x offset (round about 100 pixels). This means that the image is shifted to the right. The cropped, right edge of the screen is then visible on the left.

  • When I try an partial update with "display.setPartialWindow", then the following "display.firstPage()" command will refresh the whole display and not only the defined box window. Also, the text I want to display is cut off and moved to the top inside the box window.

Attached my example code. Can anyone help me? Thank you in advance.

// Base class GxEPD2_GFX can be used to pass references or pointers to the display instance as parameter, uses ~1.2k more code.
// Enable or disable GxEPD2_GFX base class:
#define ENABLE_GxEPD2_GFX 0

// Include libraries:
#include <GxEPD2_BW.h>  // Include GxEPD2 library for black and white displays
#include <Adafruit_GFX.h>  // Include Adafruit_GFX library

// Arduino:
#if defined(__AVR)
#if defined (ARDUINO_AVR_MEGA2560)
#define MAX_DISPLAY_BUFFER_SIZE 5000 // e.g. full height for 200x200
#else
#define MAX_DISPLAY_BUFFER_SIZE 800
#endif
#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8))
#endif

// ESP8266:
#if defined (ESP8266)
// ***** for mapping of Waveshare e-Paper ESP8266 Driver Board *****
// Select one , can use full buffer size (full HEIGHT)
// Can use only half buffer size
GxEPD2_BW < GxEPD2_750_T7, GxEPD2_750_T7::HEIGHT / 2 > display(GxEPD2_750_T7(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW075T7 800x480
#endif


// Include fonts
#include "FreeSansBold50pt7b.h"

// Include images:
// We can show images using bitmaps, which usually we store in seperate files
// inside the sketch folder. Those "*.h" files contain the image data.
// We need to include them here to be able to use them.
#include "hintergrund.h"

//Test variable
String PVPower = "800";


void setup()  // Start of setup
{
  
  display.init(115200);  // Initiate the display
  display.setRotation(0);  // Set orientation. Goes from 0, 1, 2 or 3
  
  display.setTextWrap(false);  // By default, long lines of text are set to automatically “wrap” back to the leftmost column.
                               // To override this behavior (so text will run off the right side of the display - useful for
                               // scrolling marquee effects), use setTextWrap(false). The normal wrapping behavior is restored
                               // with setTextWrap(true).
                               
  display.setFullWindow();  // Set full window mode, meaning is going to update the entire screen
  display.firstPage();  // Tell the graphics class to use paged drawing mode

  // Set Background picture
    
  do
  { 
    display.fillScreen(GxEPD_WHITE);
    // Format: (POSITION_X, POSITION_Y, IMAGE_NAME, IMAGE_WIDTH, IMAGE_HEIGHT, COLOR)
    display.drawBitmap(0,0, gImage_hintergrund, 800,480, GxEPD_BLACK);
    
    display.setTextColor(GxEPD_BLACK);  // Set color for text
    display.setFont(&FreeSansBold50pt7b);  // Set font
    display.setCursor(485, 123);  // Set the position to start printing text (x,y)
    display.print("  ?");  // Print unknown value

    display.setCursor(485, 277);
    display.print("  ?");

    display.setCursor(515, 422);
    display.print(" ?");

  }
  while (display.nextPage());

}  // End of setup



void loop()
{
  showPartialUpdate();
  delay (5000);
}


void showPartialUpdate()
{
  uint16_t box_x = 240;
  uint16_t box_y = 200;
  uint16_t box_w = 180;
  uint16_t box_h = 80;
  uint16_t cursor_y = box_y + 16;
  
  display.setRotation(0);
  display.setFont(&FreeSansBold50pt7b);  // Set font
  display.setTextColor(GxEPD_BLACK);  // Set color for text
  display.setPartialWindow(box_x, box_y, box_w, box_h);
  display.firstPage();
  do
  { 
    display.fillScreen(GxEPD_WHITE);
    //display.fillRect(box_x, box_y, box_w, box_h, GxEPD_WHITE);
    display.setCursor(box_x, cursor_y);
    display.print(PVPower);
    delay(50);
  }
  while (display.nextPage());
}

I don't believe you. display.firstPage()doesn't do any refresh.

Please report the inking on the flex connector. Then I can compare with the panel I have.

Please report the diagnostic output from the Serial Monitor in a code window.

Please check the voltage on the 3.3V pin of the driver board. Maybe try with a strong supply, e.g. USB 3 or phone power supply.

Check the display with the Waveshare library or demo code.

Version 1.3.5 of library GxEPD2 is available, install or update with Library Manager.

  • added support for GDEM0213B74 122x250 b/w e-paper panel
  • added support for ED078KC2, 7.8" grey levels, 1872x1404, on Waveshare e-Paper IT8951 Driver HAT

Support for GDEM0213B74 is thanks to a free sample I got from Good Display.

Support for ED078KC2 is thanks to the donation from @Fabian1248.

Jean-Marc

Thank you for fast reply!

I don't believe you. display.firstPage() doesn't do any refresh.

The solution was to insert a "delay (5000)" after the first "display.nextPage()" in the "void (setup)" section. With this delay, calling "display.firstPage()" again after a "display.setPartialWindow" command will no longer result in a complete display refresh.

Please report the inking on the flex connector. Then I can compare with the panel I have.

The code on the flex connector: WFT0583CZ61. There is also a sticker "V2" on the back side of the display. I'm afraid my display is currently not supportet by the GxEPD2 library. The only setting, that seems partly work, is the following entry:

GxEPD2_BW < GxEPD2_750_T7, GxEPD2_750_T7::HEIGHT / 2 > display(GxEPD2_750_T7(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW075T7 800x480

But this 4 grayscal display GDEW075T7 is not my BW display 800x480. Maybe this is also the reason for the problems I have (shifted image with "display.drawBitmap" command).

Please check the voltage on the 3.3V pin of the driver board.

3,34V

Maybe try with a strong supply, e.g. USB 3 or phone power supply.

No difference

Check the display with the Waveshare library or demo code.

The Waveshare demo code is also not working (Loader.ino, "PriceTag-Demo": Upload image via web interface). I selected the "7.5 V2" display, but all other options (e.g. 7.5, 7.5b V2 etc.) also do not work. Serial Monitor output:

13:00:58.498 -> Connected to HomeNet
13:00:58.973 -> .......
13:01:02.732 -> IP address: 192.168.1.123
13:01:02.732 -> MDNS responder started
13:01:02.732 -> HTTP server started
13:03:55.904 -> EPD 7.5 inch V2
13:03:56.420 -> 
13:03:56.420 -> e-Paper busy
13:03:59.269 -> 
13:03:59.269 -> --------------- CUT HERE FOR EXCEPTION DECODER ---------------
13:03:59.269 -> 
13:03:59.269 -> Soft WDT reset
13:03:59.269 -> 
13:03:59.269 -> >>>stack>>>
13:03:59.269 -> 
13:03:59.269 -> ctx: cont
13:03:59.269 -> sp: 3ffffcd0 end: 3fffffc0 offset: 01a0
13:03:59.315 -> 3ffffe70:  4020beac 00000000 00000004 40100508  
13:03:59.315 -> 3ffffe80:  3fffdad0 3fff2cf4 00000071 40201664  
13:03:59.315 -> 3ffffe90:  3fffdad0 3fff2cf4 00000071 40201694  
13:03:59.315 -> 3ffffea0:  4020e7a1 00000064 3fff2d9c 402016d7  
13:03:59.315 -> 3ffffeb0:  00000000 3fff2cf4 3ffe85d0 40202300  
13:03:59.315 -> 3ffffec0:  3fff2c30 3fff4550 00000000 40203870  
13:03:59.315 -> 3ffffed0:  3fffdad0 00000006 3fff2be8 402058c2  
13:03:59.315 -> 3ffffee0:  3fffdad0 00000001 3fff450c 402106fe  
13:03:59.315 -> 3ffffef0:  00000000 00000000 00000000 401000ed  
13:03:59.315 -> 3fffff00:  00000000 00000000 3fff2e00 402038ed  
13:03:59.362 -> 3fffff10:  00000000 3fff2c30 3fff2be8 40205a38  
13:03:59.362 -> 3fffff20:  007a1200 00000000 00000000 69746365  
13:03:59.362 -> 3fffff30:  00000000 00000000 00000001 401003dc  
13:03:59.362 -> 3fffff40:  00000000 00000000 00000000 00000003  
13:03:59.362 -> 3fffff50:  3fffdad0 3fff2c0c 3fff2be8 3fff2e7c  
13:03:59.362 -> 3fffff60:  3fffdad0 3fff2c0c 3fff2be8 402060ca  
13:03:59.362 -> 3fffff70:  00000000 00000000 00001388 402106f4  
13:03:59.362 -> 3fffff80:  00000000 00000000 00000001 401003dc  
13:03:59.362 -> 3fffff90:  3fffdad0 00000000 3fff2e68 4020618c  
13:03:59.362 -> 3fffffa0:  3fffdad0 00000000 3fff2e68 4020e204  
13:03:59.409 -> 3fffffb0:  feefeffe feefeffe 3ffe8ca4 40100361  
13:03:59.409 -> <<<stack<<<
13:03:59.409 -> 
13:03:59.409 -> --------------- CUT HERE FOR EXCEPTION DECODER ---------------
13:03:59.409 -> 
13:03:59.409 ->  ets Jan  8 2013,rst cause:2, boot mode:(3,6)
13:03:59.409 -> 
13:03:59.409 -> load 0x4010f000, len 3460, room 16 
13:03:59.409 -> tail 4
13:03:59.409 -> chksum 0xcc
13:03:59.409 -> load 0x3fff20b8, len 40, room 4 
13:03:59.409 -> tail 4
13:03:59.409 -> chksum 0xc9
13:03:59.409 -> csum 0xc9
13:03:59.409 -> v00056660
13:03:59.409 -> ~ld
13:03:59.503 -> 
13:03:59.503 -> 
13:03:59.503 -> Connected to HomeNet
13:03:59.972 -> .......
13:04:03.721 -> IP address: 192.168.1.123
13:04:03.721 -> MDNS responder started
13:04:03.721 -> HTTP server started

This means your BUSY line doesn't work correctly.

My display has the same inking.

If you don't want to show diagnostic output from GxEPD2, I can't help.

Check if Waveshare has changed the wiring of the ESP8266 driver board.

// mapping of Waveshare e-Paper ESP8266 Driver Board, new version
// BUSY -> GPIO5, RST -> GPIO2, DC -> GPIO4, CS -> GPIO15, CLK -> GPIO14, DIN -> GPIO13, GND -> GND, 3.3V -> 3.3V
// NOTE for ESP8266: using SS (GPIO15) for CS may cause boot mode problems, add a 3.3k pull-down in case
//      the e-Paper ESP8266 Driver Board should have no boot mode issue, as it doesn't use level converters

// mapping of Waveshare e-Paper ESP8266 Driver Board, old version
// BUSY -> GPIO16, RST -> GPIO5, DC -> GPIO4, CS -> GPIO15, CLK -> GPIO14, DIN -> GPIO13, GND -> GND, 3.3V -> 3.3V
// NOTE for ESP8266: using SS (GPIO15) for CS may cause boot mode problems, add a 3.3k pull-down in case
//      the e-Paper ESP8266 Driver Board should have no boot mode issue, as it doesn't use level converters

My Setup:

Setup

Another problem with Partial Update on this display. The old content is still visible, even I use "display.fillScreen(GxEPD_WHITE);" or/and "display.fillRect" in the Partial Update section:

Old Content

My problem with the moved text inside the partial update window was solved by changing the cursor_y offset, because I use an huge font (FreeSansBold50pt7b).

The problem with the shifted image is not a problem anymore. I have created the background image so that the shift is compensated. I then draw the additional frame in the void setup() section (dashedRect function).

My display has the same inking.

In this case, what is the correct entry for "GxEPD2_BW" with the Waveshare Driver Board? GDEW075T7 800x480 --> GxEPD2_BW < GxEPD2_750_T7 is the only one that works, but is this correct?

Check if Waveshare has changed the wiring of the ESP8266 driver board.

OK, I will check. But if it's currently wrong, shouldn't anything work?
Edit:
I have checked the wiring. It seems that I have the old version. It does not work with the settings of the new version. My current display definitions:

// Enable or disable GxEPD2_GFX base class:
#define ENABLE_GxEPD2_GFX 0

// Include libraries:
#include <GxEPD2_BW.h>  // Include GxEPD2 library for black and white displays
#include <Adafruit_GFX.h>  // Include Adafruit_GFX library

// select the display class (only one), matching the kind of display panel
#define GxEPD2_DISPLAY_CLASS GxEPD2_BW

// select the display driver class (only one) for your  panel
//#define GxEPD2_DRIVER_CLASS GxEPD2_750     // GDEW075T8   640x384, UC8179 (IL0371)
#define GxEPD2_DRIVER_CLASS GxEPD2_750_T7  // GDEW075T7   800x480, GD7965

// SS is usually used for CS. define here for easy change
#ifndef EPD_CS
#define EPD_CS SS
#endif

#if defined(GxEPD2_DISPLAY_CLASS) && defined(GxEPD2_DRIVER_CLASS)

// somehow there should be an easier way to do this
#define GxEPD2_BW_IS_GxEPD2_BW true
#define IS_GxEPD(c, x) (c##x)
#define IS_GxEPD2_BW(x) IS_GxEPD(GxEPD2_BW_IS_, x)

#include "GxEPD2_selection_check.h"

#if defined (ESP8266)
#define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use
#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS)
#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8))
#endif
// adapt the constructor parameters to your wiring
// mapping of Waveshare e-Paper ESP8266 Driver Board, new version
//GxEPD2_DISPLAY_CLASS<GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS)> display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5));
// mapping of Waveshare e-Paper ESP8266 Driver Board, old version
GxEPD2_DISPLAY_CLASS<GxEPD2_DRIVER_CLASS, MAX_HEIGHT(GxEPD2_DRIVER_CLASS)> display(GxEPD2_DRIVER_CLASS(/*CS=15*/ EPD_CS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16));
#endif

#endif

If you don't want to show diagnostic output from GxEPD2, I can't help.

Is there an guide to do this?

The e-Paper Display technology seems to have some limitations. When I do 3 Partial Updates on an black screen there are a lot of disturbing vertical lines:

Vertical lines

Thank you very much for your support!