Firmware for Espressif boards without Bluetooth

We believe that embedded software has to be solid, simple and secure.
That's why since we started developing CALE, there where many experiments tested, including Zlib compression and other interesting features, like sending WiFi configuration via Bluetooth or making the ESP32 a Server for some minutes and let the user send a custom text or website URL to render in the display.
But for this version the decision was to leave everything out and leave only the essential, that is:

  • A way to stream a binary image from an external URL into ESP32/ESP8266 (WiFi.h / WiFiClient.h)
  • An interpreter that reads this Bitmap and prepares a Buffer for the display (based on gxEPD library examples)
  • An authorization Token to make sure you don't need to leave your Calendar events open to the world (Bearer token)
The part that still not fully tested and hence not included on this release, is to add the WiFi Secure Client so we can send this token with TLS encryption over secure socket layer.


The open source Firmware is here:

https://github.com/martinberlin/eink-calendar - cale branch

How to compile and upload to your board

We assume that you are familiar with the installation of Platformio that is a great IDE to upload firmware to your boards and also to keep your dependencies contained in your project. The configuration is not complicated. After downloading just rename:
lib/Config/Config.h.dist to
Config.h

and fill it with your WiFi name and password.

The most important part of the configuration is to copy the image URL from CALE "Render Screen" section into the configuration. Just click on the Bitmap URL for the ESP32 to select all and copy it into the screenUrl and do the same with the Bearer token if you are using a private Screen:
    char screenUrl[] = "http://img.cale.es/bmp/USERNAME/SCREEN_ID";

    // Security setting, leave empty *only* if your screen is public (Not recommended)
    String bearer = "";




Logging of the internal ESP32 IP Address
By default CALE is logging the internal IP Address since it may be useful for statistics and to identify your device image requests from the administration image requests. If for any reason you want to disable this just comment this line on the Config file:
#define ENABLE_INTERNAL_IP_LOG



Selecting the right driver for your display
We prepared the Config file so you can just uncomment a single line to select the right gxEPD class for your display. For example to use a Waveshare or Good display 7.5 of 800x480 pixels, uncomment:
#define GDEW075T7    // 7.5" b/w 800x480
Leave all the others models commented. This way you are already inserting the right include for your E-Ink display.
GPIOs for the E-Ink SPI interface
Wiring the E-Ink SPI to the Espressif board is not super complicated. The E-Ink SPI has 6 cables plus VIN that should be connected to the 3.3v of your board plus ground. The E-Ink consume really little so you can test this always with the USB until you decide to connect a Lipo 3.7v battery.
    // Configuration example for ESP32 TinyPICO:
    int8_t EINK_CS = 5;
    int8_t EINK_DC = 22;
    int8_t EINK_RST = 21;
    int8_t EINK_BUSY = 4;

    // Handles display rotation
    int8_t eink_rotation = 0;
    
Using gxEPD library the DataIn from the display should be connected to MOSI in your board (In ESP32 is GPIO 23)
And display clock should be wired to GPIO 18 in the ESP32 (CLK). Please check the schematics below to understand how it should be wired the E-Ink SPI interface to the Espressif board.
For more detailed configuration notes please check the repository README file.

Keep your events and API content private

Note that we don't recommend to use public screens since your calendar may contain private information like events, bank transfers annotations or doctor appointments that you should not open to the world to see. So use always a security token.

ESP32 Schematic

You can use any ESP32. The only requirement if you want your CALE to have a long battery life is that consumes less than 0.8 mA in deeepsleep mode.


ESP8266 Schematic