E-paper display

My second project, many thanks to @digitalurban for printing me some cases


This required a custom font to get the strava logo and I had to figure out how to retrieve the unicode for the glyph.

The code for this one, if anyone is interested is here :

2 Likes

how do you simply download from a given website a BMP file and display it on an e-paper screen…
I guess the downloading part is not the issue but you’re stuck somewhere in the displaying part?

I guess your sample code is not enough spoonfeeding.

@nickrout thank you for the kind words!
@goosst the downloading part indeed wasn’t the issue, the 4.7 EPD uses a new kind of library, different from the waveshare screens, where the image is stored on 4bits gray level with 2 pixel aggregated per byte. That gave me a hard time to decode the BMP in the right format, and I figured since I needed a few image manipulations before displaying I’d be better off doing it on my server (RbPi) with a python script then feed the transformed file directly to the EPD - which is what I ended up doing! But your code was a great starting point and inspiration.

1 Like

Hello,

I followed a different approach. I have a docker running which turns any lovelace dashboard into a png. The png is loaded onto the esp/eink. Doing so everyone can easily create any lovelace which appears on the eink display.

Inkplate6 to display Lovelace UI - Hardware - Home Assistant Community (home-assistant.io)

Yours sincerely.
Ralf

1 Like

just wanted to share my own work in progress:

full code and basic documentation can be found in my repo: https://github.com/krikk/esp32_E-Paper_Display/

6 Likes

The wood looks way better than my print.

@krikk

Custom build wooden Case (thanks to my father!)

Please put your father on github.

6 Likes

Work in progress but information on Solar, Temp, Tempest weather station, water usage, mower and more

14 Likes

Crispy! :+1: Looks great, what display is this? :slight_smile:

If that’s what I think it is in the bottom right (Robot Lawnmower?), I am exceedingly jealous!!!

edit: Oh, and the display looks sharp too!

Waveshare 7.5 v2

1 Like

Yes its my Landroid lawnmower I’m getting the data from the home assistant integration. More to come but I think I really got the picture right on the display for that. :blush:

1 Like

Hello,
I would like to know if it is possible to invert black and white?
(I want a black background and white text).
Thank you.

How long does the device run on battery?

doing an update every minute from 6-22h and every 5 min from 22-6 h:

started 25.3, battery out on: 20.4 :frowning:

…ordered another set of batteries :slight_smile:

…but there is a lot of potential to optimize power consumtion… e.g. only update on presence, no screen update in nights…

1 Like

How do you control the update of these displays? I haven’t found anything except the full_update_every setting, which doesn’t allow for controlling the update.

@Laurenthu , would mind to share your ESP Easy code? I just got the exact same 4.7 EPD as you, and I’m strugling a bit to make it work on my Home Assistant…
Thanks!

you can do manual updates, see my code in my repo: https://github.com/krikk/esp32_E-Paper_Display/

Frankly the code is a mess, but here are the most important pieces:

void showBitmapFrom_HTTP_fubar(IPAddress hass, const char* path, String filename, bool with_color)
{
  WiFiClient client;
  
  int port_fub = 8123;
  bool connection_ok = false;
  bool valid = false; // valid format to be handled
  bool flip = true; // bitmap is stored bottom-to-top
  uint32_t startTime = millis();
  //  if ((x >= display.width()) || (y >= display.height())) return;
  Serial.println(); Serial.print("downloading file \""); Serial.print(filename);  Serial.println("\"");
  Serial.print("connecting to "); Serial.println(hass);

  if (!client.connect(hass, port_fub))
  {
    Serial.println("connection failed");
    return;
  }
  Serial.print("requesting URL: ");


  String fubar = String("GET ") + "http://" + hass.toString() + path + filename  + " HTTP/1.1\r\n" +
                 "Connection: close\r\n\r\n";

  client.print(fubar);
  while (client.connected())
  {
    Serial.println("connected to client");

    String line = client.readStringUntil('\n');

    if (!connection_ok)
    {
      connection_ok = line.startsWith("HTTP/1.1 200 OK");
      if (connection_ok) Serial.println(line);

    }
    if (!connection_ok) Serial.println(line);

    if (line == "\r")
    {
      Serial.println("headers received");
      break;
    }
  }

  delay(30);
  uint32_t width  = read32(client);
  uint32_t height = read32(client);
  int idx = 0;
  Serial.print("Width : "); Serial.print(width) ; Serial.print("Height : ");Serial.print(height);
  if (width > 960) return;
  if (height > 540) return;
  for (uint16_t row = 0; row < height; row++) // for each line
  {
    for (uint16_t col = 0; col < width/2; col++) // for each pixel
    {
      if (client.available()) {
        framebuffer[idx] = client.read();
        idx++;
      }  
    }
  }
  Rect_t area = {.x = 0,.y = 0, .width = width,.height =  height};
  Serial.print("we received everything, doing a clear and draw now");
  if (DrawingSomethingNew)
    {
      epd_clear();
      epd_clear();
      epd_clear();
      epd_clear();
    }
  epd_clear();
  epd_draw_grayscale_image(area, (uint8_t *) framebuffer);


  PreviousScreenNumber = ScreenNumber;
  DrawingSomethingNew = false;
 
}

This is all in Arduino IDE 1.8.13…
And I previously transform BMP files into a 16 grayscale buffer file on the server side!