Skip to content

Commit

Permalink
Version 3.1.1
Browse files Browse the repository at this point in the history
- added support for GDEM029T94 2.9" b/w, actual Waveshare 2.9" b/w
- updated example GxEPD_WiFi_Example, for actual GitHub certificate
  • Loading branch information
ZinggJM committed May 11, 2021
1 parent 39621c2 commit 3e80e90
Show file tree
Hide file tree
Showing 12 changed files with 1,699 additions and 28 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ A simple E-Paper display library with common base class and separate IO class fo
- GDEW0213Z16 2.13" b/w/r
- GDEH029A1 2.9" b/w
- GDEW029T5 2.9" b/w
- GDEM029T94 2.9" b/w
- GDEW029Z10 2.9" b/w/r
- GDEW026T0 2.6" b/w
- GDEW027C44 2.7" b/w/r
Expand All @@ -66,7 +67,10 @@ A simple E-Paper display library with common base class and separate IO class fo

### for pin mapping suggestions see ConnectingHardware.md

### Version 3.1.0
### Version 3.1.1
- added support for GDEM029T94 2.9" b/w, actual Waveshare 2.9" b/w
- updated example GxEPD_WiFi_Example, for actual GitHub certificate
#### Version 3.1.0
- added support for GDEH0154D67 1.54" b/w, replacement for GDEP015OC1
- added example GxEPD_MinimumExample, e.g. for memory footprint
#### Version 3.0.9
Expand Down
15 changes: 15 additions & 0 deletions examples/GxEPD_Example/GxEPD_Example.ino
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
//#include <GxGDEW0213Z16/GxGDEW0213Z16.h> // 2.13" b/w/r
//#include <GxGDEH029A1/GxGDEH029A1.h> // 2.9" b/w
//#include <GxGDEW029T5/GxGDEW029T5.h> // 2.9" b/w IL0373
//#include <GxGDEM029T94/GxGDEM029T94.h> // 2.9" b/w
//#include <GxGDEW029Z10/GxGDEW029Z10.h> // 2.9" b/w/r
//#include <GxGDEW026T0/GxGDEW026T0.h> // 2.6" b/w
//#include <GxGDEW027C44/GxGDEW027C44.h> // 2.7" b/w/r
Expand Down Expand Up @@ -366,6 +367,20 @@ void showBitmapExample()
}
#endif

#if defined(_GxGDEM029T94_H_)
void showBitmapExample()
{
display.drawExampleBitmap(BitmapExample1, sizeof(BitmapExample1));
delay(2000);
display.drawExampleBitmap(BitmapExample2, sizeof(BitmapExample2));
delay(5000);
display.fillScreen(GxEPD_WHITE);
display.drawExampleBitmap(BitmapExample1, 0, 0, GxEPD_WIDTH, GxEPD_HEIGHT, GxEPD_BLACK);
display.update();
delay(5000);
}
#endif

#if defined(_GxGDEW029Z10_H_)
#define HAS_RED_COLOR
void showBitmapExample()
Expand Down
1 change: 1 addition & 0 deletions examples/GxEPD_SD_Example/GxEPD_SD_Example.ino
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ SdFat SD;
//#include <GxGDEW0213Z16/GxGDEW0213Z16.h> // 2.13" b/w/r
//#include <GxGDEH029A1/GxGDEH029A1.h> // 2.9" b/w
//#include <GxGDEW029T5/GxGDEW029T5.h> // 2.9" b/w IL0373
//#include <GxGDEM029T94/GxGDEM029T94.h> // 2.9" b/w
//#include <GxGDEW029Z10/GxGDEW029Z10.h> // 2.9" b/w/r
//#include <GxGDEW026T0/GxGDEW026T0.h> // 2.6" b/w
//#include <GxGDEW027C44/GxGDEW027C44.h> // 2.7" b/w/r
Expand Down
66 changes: 42 additions & 24 deletions examples/GxEPD_WiFi_Example/GxEPD_WiFi_Example.ino
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
//#include <GxGDEW0213Z16/GxGDEW0213Z16.h> // 2.13" b/w/r
//#include <GxGDEH029A1/GxGDEH029A1.h> // 2.9" b/w
//#include <GxGDEW029T5/GxGDEW029T5.h> // 2.9" b/w IL0373
//#include <GxGDEM029T94/GxGDEM029T94.h> // 2.9" b/w
//#include <GxGDEW029Z10/GxGDEW029Z10.h> // 2.9" b/w/r
//#include <GxGDEW026T0/GxGDEW026T0.h> // 2.6" b/w
//#include <GxGDEW027C44/GxGDEW027C44.h> // 2.7" b/w/r
Expand Down Expand Up @@ -105,16 +106,41 @@ const char* ssid = "........";
const char* password = "........";
const int httpPort = 80;
const int httpsPort = 443;
const char* fp_api_github_com = "35 85 74 EF 67 35 A7 CE 40 69 50 F3 C0 F6 80 CF 80 3B 2E 19";
const char* fp_github_com = "ca 06 f5 6b 25 8b 7a 0d 4f 2b 05 47 09 39 47 86 51 15 19 84";
#if USE_BearSSL
const char fp_rawcontent[20] = {0xcc, 0xaa, 0x48, 0x48, 0x66, 0x46, 0x0e, 0x91, 0x53, 0x2c, 0x9c, 0x7c, 0x23, 0x2a, 0xb1, 0x74, 0x4d, 0x29, 0x9d, 0x33};
#else
const char* fp_rawcontent = "cc aa 48 48 66 46 0e 91 53 2c 9c 7c 23 2a b1 74 4d 29 9d 33";
#endif
const char* fp_api_github_com = "df b2 29 c6 a6 38 1a 59 9d c9 ad 92 2d 26 f5 3c 83 8f a5 87"; // as of 25.11.2020
const char* fp_github_com = "5f 3f 7a c2 56 9f 50 a4 66 76 47 c6 a1 8c a0 07 aa ed bb 8e"; // as of 25.11.2020
const char* fp_rawcontent = "70 94 de dd e6 c4 69 48 3a 92 70 a1 48 56 78 2d 18 64 e0 b7"; // as of 25.11.2020

// how to find the certificate was not easy. finally I found it using Mozilla Firefox.
// opened one of the bitmaps, e.g. https://raw.githubusercontent.com/ZinggJM/GxEPD2/master/extras/bitmaps/logo200x200.bmp
// clicked the lock symbol, Connection secure clicked >, show connection details, clicked More Information, clicked View Certificate, clicked Download PEM (chain),
// selected Open with Notepad. Copied the middle certificate and editted to the following format:
// the number of characters per line is of no importance, but the 3 \n are needed
const char* certificate_rawcontent =
"-----BEGIN CERTIFICATE-----\n"
"MIIEsTCCA5mgAwIBAgIQBOHnpNxc8vNtwCtCuF0VnzANBgkqhkiG9w0BAQsFADBsMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGln"
"aUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5jZSBFViBS"
"b290IENBM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QYJKoZIhvcNAQELBQADggEBABiKlYkD5m3fXPwdaOpKj4PWUS+Na0QWnqxj"
"9dJubISZi6qBcYRb7TROsLd5kinMLYBq8I4g4Xmk/gNHE+r1hspZcX30BJZr01lYPf7TMSVcGDiEo+afgv2MW5gxTs14nhr9hctJ"
"qvIni5ly/D6q1UEL2tU2ob8cbkdJf17ZSHwD2f2LSaCYJkJA69aSEaRkCldUxPUd1gJea6zuxICaEnL6VpPX/78whQYwvwt/Tv9X"
"BZ0k7YXDK/umdaisLRbvfXknsuvCnQsH6qqF0wGjIChBWUMo0oHjqvbsezt3tkBigAVBRQHvFwY+3sAzm2fTYS5yh+Rp/BIAV0AecPUeybQ=\n"
"-----END CERTIFICATE-----\n";


const char* host_rawcontent = "raw.githubusercontent.com";
const char* path_rawcontent = "/ZinggJM/GxEPD2/master/extras/bitmaps/";
const char* path_prenticedavid = "/prenticedavid/MCUFRIEND_kbv/master/extras/bitmaps/";
const char* path_waveshare_c = "/waveshare/e-Paper/master/RaspberryPi_JetsonNano/c/pic/";
const char* path_waveshare_py = "/waveshare/e-Paper/master/RaspberryPi_JetsonNano/python/pic/";

void showBitmapFrom_HTTP(const char* host, const char* path, const char* filename, int16_t x, int16_t y, bool with_color = true);
void showBitmapFrom_HTTPS(const char* host, const char* path, const char* filename, const char* fingerprint, int16_t x, int16_t y, bool with_color = true);
Expand Down Expand Up @@ -241,11 +267,14 @@ void drawBitmaps_test()
delay(2000);
}

static const uint16_t input_buffer_pixels = 640; // may affect performance
static const uint16_t input_buffer_pixels = 800; // may affect performance

static const uint16_t max_row_width = 1448; // for up to 6" display 1448x1072
static const uint16_t max_palette_pixels = 256; // for depth <= 8

uint8_t input_buffer[3 * input_buffer_pixels]; // up to depth 24
uint8_t output_row_mono_buffer[max_row_width / 8]; // buffer for at least one row of b/w bits
uint8_t output_row_color_buffer[max_row_width / 8]; // buffer for at least one row of color bits
uint8_t mono_palette_buffer[max_palette_pixels / 8]; // palette buffer for depth <= 8 b/w
uint8_t color_palette_buffer[max_palette_pixels / 8]; // palette buffer for depth <= 8 c/w

Expand Down Expand Up @@ -485,28 +514,17 @@ void drawBitmapFrom_HTTPS_ToBuffer(const char* host, const char* path, const cha
if ((x >= display.width()) || (y >= display.height())) return;
display.fillScreen(GxEPD_WHITE);
Serial.print("connecting to "); Serial.println(host);
#if USE_BearSSL
if (fingerprint) client.setFingerprint((uint8_t*)fingerprint);
#if defined (ESP8266)
client.setBufferSizes(4096, 4096); // doesn't help
if (fingerprint) client.setFingerprint(fingerprint);
#elif defined (ESP32)
if (certificate) client.setCACert(certificate);
#endif
if (!client.connect(host, httpsPort))
{
Serial.println("connection failed");
return;
}
#if defined (ESP8266) && !USE_BearSSL
if (fingerprint)
{
if (client.verify(fingerprint, host))
{
Serial.println("certificate matches");
}
else
{
Serial.println("certificate doesn't match");
return;
}
}
#endif
Serial.print("requesting URL: ");
Serial.println(String("https://") + host + path + filename);
client.print(String("GET ") + path + filename + " HTTP/1.1\r\n" +
Expand Down
2 changes: 2 additions & 0 deletions examples/GxFont_GFX_Example/GxFont_GFX_Example.ino
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
//#include <GxGDEH0213B72/GxGDEH0213B72.h> // 2.13" b/w new panel
//#include <GxGDEW0213Z16/GxGDEW0213Z16.h> // 2.13" b/w/r
//#include <GxGDEH029A1/GxGDEH029A1.h> // 2.9" b/w
//#include <GxGDEW029T5/GxGDEW029T5.h> // 2.9" b/w IL0373
//#include <GxGDEM029T94/GxGDEM029T94.h> // 2.9" b/w
//#include <GxGDEW029Z10/GxGDEW029Z10.h> // 2.9" b/w/r
//#include <GxGDEW027C44/GxGDEW027C44.h> // 2.7" b/w/r
//#include <GxGDEW027W3/GxGDEW027W3.h> // 2.7" b/w
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
//#include <GxGDEW0213Z16/GxGDEW0213Z16.h> // 2.13" b/w/r
//#include <GxGDEH029A1/GxGDEH029A1.h> // 2.9" b/w
//#include <GxGDEW029T5/GxGDEW029T5.h> // 2.9" b/w IL0373
//#include <GxGDEM029T94/GxGDEM029T94.h> // 2.9" b/w
//#include <GxGDEW029Z10/GxGDEW029Z10.h> // 2.9" b/w/r
//#include <GxGDEW026T0/GxGDEW026T0.h> // 2.6" b/w // NOTE: does not compile for UNO: segmentation fault, reason unknown
//#include <GxGDEW027C44/GxGDEW027C44.h> // 2.7" b/w/r
Expand Down
1 change: 1 addition & 0 deletions examples/PartialUpdateExample/PartialUpdateExample.ino
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
//#include <GxGDEH0213B73/GxGDEH0213B73.h> // 2.13" b/w newer panel
//#include <GxGDEH029A1/GxGDEH029A1.h> // 2.9" b/w
//#include <GxGDEW029T5/GxGDEW029T5.h> // 2.9" b/w IL0373
//#include <GxGDEM029T94/GxGDEM029T94.h> // 2.9" b/w
//#include <GxGDEW026T0/GxGDEW026T0.h> // 2.6" b/w
//#include <GxGDEW027W3/GxGDEW027W3.h> // 2.7" b/w
//#include <GxGDEW0371W7/GxGDEW0371W7.h> // 3.7" b/w
Expand Down
6 changes: 4 additions & 2 deletions examples/PartialUpdateTest/PartialUpdateTest.ino
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@

// select the display class to use, only one
//#include <GxGDEP015OC1/GxGDEP015OC1.h>
#include <GxGDEH0154D67/GxGDEH0154D67.h>
//#include <GxGDEH0154D67/GxGDEH0154D67.h>
//#include <GxGDE0213B1/GxGDE0213B1.h>
//#include <GxGDEH029A1/GxGDEH029A1.h>
//#include <GxGDEW029T5/GxGDEW029T5.h> // 2.9" b/w IL0373
//#include <GxGDEM029T94/GxGDEM029T94.h> // 2.9" b/w
//#include <GxGDEW042T2/GxGDEW042T2.h>

#include <GxIO/GxIO_SPI/GxIO_SPI.h>
Expand Down Expand Up @@ -103,7 +105,7 @@ GxEPD_Class display(io /*RST=9*/ /*BUSY=7*/); // default selection of (9), 7
#if defined(_GxGDEP015OC1_H_) || defined(_GxGDEH0154D67_H_)
const uint32_t partial_update_period_s = 1;
const uint32_t full_update_period_s = 6 * 60 * 60;
#elif defined(_GxGDE0213B1_H_) || defined(_GxGDEH029A1_H_) || defined(_GxGDEW042T2_H_)
#elif defined(_GxGDE0213B1_H_) || defined(_GxGDEH029A1_H_) || defined(_GxGDEM029T94_H_) || defined(_GxGDEW042T2_H_)
const uint32_t partial_update_period_s = 2;
const uint32_t full_update_period_s = 1 * 60 * 60;
#endif
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=GxEPD
version=3.1.0
version=3.1.1
author=Jean-Marc Zingg
maintainer=Jean-Marc Zingg
sentence=Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare.
Expand Down
Loading

0 comments on commit 3e80e90

Please sign in to comment.