E-Paper and ESP8266 library communication

Hello! I am working on an E-Paper that the board is ESP8266, I am using the ESP8266WIFi library, and want it to print Message with E-Paper. So, the problem is the that the WiFi is not connected and E-Paper shows nothing, hope you can reach me out.
The ESP8266 is NodeMCU
The E-apper is 1.54 inch, GDEH0154D67, 200x200

The esp8266 NodeMCU library:
https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/ESP8266WiFi.h
The reference page : ESP8266: HTTP GET Requests - techtutorialsx
The board manager: Quick Start to Nodemcu (ESP8266) on Arduino IDE : 3 Steps (with Pictures) - Instructables

The E-Paper library: https://github.com/ZinggJM/GxEPD2/tree/master/examples

Reminder :
The E-Paper can print text and images itself on Mega Arduino, and ESP8266 can connect with server.
When use the these libraries, the ESP8266 keeps saying connection and E-Paper shows nothing as shown below.
I was wondering what is the problem here? My pin connection is wrong? Btw, I want to stick to this ESP8266 library.

Thank you !

The code as follows:

Program code:

//------------------------E-Paper--------------------------------
#include <GxEPD2_BW.h>
#include <Fonts/FreeMonoBold9pt7b.h>
#define ENABLE_GxEPD2_GFX 0
#define MAX_DISPLAY_BUFFER_SIZE 800
#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8))

//-----------------------GxEPD2_WiFi_Example/GxEPD2_wiring_examples.h----------------------------
// 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  
GxEPD2_BW<GxEPD2_154_D67, MAX_HEIGHT(GxEPD2_154_D67)> display(GxEPD2_154_D67(/*CS=10*/ 16, /*DC=*/ 18, /*RST=*/ 17, /*BUSY=*/ 19)); // GDEH0154D67 200x200


#define GxEPD2_DISPLAY_CLASS GxEPD2_BW
#define GxEPD2_DRIVER_CLASS GxEPD2_154_D67 // GDEH0154D67 200x200
#define GxEPD2_BW_IS_GxEPD2_BW true
#define IS_GxEPD(c, x) (c##x)
#define IS_GxEPD2_BW(x) IS_GxEPD(GxEPD2_BW_IS_, x)
//#if defined (ESP8266)
#define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-34000ul) // ~34000 base use, WiFiClientSecure seems to need about 34k more to work
#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS)
#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8))
#endif
#if defined (ESP8266)
#include <ESP8266WiFi.h>
#define USE_BearSSL true
#endif

#include <WiFiClient.h>
#include <WiFiClientSecure.h>
//----------------------------------The ESP8266 NodeMCU setting------------------------------------------------ 
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>

const char* ssid = "yourNetworkName";
const char* password = "yourNetworkPassword";

void setup () {
 
  Serial.begin(19200);
 
  WiFi.begin(ssid, password);
 
  while (WiFi.status() != WL_CONNECTED) {
 
    delay(1000);
    Serial.print("Connecting..");
 
  }
//-----------------------------The E-Paper printing Part------------------------------------------------
  display.init();
  delay(1000);
  //display.setFullWindow();
  display.firstPage();
  do {
  // this part of code is executed multiple times, as many as needed, in case of full buffer it is executed once

    display.drawRect(75,75,50,50,GxEPD_BLACK); // A rectangle should be shown on E-Paper
   
  } while (display.nextPage());
  
  display.powerOff();
}



//-----------------------------The ESP8266 NodeMCU setting----------------------------------------------
void loop() {
 
  if (WiFi.status() == WL_CONNECTED) { //Check WiFi connection status
 
    HTTPClient http;  //Declare an object of class HTTPClient
 
    http.begin("http://jsonplaceholder.typicode.com/users/1");  //Specify request destination
    int httpCode = http.GET();                                  //Send the request
 
    if (httpCode > 0) { //Check the returning code
 
      String payload = http.getString();   //Get the request response payload
      Serial.println(payload);             //Print the response payload
 
    }
 
    http.end();   //Close connection
    
 
  }
 
  delay(30000);    //Send a request every 30 seconds
}

Error Message:

Arduino: 1.8.13 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"

Executable segment sizes:

IROM   : 263576          - code in flash         (default or ICACHE_FLASH_ATTR) 

IRAM   : 27340   / 32768 - code in IRAM          (ICACHE_RAM_ATTR, ISRs...) 

DATA   : 1260  )         - initialized variables (global, static) in RAM/HEAP 

RODATA : 916   ) / 81920 - constants             (global, static) in RAM/HEAP 

BSS    : 26352 )         - zeroed variables      (global, static) in RAM/HEAP 

Sketch uses 293092 bytes (28%) of program storage space. Maximum is 1044464 bytes.

Global variables use 28528 bytes (34%) of dynamic memory, leaving 53392 bytes for local variables. Maximum is 81920 bytes.

esptool.py v2.8

Serial port COM6

Connecting........_____....._____....._____....._____....._____....._____.....____Traceback (most recent call last):

  File "C:\Users\johnson\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4/tools/upload.py", line 65, in <module>

    esptool.main(cmdline)

  File "C:/Users/johnson/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool\esptool.py", line 2890, in main

    esp.connect(args.before)

  File "C:/Users/johnson/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool\esptool.py", line 483, in connect

    raise FatalError('Failed to connect to %s: %s' % (self.CHIP_NAME, last_error))

esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header

_

the selected serial port _

 does not exist or your board is not connected



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header

_

the selected serial port _

 does not exist or your board is not connected

You might start with trying to figure out the why the selected serial port is not doing the thing. If the serial port does not do the thing then the program does not get uploaded and the WiFi and epaper display will not do their thing.

An image of your set up would be great.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.