Waveshare e-paper displays with SPI

I’m using the first example code of the library, that is “GxEPD2_Example”. Just like @vanilla_chief I replaced the init code with “init(115200, true, 2, false)”. I uncommented the line for GxEPD2_290_T94 in the display selection header.
The IDE reports a program memory usage of 65% and a dynamic memory usage of 78%, and warns me about low ram.

Including GFX_Root reduces memory to 58% and 71% respectively. The serial output stays the same for all cases. I have another Arduino Pro Mini here and will try it with that one as well.

EDIT: It works with a generic STM32F103CB
EDIT2: Nevermind. It seems my Arduino Board was faulty. On the spare board it does work. Thank you for your time! … and sorry for wasting you time

Hello @ZinggJM !

I need help with board manager-ish/ GxEPD2 Library issue/ an explanation. I am using an ESP32 trigBoardv8 and have tried using the GxEPD2 library with the board manager, ESP32 v1.0.5 and above, with the ESP32 getting stuck in some sort of boot loop. For example the output is:

ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
ets_main.c 371
ets Jun 8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:10944
load:0x40080400,len:6388
entry 0x400806b4

To which its hung at the “?” because of an serial.print() before the initialization of the display and
should I remove the serial.print(), it then gets stuck in a boot loop and stops after a bit. Not a flicker on the display.

This is the example code I was working with (just adjusted to the trigBoard with some extra serial.prints() for troublshooting etc):

(his code is the description, it goes directly to a google doc redirect so be warned Here…)

Yet when I switch back to v1.0.4 for the ESP32 in board manager and the GxEPD2 is back to working. Why is this. I need the edits from the http redirect library as part of the v1.0.6 ESP32 in board manager as it actually lets me get to google scripts quite well-- long story short I get a text output from google scripts and want to put it on the display. Now v1.0.4 for the ESP32 in board manager was flawed and failed to handle Google’s redirects as well as giving me a plethora of unnecessary issues with the Arduino IDE, wifi.h, and wificlientsecure.h.

Any suggestions or perhaps a fix so I can get my project working as a whole. I would rather it be on the side of the GxEPD2 library if at all possible. If it has to be messing with the ESP32 code in the board manager it would be awesome for some links on what to do or a solution. I really want to know why the GxEPD2 Library is behaving this way too. As it would help me with my senior project it was an unexpected issue that I may have to explain why my project wasn’t working via the due date.

Thank you for your time
-OverThere

@thatpersonoverthere, Hi, maybe related to this issue:

The ESP32 processor hangs on a second call to Serial.begin(115200) when compiled for ESP32 Dev Module. · Issue #5043 · espressif/arduino-esp32 · GitHub

Jean-Marc

1 Like

Dang you quick @ZinggJM , Thank you! Beat me to the punch 14 days ago I see… again thank you so much. I hope it can be fixed! If its not, that’s more than enough of an explanation!!!

Edit: got rid of the serial.begin(115200); and it works now

Hello ZinggJM,

Thank you for sending me the link and details.
I’m trying to see some results in both MKRZERO and MEGA, but as result I’m getting this:
setup
Busy Timeout!
_PowerOn : 20000796
Busy Timeout!
_Update_Full : 20000640
Busy Timeout!
_PowerOff : 20000180
Busy Timeout!
_PowerOn : 20001020
Busy Timeout!
_Update_Part : 20000772
Busy Timeout!
_Update_Part : 20001076
Busy Timeout!
_Update_Part : 20000848
Busy Timeout!
_Update_Full : 20000156
Busy Timeout!
_PowerOff : 20000180
Busy Timeout!
_PowerOn : 20000392
Busy Timeout!
_Update_Part : 20000640
Busy Timeout!
_Update_Part : 20000704
Busy Timeout!
_Update_Part : 20000536
Busy Timeout!
_Update_Part : 20000628
Busy Timeout!
_Update_Part : 20000628
Busy Timeout!
_Update_Part : 20000976

Any suggestion about what it can be ?

Thank you very much once again for your time and consideration.

Best regards

Lucci

@Luthi, Hi Lucci, welcome to the forum. Please read How to get the best out of this forum.

Any suggestion about what it can be ?

Yes, there is something wrong with your wiring. Looks like your SPI communication doesn’t work.

I need complete information to be able to help. It is frustrating to have to ask back.

Please post a link to your e-paper panel or board and to the connection module (if separate).
Tell which processor you used, a link if not a common one.

Please report the wiring you used. And the constructor line you selected (old style), or the driver class definition and constructor line (new style).

Also report the example you used. Diagnostic output is preferred in a code window.

Jean-Marc

OMG !
Thank you for your feedback.

The Wiring I tried as suggested
// mapping suggestion for Arduino MKR1000 or MKRZERO
// note: can’t use SS on MKR1000: is defined as 24, should be 4
// BUSY → 5, RST → 6, DC → 7, CS-> 4, CLK → 9, DIN → 8

I’m trying to use the GxEPD2_GFX_Example, when I compile it shows me:
Atmel SMART device 0x10010005 found
Device : ATSAMD21G18A
Chip ID : 10010005
Version : v2.0 [Arduino:XYZ] Dec 20 2016 15:36:46
Address : 8192
Pages : 3968
Page Size : 64 bytes
Total Size : 248KB
Planes : 1
Lock Regions : 16
Locked : none
Security : false
Boot Flash : true
BOD : false
BOR : false
Arduino : FAST_CHIP_ERASE
Arduino : FAST_MULTI_PAGE_WRITE
Arduino : CAN_CHECKSUM_MEMORY_BUFFER
Erase flash
done in 0.814 seconds

Write 161804 bytes to flash (2529 pages)
[==============================] 100% (2529/2529 pages)
done in 0.883 seconds

Verify 161804 bytes of flash with checksum.
Verify successful
done in 0.133 seconds
CPU reset.

But after it, nothing happens

Thank you very much for your attention again.

Best regards

Lucci

Nothing in Serial Monitor?

Please read my post again and provide all information requested.

And the constructor line you selected (old style), or the driver class definition and constructor line (new style).

On the picture I see that your Waveshare board has the “clever” reset circuit. From README.md:

- note that Waveshare bords with "clever" reset circuit may need shortened reset pulse
- use `init(115200, true, 2, false)` for Waveshare boards with "clever" reset circuit

Sorry Zingg, but where in the waveshare, did you saw the reset ? The last picture is my Arduino MKRZero just there I have the Reset button.
In the serial port, I received the same message as I described above:
setup
Busy Timeout!
_PowerOn : 20000796
Busy Timeout!
_Update_Full : 20000640
Busy Timeout!
_PowerOff : 20000180
Busy Timeout!
_PowerOn : 20001020
Busy Timeout!
_Update_Part : 20000772
Busy Timeout!

Hallo Together,

maybe you can help me with my problem regarding the displaying of my waveshare epaper 213inc colour.

epaper: epaper 213c

connecting module: E-paper_Driver_Hat

I thinks its pretty basic but I tried for a long time now and I am not sure whats the problem.

I use an arduino micro to connect over the epaper Driver Hat to the epaper 213c.

My wiring: VCC > 3,3V, GND > GND, DIN > D11, CLK > D13, CS > D10, DC > D8, RST > D9, BUSY > D7

Also I use an simple example code (from Zingg) just to print Hello world. There is no problem with uploading it to the arduino but the display just doesnt show anything. (Also installed the libraries eg. GxEPD2, and adafruit GFX Library)

Here the code.

// GxEPD2_HelloWorld.ino by Jean-Marc Zingg
// see GxEPD2_wiring_examples.h for wiring suggestions and examples
// if you use a different wiring, you need to adapt the constructor parameters!
// uncomment next line to use class GFX of library GFX_Root instead of Adafruit_GFX
//#include <GFX.h>
#include <GxEPD2_BW.h>
#include <GxEPD2_3C.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"
#define GxEPD2_DRIVER_CLASS GxEPD2_213c
// 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
GxEPD2_3C<GxEPD2_213c, MAX_HEIGHT_3C(GxEPD2_213c)> display(GxEPD2_213c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213Z16
void setup()
{
  display.init();
  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() {};

Is there maybe a problem with the 5V output maybe on the I/O to the epaper driver hat? I thought that the module can handle it but i am not sure.

Thanks in advance!
Samuel

@stfischer, Hi Samuel, welcome to the forum!

Thank you for providing links to your devices. Makes it easier for me and for other readers.

The e-paper HAT should work fine with 5V IO signals. It has level converters.
See New Output (waveshare.com)

But the HAT also has the “clever” reset circuit, which switches off power to the the rest of the board, including level converter, and to the e-paper panel. This may be the reason for your display not working. From README.md important notes:

- note that Waveshare bords with "clever" reset circuit may need shortened reset pulse
- use `init(115200, true, 2, false)` for Waveshare boards with "clever" reset circuit

With the first parameter you also get diagnostic output to Serial. Observe it in Serial Monitor and report results (in a code window).

Please also report the inking on the flex connector of the panel. Maybe I can find out if it is a different panel.

Jean-Marc

Addition: for use with 5V processor, you should supply 5V to the VCC pin of the white connector.

Hello, I recently bought a 4,2-inch e ink display to use with an esp32. Until now I have used the original gxepd library when playing around with it however I feel like I should try to move to gxepd2 instead. However, my problem is that I don’t really understand the display.firstPage(); and display.nextPage() part of the example codes. Looking at the example code there is this part

display.init();
  // comment out next line to have no or minimal Adafruit_GFX code
  display.setTextColor(GxEPD_BLACK);
  display.firstPage();
  do
  {
    display.fillScreen(GxEPD_WHITE);
    // comment out next line to have no or minimal Adafruit_GFX code
    display.print("Hello World!");
  }
  while (display.nextPage());
}

What happens when I run the display.firstpage() command? I have tried to look it up and from my understanding, this is done due to some Arduino boards not having enough ram. But from my understanding I haven’t told the screen to write anything before calling that command so how could it save ram?

I personally seem to find the way the original gxepd handled things easier to understand with the display.eraseDisplay() and display.drawPaged commands. Since I am using an esp32 and memory shouldn’t be an issue is there a way to have the new library behave like the old without having to do all the “while do” stuff? I shouldn’t need to care about the buffer for a 400x300 4,2 inch screen when using an esp32 right?

Please start by reading the GxEPD2/README.md at master · ZinggJM/GxEPD2 · GitHub.

Then you might take a look at the example GxEPD2/GxEPD2_NotPagedExample.ino at master · ZinggJM/GxEPD2 · GitHub

I’m using ESP32 (LilyGo) with epaper display and external DAC (PCM5102A).
Display is driven by GxEPD lib, sound by ESP32-audioI2S lib.
I get no sound while calling display update.
Same time when I call display update I get text over text issue (previously displayed text is not cleared).
Anyone has same issue or/and solution for it?

Oh, that was a surprisingly fast reply, thank you! Do you think that should/need to use paged drawing on an esp32 or esp8266 or is display.display(false); enough?

Also, I saw that you were talking to someone else a few posts above about his board having a special reset circuit. I also have a 4,2-inch Waveshare screen with spi as the guy you talked with. How do I know if my screen has this special reset circuit? Will it just not work, is there a specific version of the screen or is there a specific component on the screen I should look for?

If you use the constructor with full height for page_height, the compiler will complain if it doesn’t fit in ram.

The actual version will have the “clever” reset circuit. Take a look at the schematics.

Awesome, thank you!

Hi Jean Marc, have ESP32 dev board and waveshare 1,54 200x200 epaper.
In Arduino 1.8.13 cannot compile the minimum example from your library, got these error message
C:\Users\VR\CloudStation\Arduino\libraries\Adafruit_BusIO\Adafruit_SPIDevice.cpp: In member function ‘void Adafruit_SPIDevice::transfer(uint8_t*, size_t)’:
C:\Users\VR\CloudStation\Arduino\libraries\Adafruit_BusIO\Adafruit_SPIDevice.cpp:133:31: error: no matching function for call to ‘SPIClass::transfer(uint8_t*&, size_t&)’
_spi->transfer(buffer, len);
^
In file included from C:\Users\VR\CloudStation\Arduino\libraries\Adafruit_BusIO/Adafruit_SPIDevice.h:1:0,
from C:\Users\VR\CloudStation\Arduino\libraries\Adafruit_BusIO\Adafruit_SPIDevice.cpp:1:
C:\Users\VR\CloudStation\Arduino\hardware\espressif\esp32\libraries\SPI\src/SPI.h:67:13: note: candidate: uint8_t SPIClass::transfer(uint8_t)
uint8_t transfer(uint8_t data);
^
C:\Users\VR\CloudStation\Arduino\hardware\espressif\esp32\libraries\SPI\src/SPI.h:67:13: note: candidate expects 1 argument, 2 provided
exit status 1
Nastala chyba při kompilaci u desky ESP32 Dev Module.

All libraries are up to date… any advice?
Thank you

@VasekR, Hi, welcome to the forum! I hope you already read How to get the best out of this forum.

All libraries are up to date… any advice?

No, not really. I avoided to update dependent libraries when updating Adafruit_GFX recently.
Maybe that is why I still can compile. Adafruit_GFX updates and dependencies are a nightmare.

Jean-Marc

Version 1.3.2 of library GxEPD2 is available, install with Library Manager.

  • added support for GDEW0213T5D 104x212 b/w e-paper panel
  • added support for GDEW029T5D 128x296 b/w e-paper panel
  • added support for GDEW0213Z19 104x212 b/w/r e-paper panel
  • added support for GDEW029Z13 128x296 b/w/r e-paper panel
  • both GDEW0213Z19 and GDEW029Z13 support only full screen refresh (controller issue)

Jean-Marc