Hi,
these are my first steps with a MCU, so please be patient with me...
I cannot get the 3.7 inch waveshare epaper (3.7inch-e-Paper-HAT) working with my ESP32 (esp-32-dev-kit-c-v4). I tried different pin assignments, the alternative init method ("clever" reset circuit), other examples, other IDEs, but: I am always getting a "busy timeout" in nextpage() and nothing displayed on the epaper.
I added some serial output for debugging...
// GxEPD2_MinimumExample.ino by Jean-Marc Zingg
// purpose is e.g. to determine minimum code and ram use by this library
// see GxEPD2_wiring_examples.h of GxEPD2_Example 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, to use less code and ram
//#include <GFX.h>
#include <GxEPD2_BW.h> // including both doesn't use more code or ram
#include <GxEPD2_3C.h> // including both doesn't use more code or ram
// select the display class and display driver class in the following file (new style):
//#include "GxEPD2_display_selection_new_style.h"
// alternately you can copy the constructor from GxEPD2_display_selection.h or GxEPD2_display_selection_added.h of GxEPD2_Example 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_BW<GxEPD2_371, GxEPD2_371::HEIGHT> display(GxEPD2_371(5, 17, 16, 4)); //CS, DC, RST, BUSY
void setup()
{
Serial.begin(115200);
Serial.println("init");
display.init();
// comment out next line to have no or minimal Adafruit_GFX code
display.setTextColor(GxEPD_BLACK);
Serial.println("firstPage");
display.firstPage();
bool quit = false;
while (!quit)
{
Serial.println("fillscreen");
display.fillScreen(GxEPD_WHITE);
Serial.println("say hello");
// comment out next line to have no or minimal Adafruit_GFX code
display.print("Hello World!");
Serial.println("nextPage");
if (display.nextPage())
{
Serial.println("nextPage returned true");
}
else
{
Serial.println("nextPage returned false");
quit = true;
}
}
}
void loop() {};
Compiler output:
Sketch uses 259593 bytes (19%) of program storage space. Maximum is 1310720 bytes.
Global variables use 29004 bytes (8%) of dynamic memory, leaving 298676 bytes for local variables. Maximum is 327680 bytes.
esptool.py v2.6
Serial port /dev/cu.usbserial-0001
Connecting........_
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
MAC: f0:08:d1:d2:2f:18
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 8192 bytes to 47...
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 2622.1 kbit/s)...
Hash of data verified.
Compressed 17392 bytes to 11186...
Wrote 17392 bytes (11186 compressed) at 0x00001000 in 0.2 seconds (effective 888.4 kbit/s)...
Hash of data verified.
Compressed 259712 bytes to 119560...
Wrote 259712 bytes (119560 compressed) at 0x00010000 in 2.3 seconds (effective 903.7 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 128...
Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.0 seconds (effective 928.3 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
My current pin setup is:
Busy : 4
RST : 16
DC : 17
CS : 5
CLK : 18 (SCK)
DIN : 23 (MOSI)
GND : GND
VCC : 3V3
Output:
⸮Ԙz⸮⸮⸮⸮⸮⸮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:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8
init
firstPage
fillscreen
say hello
nextPage
Busy Timeout!
nextPage returned false
Did I select the wrong display/driver class? The GxEPD2_371 seems to have other values for WIDTH and HEIGHT (240x418) than the epaper from waveshare (480x280). And the epaper is not really B/W, it has 4 gray levels...
Thanks for your great work.
EDIT:
Just in this moment, I got the epaper working with the waveshare libs/demo, see: 3.7inch_e-Paper_HAT
Download "e-Paper ESP32 Driver Codes"
Example: epd3in7-demo
I had to change the pin setup in DEV_Config.h:
#define EPD_SCK_PIN 18
#define EPD_MOSI_PIN 23
#define EPD_CS_PIN 5
#define EPD_RST_PIN 16
#define EPD_DC_PIN 17
#define EPD_BUSY_PIN 4
So my hardware and setup are working properly. I think, the 3.7 inch epaper from waveshare is not supported by GxEPD2.