Waveshare e-paper displays with SPI

I write to the the display using display() with faded I mean completely grey scaled and since yesterday unresponsive :stuck_out_tongue: I am using the includes Waveshare EPaper HAT but the defect display is not a problem my company can buy a new one without any hassle :stuck_out_tongue: Good to know, I‘ll include a powerOff() now.

Cheers (liebe Grüess) and thanks for your awesome library

qwykx:
I write to the the display using display() with faded I mean completely grey scaled and since yesterday unresponsive :stuck_out_tongue: I am using the includes Waveshare EPaper HAT but the defect display is not a problem my company can buy a new one without any hassle :stuck_out_tongue: Good to know, I‘ll include a powerOff() now.

Cheers (liebe Grüess) and thanks for your awesome library

I see a potential issue with the Waveshare E-Paper HAT, looking at the schematics.
The VCC pin of the wire connector should be supplied with 5V for 5V Arduino use, but with 3.3V for connection to 3.3V processors like ESP32, else the level converter will produce too high BUSY output.

But between the VCC and the 3.3V to the display there is a series regulator. If fed with 3.3V the voltage to the display will be lower. The 7.5" e-paper doesn’t work well with supply lower than 3V!

You could check the 3.3V on the 3.3V pin of the RPi connector, or feed in 3.3V through this pin.
I think they should have added a jumper to bypass the series regulator.

I just got my Waveshare “Universal e-Paper Raw Panel Driver Board” (https://www.waveshare.com/wiki/E-Paper_ESP32_Driver_Board) this morning and tried to connect it to a 1.54" B/W EPD (https://www.waveshare.com/1.54inch-e-Paper.htm). The Waveshares demo code (File:E-Paper ESP32 Driver Board Code.7z - Waveshare Wiki) made it easy to connect the ESP32 on the Driver Board to my smartphone and upload some image data, which worked pretty much instantly.

However, during the last eight hours, I did not manage to successfully show some text or anything invoked by Arduino code. The Waveshare demo code seems to be useless and my currently best try was with the GxEPD2_WS_ESP32_Driver (https://github.com/ZinggJM/GxEPD2/blob/master/examples/GxEPD2_WS_ESP32_Driver/GxEPD2_WS_ESP32_Driver.ino). As I understand it, this demo should work without any further attention except choosing the right board by uncommenting line 37 in my case. But instead, it flashes the EPD for up to ten seconds, does not show the appropriate picture in the end (but something near to it) and it only works, when run after the Waveshare demo code without powering the board down in between.

This all looks like dark magic to me, especially because the precise results vary by chance. Does anyone here have experience with the Waveshare “Universal e-Paper Raw Panel Driver Board”? Thanks a lot!

@Ilka31415,

My e-Paper ESP32 Driver Board still works fine with the 1.54" b/w e-paper and the actual library GxEPD2 example GxEPD2_WS_ESP32_Driver.ino. I selected board WEMOS LOLIN32 to compile for.

I have no idea why it doesn't work for you.

Check the 3.3V pin voltage. Observe diagnostic output in Serial Monitor (115200 baud).

Hello everybody,

I have two questions about a Waveshare 4.2Inch Display. I use it on an ESP8266 (generic and nodemcu). As a library I use GxEPD2 and u8g2. The wiring corresponds to the proposal:

// mapping suggestion from Waveshare SPI e-Paper to generic ESP8266
// BUSY -> GPIO4, RST -> GPIO2, DC -> GPIO0, CS -> GPIO15, CLK -> GPIO14, DIN -> GPIO13, GND -> GND, 3.3V -> 3.3V

  1. The display only works if I do NOT connect VCC to 3.3V. Is that normal? If I connect VCC there will be no reaction on the display. With the NodeMCU no software upload is possible anymore.

  2. Reset is on GPIO2. When the ESP8266 is in deepsleep mode the LED will always glow a bit. For processor and display, I determine a quiescent current consumption of about 40μA (display.hibernate ()). If I provide GPIO2 with a pullup resistor, the quiescent current consumption increases to about 170μA, but the LED does not glow anymore.
    Is it possible to further reduce the quiescent current consumption by connecting Reset to another PN? I have made various attempts, but failed.

Greeting Kai

// NOTE: connect 4.7k pull-down from GPIO15 to GND if your board or shield has level converters
// NOTE for ESP8266: using SS (GPIO15) for CS may cause boot mode problems, use different pin in case, or 4k7 pull-down

If you want to use the 4.2" e-paper display with deep sleep, you should use the bare e-paper panel with the connection board DESPI-C02 from Good Display: http://www.e-paper-display.com/products_detail/productId=403.html

The new boards from Waveshare with level converters are fine for use with 5V Arduinos, but cause a lot of problems when used with 3.3V processor boards.

Explanation, e.g. for the led glow effect: The level converter used is of the automatic bidirectional type. It poses a load on both sides to determine which is the driving side. It "pulls" toward a middle voltage. And this uses more current than all other components in deep sleep.

ZinggJM:
[...]
The new boards from Waveshare with level converters are fine for use with 5V Arduinos, but cause a lot of problems when used with 3.3V processor boards.

Explanation, e.g. for the led glow effect: The level converter used is of the automatic bidirectional type. It poses a load on both sides to determine which is the driving side. It "pulls" toward a middle voltage. And this uses more current than all other components in deep sleep.

Hello ZinggJM,

I should have known earlier :). Thank you for your hints and explanations. I currently have the board running deepsleep (albeit with the described peculiarity), but I will follow your advice and try it with a bare e-paper panel + DESPI-C02.

Thank you very much.

@ZinggJM

Thanks for your help!

The example code in GxEPD2_WS_ESP32_Driver.ino says // use Board "ESP32 Dev Module" to build with Arduino IDE, so I did. However, it's exactly the same with WEMOS LOLIN32.

As long as I don't use Bluetooth or Wifi, I don't get any brownout messages but maybe I should get my hands on a scope to monitor the supply voltage...

Also, it still only works (meaning it shows at least something), when run after the Waveshare demo code without powering the board down in between.

I am looking for further clues, but this issue seems quite shady to me...

@Ilka31415,

Did you set the RESE switch to the correct position for your display? Pos. A for your 1.54" b/w.
E-Paper_ESP32_Driver_Board_user_manual_en.pdf page 7.

Also, it still only works (meaning it shows at least something), when run after the Waveshare demo code without powering the board down in between.

Looks like the SPI communication doesn't work correctly during init() of the display.

You could add delay(1000) at the begin of setup().
You could try to connect to USB3 or to a strong external USB power, e.g. from your smartphone.

Please post diagnostic output from Serial Monitor.

As long as I don't use Bluetooth or Wifi, I don't get any brownout messages

Please be more specific! What brownout messages do you get, under what conditions?
I think you shouldn't get any, if your power supply is stable!

Hello

I have an issue where I can use some hints …

I’m using the GxEPD2_WiFi_Example on a 7.5 inch waveshare display together with an esp32, this works flawless.

What I want to do is, instead of getting the bmp file from an external website, get it from an internal website.
The address is: http://192.168.0.205:8123/local/test.bmp (linked to a home automation system).

I thought this would be an easy modification but I seem to get stuck to download these files.

The function I’m trying to modify is the function: void showBitmapFrom_HTTP

But whatever I modify in
client.print(String("GET “) + path + filename + " HTTP/1.1\r\n” +
"Host: " + host + “\r\n” +
“User-Agent: GxEPD2_WiFi_Example\r\n” +
“Connection: close\r\n\r\n”);

I never obtain the right format to pass the part were any headers are received ( Serial.println(“headers received”); )

I seriously wonder if the WifiClient in arduino, supports local websites / IP addresses correctly.
Anyone with some advice on debugging activities or hints to make this work?

thanks in advance
Stijn

@goosst,

Print the string that gets printed to client also to Serial. Take a look at the printed string in Serial Monitor to see if it looks correct. Post this string here, if you need further help.

Did you adapt this line:
if (!client.connect(host, httpPort))
to connect to your specific port?

thanks for the reply.
I reran some of my code and I seem to get something more meaningful as response compared to yesterday (or I was getting too frustrated :slight_smile: ).

Anyway, conclusion:

  • the code below and string (named fubar) below seems to do the trick to download from a local site
  • I was assuming I could just convert an image to grayscale and have it plot (which it doesn't of course). Once it was converted to real black and white it was also displayed properly on the e-paper.
IPAddress hass(192, 168, 0, 205);
  int port_fub = 8123;

  bool connection_ok = false;
  bool valid = false; // valid format to be handled
  bool flip = true; // bitmap is stored bottom-to-top
  uint32_t startTime = millis();
  if ((x >= display.width()) || (y >= display.height())) return;
  Serial.println(); Serial.print("downloading file \""); Serial.print(filename);  Serial.println("\"");
  Serial.print("connecting to "); Serial.println(host);

  if (!client.connect(hass, port_fub))
  {
    Serial.println("connection failed");
    return;
  }
  Serial.print("requesting URL: ");
  Serial.println(String("http://") + host + path + filename);


  String fubar = String("GET ") + "http://192.168.0.205:8123/local/Bitmap.bmp" + " HTTP/1.1\r\n" +
                 "Connection: close\r\n\r\n";

  client.print(fubar);

Hi again,

I have posted before regarding the change of SPI pins in esp32 . I managed to change the SPI through this:

SPIClass hSPI(HSPI);// This changes the SPI, since ESP32 has two. VSPI and HSPI
GxIO_Class io(hSPI, /*CS=5*/ 15, /*DC=*/ 17, /*RST=*/ 16); // arbitrary selection of 17, 16
GxEPD_Class display(io, /*RST=*/ 16, /*BUSY=*/ 18); // arbitrary selection of (16), 4

ESP32 supports changing SPI pins to any pin through muxes. The only drawback is that can happen in void setup only. With this command

hSPI.begin(27,12,13,15); //CLK,MISO,MOIS,SS

I only need to change the CLK pin since it is being used in my HW module for something else (manufactures decision). The problem with this method is the epaper is initialized outside the setup loop. GxIO_Class, GxEPD_class are called before the setup function. I tried overwriting the classes through calling them again after the hSPI.begin the screen flashes but I am printing noise images.

GxIO_Class io(hSPI, /*CS=5*/ 15, /*DC=*/ 17, /*RST=*/ 16); // arbitrary selection of 17, 16
GxEPD_Class display(io, /*RST=*/ 16, /*BUSY=*/ 18); // arbitrary selection of (16), 4

void setup(void){ 

hSPI.begin(27,12,13,15); //CLK,MISO,MOIS,SS
GxIO_Class io(hSPI, /*CS=5*/ 15, /*DC=*/ 17, /*RST=*/ 16); // arbitrary selection of 17, 16
GxEPD_Class display(io, /*RST=*/ 16, /*BUSY=*/ 18); // arbitrary selection of (16), 4
}

The reason why I am using GxEPD instead of GxEPD2 is because here I found out how to change the SPI. In GxEPD2 I do not know where the SPI are initialized.

My question is where do you define the SPI pins in GxEPD2? and do you have any suggestions on how to solve this problem.

Thank you.

EDIT: One interesting thing that is happening, only the bitimages when called are producing noise. If I print something through adafruit library it is working.

EDIT2: My previous post is in page 98. I didn't quote myself in order to not make a super long post.

@r37ss,

My question is where do you define the SPI pins in GxEPD2? and do you have any suggestions on how to solve this problem.

Your posts concerning using HSPI and VSPI are confusing me.

For GxEPD2 there is a solution for changing the pins of standard SPI (SPIClass), which is VSPI on ESP32.

GxEPD2_WS_ESP32_Driver

You can also find posts about this in this topic.

GxEPD2 uses the standard Arduino HW SPI instance. You can't change this, but for ESP32 you can remap the SPI pins.

In GxEPD you can replace the class GxIO_SPI with your own version, if you need to. But you need to know what you do yourself.

Whats confusing you exactly? I have a board where the main SPI (VSPI) is being used by a LoRa module. And I had to change to HSPI (through SPIclass). But this board also uses the CLK of HSPI for something else (LoRa Reset). So far I have manged to change the SPI from VSPI (default) to HSPI, but now I also need to remap the CLK of the HSPI. So I am stuck here, the remapping of the HSPI pin in ESP32 is done through hSPI.begin function, as I have shown above.

Thank you, I will look into your link.

I have a board where the main SPI (VSPI) is being used by a LoRa module.

SPI is a bus. You can have multiple slaves. You just need separate CS for every client.

But this is outside the scope of my help for use of my libraries.

I am aware of that. But in my project I have 3 additional slaves that I want to connect, that’s why I need to utilize HSPI

Hi, first of all thank you for creating this great library.
I have a question. I have a E-Paper screen that is similar to the 2.13 inch waveshare screen.
Are you planning to support the following E-Paper screen in GxEPD2 ?

If you are interested, the screen is part of the latest version to the TTGO T5 Ink-Screen boards:

On the cable it is written: HINK-E0213A22

Hi szehrer,

On the cable it is written: HINK-E0213A22

I do have a panel with this inking. It is sold by Good Display named GDEH0213B73:

2.13 inch e-paper display module partial refresh e-ink screen GDEH0213B73

It is supported by GxEPD2, see README.MD or post #1409

Jean-Marc

Hello folks!

Need help using national languages ​​(especially Russian :slight_smile: with the gxepd library.

Is there a tool for creating a cyrillic font compatible with gxepd?