Go Down

Topic: Waveshare e-paper displays with SPI (Read 255235 times) previous topic - next topic

ZinggJM

See README.MD:

Quote
### Full Screen Buffer Support
 - full screen buffer is selected by setting template parameter page_height to display height
 - drawing to full screen buffer is done using Adafruit_GFX methods without picture loop or drawCallback
 - and then calling method display()
and example GxEPD2_NotPagedExample.ino
No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

frd2002

#1681
Feb 01, 2020, 04:53 pm Last Edit: Feb 01, 2020, 04:57 pm by frd2002
Usefull information

I manage to get a working e-paper with Adafruit HUZZ32AH Feather (Expressif ESP-WROOM-32) with Wareshare 2.9" E-Ink display B&W (296x128).

I use the following connection :

static const uint8_t EPD_BUSY = 32;  // to EPD BUSY
static const uint8_t EPD_CS   = 15;  // to EPD CS
static const uint8_t EPD_RST  = 27; // to EPD RST
static const uint8_t EPD_DC   = 33; // to EPD DC
static const uint8_t EPD_SCK  = 5; // to EPD CLK
static const uint8_t EPD_MISO = 19; // Master-In Slave-Out not used, as no data from display
static const uint8_t EPD_MOSI = 18; // to EPD DIN

I tested connectivity with the program ESP32-e-Paper-Weather-Display using a 2.9" Waveshare e-paper.

Hope it helps

Geri01

See README.MD:

and example GxEPD2_NotPagedExample.ino
Thank you ZinggIM, for fast answer  

Geri01

Hello i am again, please help me

i thought it was the do .. while loop, but with the GxEPD2_NotPagedExample it is the same.


Plese look the scetch

With the 1,54" Display ( GxEPD2_154_D67) the loop repeats exactly 2 times then hangs in Power Off.

but it works with the 7.5" display (GxEPD2_3C<GxEPD2_750c_Z08, GxEPD2_750c_Z08::HEIGHT / 4> display(GxEPD2_750c_Z08(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW075Z08 800x480 )

where am i making a mistake?

look here:
17:08:13.749 -> Connected to the WiFi network
17:08:13.749 -> Connecting to MQTT...
17:08:13.749 -> connected
17:08:13.749 -> Message arrived in topic: display_line1
17:08:13.749 -> Message:Strom 137.52 C
17:08:13.749 -> -----------------------
17:08:13.749 -> Display FULLL UPDATE
17:08:23.800 -> Busy Timeout!
17:08:23.800 -> _PowerOn : 10000553
17:08:33.972 -> Busy Timeout!
17:08:33.972 -> _Update_Full : 10000162
17:08:44.035 -> Busy Timeout!
17:08:44.035 -> _PowerOff : 10000884
17:08:44.035 -> Message arrived in topic: display_line2
17:08:44.035 -> Message:Strom 5.73 A
17:08:44.035 -> -----------------------
17:08:44.035 -> Display FULLL UPDATE
17:08:54.098 -> Busy Timeout!
17:08:54.098 -> _PowerOn : 10000177
17:09:04.176 -> Busy Timeout!
17:09:04.176 -> _Update_Full : 10001265
17:09:14.254 -> Busy Timeout!
17:09:14.254 -> _PowerOff : 10000610




Code: [Select]


#include <GxEPD2_BW.h>
#include <GxEPD2_3C.h>

//#include "IMG_0001.h"

#include <SPI.h>
// #include <Wire.h>
#include <PubSubClient.h>
#include <ESP8266WiFi.h>


// Update these with values suitable for your network.
const char* ssid = "FRITZBox";
const char* password =  "PW";
const char* mqttServer = "192.168.178.79";
const int mqttPort = 1883;
const char* mqttUser = "User";
const char* mqttPassword = "PW";


 
String _DisplayLine1 = "";
String _DisplayLine2 = "";
String _DisplayLine3 = "";
String _DisplayLine4 = "";






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




// Waveshare e-Paper ESP8266 Driver Board

GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> display(GxEPD2_154_D67(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEH0154D67

//GxEPD2_3C<GxEPD2_750c_Z08, GxEPD2_750c_Z08::HEIGHT / 4> display(GxEPD2_750c_Z08(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW075Z08 800x480



WiFiClient espClient;
PubSubClient client(espClient);
 
void setup() {
  
 display.init(115200);

 
  Serial.begin(115200);

   WiFi.begin(ssid, password);
 
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.println("Connecting to WiFi..");
  }
  Serial.println("Connected to the WiFi network");
 
  client.setServer(mqttServer, mqttPort);
  client.setCallback(callback);
 
  while (!client.connected()) {
    Serial.println("Connecting to MQTT...");
 
    if (client.connect("ESP8266Client", mqttUser, mqttPassword )) {
 
      Serial.println("connected");  
 
    } else {
 
      Serial.print("failed with state ");
      Serial.print(client.state());
      delay(2000);
 
    }
  }
 

client.subscribe("display_line1");
client.subscribe("display_line2");
client.subscribe("display_line3");
client.subscribe("display_line4");
 
}
 
void callback(char* topic, byte* payload, unsigned int length) {
 
  Serial.print("Message arrived in topic: ");
  Serial.println(topic);
  
 
  Serial.print("Message:");
  for (int i = 0; i < length; i++) {
    Serial.print((char)payload[i]);

 if ( strcmp( topic, "display_line1" ) == 0 )
  {
    _DisplayLine1 = "";
    for (int i = 0; i < length; i++) {
      _DisplayLine1 += (char)payload[i];
  
    
    }
    
    
  }

  if ( strcmp( topic, "display_line2" ) == 0 )
  {
    _DisplayLine2 = "";
    for (int i = 0; i < length; i++) {
      _DisplayLine2 += (char)payload[i];
    }
  }
  if ( strcmp( topic, "display_line3" ) == 0 )
  {
    _DisplayLine3 = "";
    for (int i = 0; i < length; i++) {
      _DisplayLine3 += (char)payload[i];
    }
  }
  if ( strcmp( topic, "display_line4" ) == 0 )
  {
    _DisplayLine4 = "";
    for (int i = 0; i < length; i++) {
      _DisplayLine4 += (char)payload[i];
    }
  }
    
  }
 
  Serial.println();
  Serial.println("-----------------------");
 //showFont("FreeMonoBold9pt7b", &FreeMonoBold9pt7b);

 // UpdateDisplay();

 display.setFullWindow();
  display.fillScreen(GxEPD_WHITE);
  display.setTextColor(GxEPD_BLACK);
//  display.setFont(&FreeMonoBold18pt7b);
//  display.setCursor(300, 30);
//  display.println("IOBroker");
  
 
  display.setFont(&FreeMonoBold9pt7b);
  display.setCursor(0, 30);
//  display.println();
 // display.println(name);
 
  display.println(_DisplayLine1);
  display.println(_DisplayLine2);
  display.println(_DisplayLine3);
  display.println(_DisplayLine4);
 // display.fillRect(400, 100, 8, 8, GxEPD_BLACK);
 Serial.println("Display FULLL UPDATE");  
 display.display(); // full update
// display.displayWindow(0,0,10,10);
 

 
 
 
}







void loop()
{

   client.loop();

}

ZinggJM

@Geri01,

Please first read General Guidance and How to use the Forum and the topic of its first link Learn How To Use The Forum.

Then think about how you ask for help, and how to help the one that might be able to help you.

I am willing to analyze a well-formed self-contained program that shows the error.

But I am not going to try a program that needs additional resources like mqtt.

Jean-Marc
No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

ZinggJM

I just got informed about an interesting 6" parallel IF e-paper board with ESP32 for Arduino in this post.

https://www.crowdsupply.com/e-radionica/inkplate-6

As I had hoped that a similar board would become available from Waveshare, I post this information here.

Jean-Marc
No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

ZinggJM

#1686
Feb 12, 2020, 05:32 pm Last Edit: Feb 14, 2020, 09:47 am by ZinggJM Reason: minor bug, link
Version 1.2.5 of Library GxEPD2 is available through Library Manager.

- added support for GDEW1248T3 12.48" b/w panel on Waveshare 12.48 e-paper display frame
- tested with Waveshare Epaper ESP32 Driver Board mounted on connection board
- tested with Arduino UNO mounted on connection board, is extremely slow
- doesn't work with Arduino MEGA on connection board with switch set to ICSP and pins bent out of way, reason unknown
- not tested with other processors
- caution: wiring connector is on 5V side of level converters!

The ICSP connection switch on the connection board is ON as set by factory. It connects pins 11,12,13 to the ICSP pins. Therefore SPI should work with Arduino MEGA with this e-paper display frame.
I will need to check why the display does not work with Arduino MEGA. Can't use the connection pins for this, as they are covered by the MEGA. But the signals are available (shifted) on the ESP32 connector.

Jean-Marc

There is one known bug so far (comment out line 274 in GxEPD2_1248.cpp to fix)
I would like to postpone next release, so I would need to know if this e-paper display is used by anyone. Thank you.


https://www.waveshare.com/product/displays/e-paper/12.48inch-e-paper-module.htm

No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

axelleap

Thank you for the picture, I will use it for my test.
Hello,

Could someone explain how to create a correct bitmap please?

I tried this:

  • Create bitmap using only 1-pixel bitmap (black or white)
  • Save
  • Then do xxd -i file.bmp to convert the bitmap as an array
  • Insert that in the Arduino file


But that does not display the expected image, so my process is obviously wrong :(

Thanks for your help.

mattard

I have found that 1-bit color depth bitmaps don't render properly, I have to use 8 or 24 bit.

axelleap

#1689
Feb 13, 2020, 09:18 pm Last Edit: Feb 13, 2020, 10:09 pm by axelleap
I have found that 1-bit color depth bitmaps don't render properly, I have to use 8 or 24 bit.
I tried with an 8-bit bitmap, but it's not better :-( . It prints something but incorrectly.
Then, I tried a bitmap array I know is correct, from some other code I found, and it prints it incorrectly too. So, my code is wrong. Let me check that first, and I'll be back if I still don't understand what's going on.


mattard

I tried with an 8-bit bitmap, but it's not better :-( . It prints something but incorrectly.
Then, I tried a bitmap array I know is correct, from some other code I found, and it prints it incorrectly too. So, my code is wrong. Let me check that first, and I'll be back if I still don't understand what's going on.
Have you tried using different programs to make the bitmaps? I've had luck with Windows Paint and GIMP.

ZinggJM

#1691
Feb 14, 2020, 06:23 am Last Edit: Feb 14, 2020, 07:42 am by ZinggJM
Hello Jean-Marc,

This is the Waveshare e-Paper I have:

Waveshare e-Paper 1.54 inch from Aliexpress. To my understanding, it is the Waveshare e-Ink 1.54 module, black and white, with connectors.

It is connected to a Wemo D1 mini.


For the connection, I used:

Do you see a problem with this?
Other than that, can you suggest a way for me to debug the situation?


This blog uses a Wemo D1 with the same eInk 1.54 display, and it works, so I suppose it should work in my case.

Thanks
Axelle
You still have not learned to provide the information needed when you ask a question.

Please always provide the information about library used, e-paper used, processor board used, and connection board used when you ask a question related to e-paper displays.

And tell exactly what doesn't work, or how the wrong result looks like, e.g. by a photo.
Attach the bitmap code, zipped if too big.

For bitmaps not rendered correctly I also need to know the bitmap drawing method call you use, with all parameters.

Waveshare and Good Display provide information how to create bitmap code using image2lcd.
I have no experience with this, as I only use existing bitmaps.
Take a look at the example bitmaps to see how to add PROGMEM for the processors that need it.

Jean-Marc

No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

vmath54

Version 1.2.5 of Library GxEPD2 is available through Library Manager.

- added support for GDEW1248T3 12.48" b/w panel on Waveshare 12.48 e-paper display frame
...
Hi, Jean-Marc,

Since version 1.2.5, problem compiling a project using the GxEPD2 library.
IDE: PlatformIO (with VSCode), board esp32dev

Errors :
GxEPD2_1248.h:125:14: error: 'GxEPD2_1248::ScreenPart::_rev_scan' will be initialized after [-Werror=reorder]

GxEPD2_1248.h:124:16: error:   'int8_t GxEPD2_1248::ScreenPart::_cs' [-Werror=reorder]      

resolved by reversing lines 124 and 125 in GxEPD2.h :

...
123      private:
124        bool _rev_scan;
125        int8_t _cs, _dc;

Regards

Vincent

ZinggJM

Hi Vincent, Hi All who are affected,

sorry, I forgot to raise the warning level in the Arduino IDE for final tests.

Will be fixed in the next release.

Jean-Marc
No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

ds-1991

Hello there,

about a year ago I was working on a project to show the weather and some smart home parameters on an e-ink display. I have used an Waveshare 7,5" 640x384 3-color display, the Waveshare ESP32 e-paper board and the library G6EJD/ ESP32-e-Paper-Weather-Display and everything worked fine.

Recently the cable to the display broke, so I needed a new one. The new one I got now is also a Waveshare 7,5 3-color display, but has the bigger resolution of 800x480. With this new setup I get the following error while compiling:

Code: [Select]
c:/users/ds-19/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\ds-19\AppData\Local\Temp\arduino_build_508179/Waveshare_7_5_T7.ino.elf section `.dram0.bss' will not fit in region `dram0_0_seg'

c:/users/ds-19/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: DRAM segment data does not fit.

c:/users/ds-19/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: region `dram0_0_seg' overflowed by 17448 bytes


I figured out this means the ESP32 is running out of statically allocated memory (max. 160KB), but the remaining DRAM can be dynamically allocated.

I then tried to run the same code, but change the display type to the black and white display. There everything compiles as expected. Are there any chances I can run this project with the 3-color display on an ESP32?

Go Up