Waveshare e-paper displays with SPI

ZinggJM:

Thanks jean, I was able to figure out some of my issues, and refined it slightly more now that I've slept, though sadly that didn't reduce the usage of global variables, my issue currently seems to be with the display class/resolution.

I found out about display.rotate which did work, however setting the cursor to 0.0 sets text too far up the screen, and when I try to fill the display with black, or print text, only the leftmost 1/3 (connector to the left) side of the display can update with text or the black color.

When I used the demo sketch, as I had mentioned in my pm the first two images did load across the whole display however which is quite odd. I'll have to look through the command list for the controller and see if there is a way to define the resolution, it should be handled by your library I would think though by setting the display class.

edit: oh yes, and I am using the spi demo as a base for this project.
edit 2: found the link you mentioned in the header, I guess what I'm looking for is a list of commands available in the library itself, when I sent the pm I was just working on the issue of it not filling the whole screen, which is why I was hoping a list of commands would have options to set the resolution or something like that.

@XOIIO,

Now that I read your actual post and your original post more in detail, I understand your issue.

You use an Arduino Pro Mini, which is an AVR Arduino and has not enough RAM to buffer the whole display content. The GxEPD_SPI_TestExample first uses methods to draw bitmaps directly to the controller buffer with subsequent refresh to the screen. Then it draws one bitmap to the buffer in the display class and calls update() to update to the screen. With AVR Arduino this buffer is only the size of a part of the screen, that's the effect you see. I did in on purpose so in the example, so users can see what happens. Maybe I should have added more explanation.

Use the example PagedDisplayExampleSmallRam.ino to see how you can draw or print to the whole screen with GxEPD on AVR Arduinos.

Jean-Marc

@ZinggJM I see, that makes sense, I'm also unable to even include the sd card library without maxing out the dynamic memory available.

I'll have to find another product I can use instead of the pro mini, however I want to keep form factor as small as possible, unfortunately this means another delay waiting on parts to arrive.

Take a look at GxGDEH029A1.h

There you find all the "commands" you were looking for, the methods of this display class.

And on line 30 you see the number of pages used for AVR Arduinos. You can increase that number to have more RAM available for your application. Using paged display with SD cards is possible but not straightforward; I am working on that example.

ZinggJM:

What you say about static charge could make sense, considering both me and the guy from the ruuvi forum have the same problem.

I saw the post with the flashlight, but i never kept it in direct sunlight and the temperature was never more than 30 degrees.

I'll test some more when the epaper gets back from dead and if it still doesn't work i'll buy one of the boards you've mentioned.

Do you also have the epaper between a glass and a cardboard in your picture frame?

Thank you very much for your help. Neither waveshare, nor the shop cared to give my any real help.

@tudro,

Yes, it looks quite the same, I just have the display upside down, because I used the DESTM32-S2 connection board originally, now also the e-paper HAT. Make sure no component (capacitor) on the flex cable gets damaged or squeezed.

The temperature effect (or is it photons causing it) should soon go away when the flashlight is turned off.

From your picture of the backside I can't see clearly if the flex connector is pushed in enough; you first loosen the black retainer (pull out the black cubes ~1mm) before pushing in the flex, then push the cubes back in.

@XOIIO,

I have updated the GxEPD_SD_BitmapExample with support for AVR using paged drawing, tested on ESP8266 with AVR simulated, but not yet tested with Arduino Pro Mini 3.3V.

@ZinggJM I'm actually using the 5v pro mini with an lm317 to provide the 3.3v though grabbing a 3.3v unit would probably good for the sake of simplicity.

I'm looking at the 1284 mini from Cross Roads Electronics, it has 128k of flash and 16k ram which should be plenty for what I want to do even without loading from an SD card, I think I have about 15 or 16 images I want to store.

hey guys,

I have a little problem with the standart pinout of the GxEPD_SPI_TestExample.

My hardware:

-NodeMCU Lua Lolin V3 Module ESP8266
-Waveshare 7.5 Inch E-Paper Display

When I am connecting the Waveshare Module by standart pin configuration:

// 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

I canot flash the esp chip (error: "flash memory failed". I found out that the CS PIN on GPIO15 ist responsable for that problem. If the CS PIN of the e-Paper HAT is disconnected of the ESP-module it works. So I have
remapped the CS pin to D1 instead of to D8 and it works fine. I can flash the esp and the display works.

Did you have similiar problems?

Hi msrparts, try the small ram example.

@msrparts

Hi,

I do not have this board, so I can't check. NodeMCU boards use the GENERIC pin mapping, I assume this is true for V3 also (which board do you select to compile for?).

I do get sporadic upload failures with Wemos D1 mini, maybe only with e-paper connected, but usually it works on the second try.

Maybe adding a pullup resistor for the CS line could help.

Paged drawing (small ram example) is only needed for 7.5" 3-color e-paper on ESP8266.

Jean-Marc

@ZinggJM I'm messing around with the small ram example for the heck of it as I see that the bitmapexample file is actually holding all the images, whereas I've seen the c code in the sketch itself on some other videos.

Now, it displayed the waveshare image just fine on my setup as well as the text but I'm having trouble getting a custom image to work, it's tending to just leave a strip of random black/white bars on one segment of the screen, perhaps it's something I missed while simplifying the code to the bare minimum from the example, or perhaps it's something I messed up making the image.

I've reversed color and mirrored left-right, as well as unticked head data which added the progmem part which I was missing with that option ticked in img2lcd, anything else in that software I need to do?

Here's my sketch to just try and display something.

#include <GxEPD.h>
#include <GxGDEH029A1/GxGDEH029A1.cpp>      // 2.9" b/w

#include <GxIO/GxIO_SPI/GxIO_SPI.cpp>
#include <GxIO/GxIO.cpp>

// FreeFonts from Adafruit_GFX
#include <Fonts/FreeMonoBold9pt7b.h>

#include <GxGDEH029A1/customimages.h>



GxIO_Class io(SPI, /*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9); // arbitrary selection of 8, 9 selected for default of GxEPD_Class
GxEPD_Class display(io /*RST=9*/ /*BUSY=7*/); // default selection of (9), 7

void setup(void)
{
  Serial.begin(115200);
  Serial.println();
  Serial.println("setup");
  display.init(115200); // enable diagnostic output on Serial
  Serial.println("setup done");

}

void loop()
{
  display.drawExampleBitmap(testpic, sizeof(testpic));
  delay(10000);
  display.fillScreen(GxEPD_WHITE);
  display.update();
  delay(10000);
  
}

and here is the test picture file, I made the original image at the correct resolution in photoshop to be sure it would fit correctly.

edit: that exceeds the character limit, so here it is #ifndef _GxBitmapExamples_H_#define _GxBitmapExamples_H_#if defined(ESP826 - Pastebin.com

It seems I was too hasty to order those other boards, I might be able to do it using the low ram example after all, oh well, too late and maybe I will need then anyways, if not for this for a more substantial project.

@XOIIO,

As I wrote, I have no experience with image2lcd. I see the same effect with your bitmap on my display.
I think the scan direction is wrong. Both Waveshare in their Wiki and Good Display have documented how to convert images with image2lcd for their e-papers.

The header part of the image code, the part in comment, should be the same as the examples, I think, but the first value is different. Maybe you need to select vertical scan.

Hi @ZinggJM

I do not have this board, so I can't check. NodeMCU boards use the GENERIC pin mapping, I assume this is true for V3 also (which board do you select to compile for?).

I compile to a NODEMcu 1.0 (ESP12E-Module), 80 MHz, 4M(1M SPIFFS), v2 Prebuilt (MSS=536), DISABLED, None, 115200 COM5,

Maybe adding a pullup resistor for the CS line could help.

I tried out, to flash the esp I need low (GND) at the cs-pin. If I connect a pull-up, it doesnt work.

Paged drawing (small ram example) is only needed for 7.5" 3-color e-paper on ESP8266.

At this example I have the same problem.

I just wonder if it is really worth buying larger e-paper now. They are very expensive and delicate.
Will they be popular in the future?

czAtlantis:
I love how everybody is keeping the protective foil on the displays (including me, but i just removed the green sticker from the protective foil :D)

Btw - have you noticed that the display is photosensitive during partial refresh?
I just shined powerful flashlight on the display and it turned the area grey - right top corner

(just running modified clock-example with black background and some icons :slight_smile: )

It clears after full refresh without any permanent damage but still - I imagine bright summer sun will make the display really ugly (we have winter here so I can't try that :smiley: )

Hi there,

I was wondering if anybody had encountered this problem and even more if a workaround has been found?
I'm using a B&W 2.9 display and while I just need to do a full refresh every hour or so when using it indoor, it turns instantaneoulsy grey when exposed to direct sun light.

edit: a video found on the tube, not mine:

That is quite ridiculous. I was thinking maybe it is the poor quality of the e-paper because I saw few e-papers on industrial devices and exposing to sun didn't do any visible effects.

Maybe it is doomed technology and we should wait for some better displays

ZinggJM:

No luck yet. I left it for several days, like last time, but it didn't recover. I checked the flex and the connectors multiple times. Everything seems ok. Oh well, i'll try with one of the boards you mentioned.

Thank you :slight_smile:

Hey @ZinggJM, bit of an update, I got the 1284 mini in and it's working great with bitmaps, however I am having the same issue when I try to set the display rotation to 1 (landscape) and print text, with this setup I only get the leftmost third of the display still, a little bit less actually, it only shows "This is" and the s is actually cut off a little bit.

I'm well under the memory and program space limits, I've also tried dropping the baud rate to 9600 to no affect.

Any ideas? I would really like to be able to print text out in landscape mode.

  Serial.begin(115200);
  Serial.println("setup");
  display.init(115200); // enable diagnostic output on Serial
  display.setTextColor(GxEPD_BLACK);
  display.setFont(&FreeMonoBold9pt7b);
  display.fillScreen(GxEPD_WHITE);
  display.update();
  delay(500);
  Serial.println("setup done");
  display.setRotation(1);
  display.setCursor(0,50);
  display.println("This is test line 1");
  display.update();

Edit: crap, actually I'm getting that using it in portrait mode as well. It works well in that small ram example you gave however, I'm just trying to figure out the bare minimum to display text.

Plan is to use this in a menu with a clicky joystick to move a cursor from line to line.

@XOIIO,

This is the kind of question I am not happy with trying to answer.

I know that I can click the poster, and then click show posts, but still this takes some effort to get the context.

If your previous post is some while ago, please state shortly the necessary information:

  • library used
  • display used
  • processor / board used
  • example program used.

You state that you use a 1284 mini. I would need go searching for information about this processor, but I think it is an AVR kind with even less program space than an Atmega 328, but about the same RAM.

So you need paged drawing for buffered drawing (e.g. text).

GxEPD will provide buffer for one page, which is for one fourth of the 2.9" e-paper size, if __AVR is defined.

Btw: the library has a README.MD file, you should at least have taken a look at it.