Vision master E213 can not work e ink display with wi-fi togther

I have a Vision Master E213 that keeps restarting when I run code that includes both Wi-Fi and the “HT_lCMEN2R13EFC1.h” (e ink display) library. Sometimes it restarts after 5 seconds, other times after 10 seconds, so the timing is not fixed.

I tested running the e-ink display code without Wi-Fi, and it worked fine. I also tested Wi-Fi alone, and it worked without any issues.

Something weird is happening when these two are combined, causing the issue.

this the code i used
wi fi + e ink display

#include "HT_lCMEN2R13EFC1.h"

#include "images.h"

// Initialize the display

HT_ICMEN2R13EFC1 display(3, 2, 5, 1, 4, 6, -1, 6000000); // rst,dc,cs,busy,sck,mosi,miso,frequency

typedef void (*Demo)(void);

/* screen rotation

 * ANGLE_0_DEGREE

 * ANGLE_90_DEGREE

 * ANGLE_180_DEGREE

 * ANGLE_270_DEGREE

 */

#define DIRECTION ANGLE_0_DEGREE

int width, height;

int demoMode = 0;

void setup()

{

  Serial.begin(115200);

  if (DIRECTION == ANGLE_0_DEGREE || DIRECTION == ANGLE_180_DEGREE)

  {

    width = display._width;

    height = display._height;

  }

  else

  {

    width = display._height;

    height = display._width;

  }

  VextON();

  delay(100);

  // Initialising the UI will init the display too.

  display.init();

  display.screenRotate(DIRECTION);

  display.setFont(ArialMT_Plain_10);

}

void drawFontFaceDemo()

{

  // Font Demo1

  // create more fonts at http://oleddisplay.squix.ch/

  display.clear();

  display.setTextAlignment(TEXT_ALIGN_LEFT);

  display.setFont(ArialMT_Plain_10);

  display.drawString(0, 0, "Hello world");

  display.setFont(ArialMT_Plain_24);

  display.drawString(0, 26, "Hello world");

  //    display.update(BLACK_BUFFER);

  display.setFont(ArialMT_Plain_16);

  display.drawString(0, 10, "Hello world");

  display.update(BLACK_BUFFER);

  display.display();

}

void drawTextFlowDemo()

{

  display.clear();

  display.setFont(ArialMT_Plain_10);

  display.setTextAlignment(TEXT_ALIGN_LEFT);

  display.drawStringMaxWidth(0, 0, 128,

                             "Lorem ipsum\n dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore.");

  display.update(BLACK_BUFFER);

  display.update(COLOR_BUFFER);

  display.display();

}

void drawTextAlignmentDemo()

{

  // Text alignment demo

  display.clear();

  char str[30];

  int x = 0;

  int y = 0;

  display.setFont(ArialMT_Plain_10);

  // The coordinates define the left starting point of the text

  display.setTextAlignment(TEXT_ALIGN_LEFT);

  display.drawString(x, y, "Left aligned (0,0)");

  // The coordinates define the right end of the text

  display.setTextAlignment(TEXT_ALIGN_RIGHT);

  x = width;

  y = height - 12;

  sprintf(str, "Right aligned (%d,%d)", x, y);

  display.drawString(x, y, str);

  display.update(BLACK_BUFFER);

  // The coordinates define the center of the text

  display.setTextAlignment(TEXT_ALIGN_CENTER);

  x = width / 2;

  y = height / 2 - 5;

  sprintf(str, "Center aligned (%d,%d)", x, y);

  display.drawString(x, y, str);

  display.update(COLOR_BUFFER);

  display.display();

}

void drawRectDemo()

{

  display.clear();

  // Draw a pixel at given position

  for (int i = 0; i < 10; i++)

  {

    display.setPixel(i, i);

    display.setPixel(10 - i, i);

  }

  display.drawRect(12, 12, 20, 20);

  // Fill the rectangle

  display.fillRect(14, 14, 17, 17);

  // Draw a line horizontally

  display.drawHorizontalLine(0, 40, 20);

  // Draw a line horizontally

  display.drawVerticalLine(40, 0, 20);

  display.update(BLACK_BUFFER);

  display.update(COLOR_BUFFER);

  display.display();

}

void drawCircleDemo()

{

  int x = width / 4;

  int y = height / 2;

  display.clear();

  for (int i = 1; i < 8; i++)

  {

    display.setColor(WHITE);

    display.drawCircle(x, y, i * 3);

    if (i % 2 == 0)

    {

      display.setColor(BLACK);

    }

  }

  display.update(BLACK_BUFFER);

  x = width / 4 * 3;

  for (int i = 1; i < 8; i++)

  {

    display.setColor(WHITE);

    if (i % 2 == 0)

    {

      display.setColor(BLACK);

    }

    display.fillCircle(x, y, 32 - i * 3);

  }

  display.update(COLOR_BUFFER);

  display.display();

}

void drawImageDemo()

{

  // see http://blog.squix.org/2015/05/esp8266-nodemcu-how-to-create-xbm.html

  // on how to create xbm files

  display.clear();

  display.update(BLACK_BUFFER);

  display.clear();

  int x = width / 2 - WiFi_Logo_width / 2;

  int y = height / 2 - WiFi_Logo_height / 2;

  display.drawXbm(x, y, WiFi_Logo_width, WiFi_Logo_height, WiFi_Logo_bits);

  display.update(COLOR_BUFFER);

  display.display();

}

void VextON(void)

{

  pinMode(18, OUTPUT);

  digitalWrite(18, HIGH);

}

void VextOFF(void) // Vext default OFF

{

  pinMode(18, OUTPUT);

  digitalWrite(18, LOW);

}

Demo demos[] = {drawFontFaceDemo, drawTextFlowDemo, drawTextAlignmentDemo, drawRectDemo, drawCircleDemo, drawImageDemo};

int demoLength = (sizeof(demos) / sizeof(Demo));

long timeSinceLastModeSwitch = 0;

void loop()

{

  // draw the current demo method

  demos[demoMode]();

  demoMode = (demoMode + 1) % demoLength;

  delay(15000);

}

Hi,

Mee too having same issue. it is after call display.display(); restarting as i observed.

Regards,
Raghav

Hi,

i did finally make it work. since WiFi is the problem, I do retrieve data, disconnect Wifi and then display.

sample here you go

#include "HT_lCMEN2R13EFC1.h"
#include <WiFi.h>

// Initialize the OLED display (modify pins if needed)
HT_ICMEN2R13EFC1 display(6, 5, 4, 7, 3, 2, -1, 6000000);

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

void setup() {
  Serial.begin(115200);
  /*************************/
  connectToWiFi();
  /*************************/

  VextON();         // Enable external power for OLED
  delay(100);       // Stabilize power
  SPI.begin();      // Initialize SPI bus
  display.init();   // Initialize OLED display
  display.clear();
}

void connectToWiFi() {
  WiFi.mode(WIFI_STA);
  WiFi.setSleep(false);
  WiFi.begin(ssid, password);
  Serial.print("Connecting to WiFi...");
  int retries = 0;
  while (WiFi.status() != WL_CONNECTED && retries < 20) {  // Try for 10 seconds
    delay(500);
    Serial.print(".");
    retries++;
  }

  if (WiFi.status() == WL_CONNECTED) {
    Serial.println("\nConnected to WiFi!");
    Serial.print("IP Address:");
    Serial.println(WiFi.localIP());
  } else {
    Serial.println("\nFailed to connect to WiFi!");
  }
}

void loop() {
  //reconnect WiFi
  if (WiFi.status() != WL_CONNECTED) {
      Serial.println("WiFi Disconnected! Reconnecting...");
      connectToWiFi();
  }
  delay(500);

  /*************
  fetch data from REST API call and send it to displayMessage()
  *************/

  displayMessage("I am working");
  delay(60000);
}

// Power Management Functions
void VextON() {
  pinMode(45, OUTPUT);
  digitalWrite(45, LOW);
}

void VextOFF() { // Default OFF
  pinMode(45, OUTPUT);
  digitalWrite(45, HIGH);
}

void displayMessage(String message) {
  //disconnecting WiFi before display
  WiFi.disconnect(true);
  display.clear();
  display.setFont(ArialMT_Plain_16);
  display.drawString(50, 30, message);
  display.update(BLACK_BUFFER);
  display.display();
}
1 Like

unfortunately i am getting the same problem when i used your code once it show the ip it keep restating

Hi,

Is it continuously restarting without stopping? i also had similar problem. i did solved by using board not from Heltec used default esp32

As highlighted try using same selection and in setup make sure

Serial.begin(115200);

i am not sure “LoRaWan region” affects or not didn’t try. I just followed https://docs.heltec.org/en/node/esp32/wireless_paper/via_web_refresh.html

Hope it helps.

I am having a similar problem. When running the “weather_station” example (Heltec ESP32 Dev-Boards->VME213->weather_station), the board continually and randomly resets. Also, after the first image is displayed, Serial.print() calls are no longer displayed on the Arduino Serial Monitor.

The use of Serial.print() shows similar behavior on other examples and even my own code that runs perfectly on a Heltec LoRA ESP32 V3.

Is there a conflict between USB and Display usage?