1
votes

I am trying to connect a Waveshare e-Paper display via SPI to the ESP32 board, but I can't get it to work. I am new to the electronics aspect, so I am not sure if I am connecting the pins correctly. Waveshare provides example code for Arduino but when I flash it to my board the display does not do anything. I can see in the serial output that the sketch is flashing fine and running on the board.

I tried editing the code in the example code where the SPI.begin() happens and pass in the pins I am using (on this line).

After doing that, the code runs past the following block, so it appears the epd.init() works now.

  if (epd.Init() != 0) {
    Serial.print("e-Paper init failed");
    return;
  }

The hardware I am using:

E-Paper display: Waveshare 4.2inch E-Ink display module

Driver board: ESP32 Heltec wifi LoRa (V1)

ESP32 datasheet

If I am on a wrong path all together or if I am meant to use a different library (I came across GxEPD2, not sure if I am meant to use that one instead?), please feel free to correct me and point me in the right direction. Any help is much appreciated!

My main questions:

  • How do I connect the SPI display, which Pins to use?
  • Which library to use to display stuff on the display?
  • Example code of how to get started?
1
Did you have any joy in the end?funkybro

1 Answers

1
votes
  • I am afraid that it will be hard to connect the ePaper module to the ESP32 Heltec using the standard library from Waveshare. It is probably do-able, but will require some modification on the standard ePaper library. Looking at epd-library-arduino gives these pins for SPI:
// Pin definition
#define RST_PIN         8
#define DC_PIN          9
#define CS_PIN          10
#define BUSY_PIN        7

All these pins are not freely available on the Heltec. In addition the Heltec uses SPI for LoRa and OLED. You would have to find some other pins and possibly do SPI "bit banging" (not hardware SPI). I would suggest starting with the example code from Waveshare on a ESP-WROOM-32 chip without any other external devices connected to the SPI bus. When you get this working, start porting the code over to the Heltec using different pin setup for the SPI.

  • GxEPD2 is a great library. I've personally used it on a ESP-WROOM-32. Note that GxEPD2 is licensed under GPLv3.0.

  • Both Waveshare, GoodDisplay, GxEPD2 and Adafruit GFX have a lot of example source code to get started.