Coder Social home page Coder Social logo

martinberlin / cale-idf Goto Github PK

View Code? Open in Web Editor NEW
267.0 267.0 24.0 17.08 MB

CalEPD is an Epaper component driver for the ESP-IDF framework with GFX and font support, optional touch interface, compatible with ESP32 / S2 / S3 / C3

Home Page: https://fasani.de

License: Apache License 2.0

CMake 0.16% Makefile 0.03% C++ 23.31% C 76.47% Shell 0.03%
eink epaper esp-idf esp32 esp32s2 espressif

cale-idf's Introduction

Hi there 👋

  • 🔭 I’m currently working on making hardware PCB adapters
  • 🌱 Learning more C, C++ and Symfony framework UX Live (PHP 8)
  • 👯 Looking to collaborate on interesting embedded products and funding open source libraries that make our work easier
  • 💬 Ask me about eink controllers and Espressif chips (epdiy open source epaper controller)
  • 📫 How to reach me: martin AT cale.es
  • 💭 If you want to generate dynamic images for your displays try CALE.es

martinberlin GitHub stats

cale-idf's People

Contributors

adrien3d avatar dominicd avatar martinberlin avatar thebino avatar usefulelectronics avatar xeijin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cale-idf's Issues

Rainmaker WiFi provisioning: Add NVS counter of WiFi connect failures

Is your feature request related to a problem? Please describe.
When using Rainmaker, if the user changes the router configuration credentials, without clearing credentials first in ESP rainmaker app then it enters in a restart loop. Because it cannot connect but also can’t clear the WiFi configuration in order to entern Blietppth provisioning mode.

Describe the solution you'd like
The solution would be to have a WiFi failed connect counter that is stored in Non Volatine Storage, that when reaches 100 failed connections, clears the WiFi configuration and restarts. The issue with this is, is that it might clear credentials in a moment where the user does not want, simply becau It’s normal that from time to time the connect to WiFi process fails.

Class to send SPI data to T-Con eink dot com/ GD GDEW101C01

Change of strategy here: First focus is communicating with the existing Waveshare eink dot com T-Con raw epapers. GxEPD 2 has already the right commands:
https://github.com/ZinggJM/GxEPD2/tree/master/src/it8951
iC controller is IT8959 that converts SPI to parallel. Needs 4 wire SPI and optimizing existing implementation will be a great way to get familiar with this controllers.

Model: Goodisplay GDEW101C01 10.1 inch epaper display DES full color
Resolution: 2232x1680
Buffer is different from other color epapers: 12 bit per pixel
Red: 4 bits Green: 4 bits Blue: 4 bits

This will not communicate with the epaper directly. A Waveshare HAT will be in the middle that will act as an SPI to 16 parallel bus converter.

Note due to the big buffer:
2232*1680 * 12 bit / 8 (bits per byte): 5624640 bytes it won't fit in PSRAM.

If that is the case then reduce height to a more appropriate number and send and empty buffer for the rest of the data.
Ex. 2232*1180: 3950640 bytes buffer

Note: The buffer can be wrongly calculated. Here a new theory after comparing with the Kaleido technology that is similar to DES.

GDEW042T2 Grays class

This will be the container for GDEW042T2 4 grays class.
It comes from a dubious SMT32 example from Good display. Grays come out but there is some problem with drawPixel still.

Check drawPixel function, it's skipping pixels, it won't draw a Circle right.
Do not base this in example from 7.5 inches.

Video demo

Class 1st iteration finished. Preview:

GDEW042T2

BMP format 1 - BI_RLE8

Research if there is a way to read a format 1 BMP. According to Wikipedia:

  | BI_RLE8 | RLE 8-bit/pixel | Can be used only with 8-bit/pixel bitmaps

Or just find a way to disable compression in imageMagic conversion on the web-service side

060/100 Design the classmap. Each display model needs to implement Epd interface

Kickstarted the idea in branch
https://github.com/martinberlin/cale-idf/tree/refactor/oop

For now each display will extend Adafruit GFX, so we have basic draw functions and font support.

Would be great also to make an IO base class - Not sure about this one since they are only 3 functions that could be just placed in the abstract class
Classmap is on the works. Just as a reference:

Epd main abstract implements Adafruit GFX implements Print
v
gdew02135f implements Epd in the constructor passes Width, Height to Adafruit GFX

classmap

Note:
For compatibility with GxEPD we will use the same class names just in small case and without the gx prefix (But also not Cal prefix, just plain model name)

Make a demo-sleep-clock.cpp example

Simple example to make an epaper clock that will initially make a request to internet to get the time. And then will update every N minutes refreshing the epaper display.
The objective of this is just to make an additional epaper demo and have some fun along the way. By no means this will be a precise clock!

  1. If is 00 hours or there is a IO button low force internet sync time
  2. Wakeup and increment the clock. Render super fast updating only that part of the epaper
  3. Keep hour / minute in the EPROM
  4. Go to deepsleep N minutes -> Repeat 1

1 day sprint. Max 2 days including release. Pending list:

  • Add zero padding to digits <9 - Wrong should be of course when <10
  • Add internet internet time sync with https://github.com/martinberlin/cale-api
  • Add partial refresh to this display test model ( Gdew027w3 )
  • Correct leading 0s in updateClock() since is <9

esp32-epaper-clock

Model gdep015OC1.h does not work - new model gdeh0154d67

Hi I have now bought this mode l from Waveshare.
I try to get the demos/demo-epaper.cpp running, however it does not display anything.
I have checked all the oins and the sdkconfig and they should be correct.

Do you have any tips on what I am doing wrong?

Extended ASCII characters with TomThumb

Really a great repo, I was able to compile and display on 7.5" Waveshare without issues. However would need extended ASCII for showing ° (deg) and Umlauts öüä etc. Tried with TomThunb but although setting extended to "1" it only shows chars up to 127. Additionally it is too small. Is there a way to get extended ASCII Fonts?

Build error with IDF v4.2

Building with IDF v4.2, I get multiple instances of this error:

error: unknown type name 'esp_err_t'; did you mean '_stderr_r'

Watchy Gdeh0154d67 not working

Describe the bug
I have a Watchy
https://watchy.sqfmi.com/'
for which I am trying to use Gdeh0154d67 driver

CONFIG_EINK_SPI_MOSI=23
CONFIG_EINK_SPI_CLK=18
CONFIG_EINK_SPI_CS=5
CONFIG_EINK_DC=10
CONFIG_EINK_RST=9
CONFIG_EINK_BUSY=19
#include <gdeh0154d67.h>

EpdSpi io;
Gdeh0154d67 display(io);

void app_main() {
  display.init(true);
  display.fillScreen(EPD_BLACK);
  display.update();
}

Unfortunately nothing happens. No updates to the display.

Then using GxEPD2 - it just works.

#define CS 5
#define DC 10
#define RESET 9
#define BUSY 19

GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> display(GxEPD2_154_D67(CS, DC, RESET, BUSY));

void setup() {
  // put your setup code here, to run once:
  display.init(0, false); //_initial_refresh to false to prevent full update on init
  display.setFullWindow();
  display.fillScreen(GxEPD_BLACK);
  display.display(false);
}

To Reproduce
Specify what Model/Classname of epaper you are using.
Write meaningful steps to reproduce the behavior:

Everything builds and runs, this is the log output:

free memory: 282852 bytes
IDF version: 4.3.1
CalEPD component version 1.0.6
Gdeh0154d67() 200*200
EpdSpi::init() Debug enabled. SPI master at frequency:50000  MOSI:23 CLK:18 CS:5 DC:10 RST:9 BUSY:19 DMA_CH: 2
Free heap:277320
fillScreen(0) _buffer len:5000
fillScreen(255) _buffer len:5000
C 12
C 1
C 3c
C 18
C 11
C 44
C 45
C 4e
C 4f
C 22
C 20
initFullUpdate()
BUFF Size:5000
C 24
C 22
C 20


STATS (ms)
1706 _wakeUp settings+send Buffer
2596 update
4303 total time in millis
C 22
C 20

but nothing changes/updates on the display.

Expected behavior
Display changes to black.

Desktop (please complete the following information):

  • OS: Windows 11
  • IDF version: 4.3.1

Additional context
Add any other context about the problem here.

Hardware info
https://watchy.sqfmi.com/docs/hardware/

platformio.ini

[platformio]
src_dir = main

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = espidf
monitor_speed = 115200
monitor_filters = log2file, colorize, esp32_exception_decoder

090/100 SPI tests

This will become the first priority before refactoring and adapting all the OOP classes from GFX, IO and EPD models.

And is the basic SPI communication test to make the display refresh and print something. Or even just a clear screen. To prove that SPI methods are working consistently.

Build problems "Gdeh0213b73.h"

Hi, i have problem with building example for Gdeh0213b73.

Source:

#include <stdio.h>
#include <gdeh0213b73.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"

// Two lines to start IO and instantiate your model
EpdSpi io;
Gdeh0213b73 display(io);

extern "C"
{
   void app_main();
}

void app_main(void) {
   display.init(true);
   display.setRotation(0); 
   display.println("Hello world");
   // Print a 2 pix line
   for (int i = 0; i < display.width(); i++) {
     display.drawPixel(i,10,EPD_BLACK);
     display.drawPixel(i,11,EPD_BLACK);
   }
   // Discover more of the geometrical functions of Adafruit GFX typing  display.*
}

Also i updated sdkconfig for TTGO-t5

cp ttgo-t5-sdkconfig ../sdkconfig

and

CMakeList.txt
SRCS "demos/gdeh0213b74_test.cpp"

After idf.py build i get errors like this:

/home/alesh/.espressif/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/main/libmain.a(gdeh0213b74_test.cpp.obj):(.literal._Z41__static_initialization_and_destruction_0ii+0x10): undefined reference to `vtable for Gdeh0213b73'
/home/alesh/.espressif/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/main/libmain.a(gdeh0213b74_test.cpp.obj):(.literal._Z41__static_initialization_and_destruction_0ii+0x14): undefined reference to `VTT for Gdeh0213b73'
/home/alesh/.espressif/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/main/libmain.a(gdeh0213b74_test.cpp.obj):(.literal._Z41__static_initialization_and_destruction_0ii+0x18): undefined reference to `Gdeh0213b73::Gdeh0213b73(EpdSpi&)'
/home/alesh/.espressif/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/main/libmain.a(gdeh0213b74_test.cpp.obj):(.literal.app_main+0xc): undefined reference to `Gdeh0213b73::init(bool)'
/home/alesh/.espressif/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/main/libmain.a(gdeh0213b74_test.cpp.obj):(.literal.app_main+0x10): undefined reference to `Gdeh0213b73::drawPixel(short, short, unsigned short)'
/home/alesh/.espressif/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/main/libmain.a(gdeh0213b74_test.cpp.obj): in function `__static_initialization_and_destruction_0(int, int)':
/home/alesh/esp/cale-idf/main/demos/gdeh0213b74_test.cpp:8: undefined reference to `Gdeh0213b73::Gdeh0213b73(EpdSpi&)'
/home/alesh/.espressif/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/main/libmain.a(gdeh0213b74_test.cpp.obj): in function `app_main':
/home/alesh/esp/cale-idf/main/demos/gdeh0213b74_test.cpp:16: undefined reference to `Gdeh0213b73::init(bool)'
/home/alesh/.espressif/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /home/alesh/esp/cale-idf/main/demos/gdeh0213b74_test.cpp:20: undefined reference to `Gdeh0213b73::drawPixel(short, short, unsigned short)'
/home/alesh/.espressif/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /home/alesh/esp/cale-idf/main/demos/gdeh0213b74_test.cpp:21: undefined reference to `Gdeh0213b73::drawPixel(short, short, unsigned short)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/cale-epd.elf.dir/build.make:505: cale-epd.elf] Error 1
make[1]: *** [CMakeFiles/Makefile2:2113: CMakeFiles/cale-epd.elf.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
make failed with exit code 2

Now it takes me about two days to debug and i have no ideas why it's not working. Every hint or ideas will be helpful. Thanks!

Uncommented parallel boards config prevents building for ESP32C3 devices

Describe the bug
Using an ESP32-C3 (ESP32-C3-DevKitM-1 dev board) on a fresh copy of the code, the build fails to compile with the following error.

In file included from ../components/CalEPD/models/parallel/ED047TC1.cpp:1:
../components/CalEPD/include/parallel/ED047TC1.h:14:10: fatal error: epd_driver.h: No such file or directory
 #include "epd_driver.h"

To Reproduce
Write meaningful steps to reproduce the behavior:

  1. Cloned the repo
  2. Uncommented SRCS "demos/demo-epaper.cpp" in main/CMakeLists.txt.
  3. In my case, I set display type to Gdeh042Z21 (so I also had to comment out the display.updateWindow line in demo-epaper but that is unrelated to the core of the issue)
  4. Compile the SRC file demos/demo-epaper.cpp for target ESP32C3
  5. Fails to build with the error above.

Expected behavior
Build Successfully

Desktop (please complete the following information):

  • OS: Windows 10

Additional context
I was able to resolve the issue by going into the components/CalEPD/CMakeLists.txt and commenting out the following lines:

#"epdParallel.cpp"
#"models/parallel/ED047TC1.cpp"

Interestingly, the comment just above that line says to uncomment those lines for parallel displays, but they were already uncommented. So I'm not sure which way was intended.

A few possible solutions:

  1. Update to the readme docs to also configure CalEPD/CMakeLists.txt for ESP32C3 devices, and clean up the comments in that file.
  2. Add comments to the parallel epaper lines in comments in CalEPD/CMakeLists.txt.
  3. Perhaps there's a way to handle what gets compiled with something like #if CONFIG_IDF_TARGET_ESP32C3
  4. Or, instead of creating exceptions for specific boards, it looks like there's also a CONFIG_IDF_TARGET_ARCH_RISCV that could be used to flag which lines compile.

I'm pretty new to the C / C++ world so it took me a sec to figure out what was going on. I appreciate your work and effort with this library.

Add touch as a component for eink displays

As a reference there is a touch component in C done here:
https://github.com/lvgl/lv_port_esp32/blob/master/components/lvgl_esp32_drivers/lvgl_touch/ft6x36.c

But is a bit strange that I don’t see the INT pin defined. I would like to have the I2C and the INT pin defined in menuconfig. The interrupt pin goes Low when a touch is detected, then come the I2C 2 bytes read of the touch parameters.
What I would like to do is to implement a component that can be injected as EpdSpi is now. This should make the class rotation aware, so if we rotate GFX, the coordinates of the touch should be rotated as well.
This will be integrated in models that already support touch (ending in -T) but it could also be used as an independent component if you decide to buy the touch panel independently and add it to any other display.

As a reference I like this FT6X36 class coded by strange-v
First epaper target is Goodisplay 2.7 touch
I2C documentation
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/i2c.html

Schematics

Touch & SPI Wiring

080/100 Implementing EPD new models

The plan is two integrate 3 small displays to learn more about SPI and how this works with IDF. But then if that goes as planned, only bigger displays are a target for this library (>=4.2 inches)

Add support for 5.65 & 4.01 inch 7 color epaper from Waveshare

This epaper with unknown controller since Waveshare thinks it's such a secret that cannot share what it is, even it is slow as a cow and pretty useless unless you display some artwork on it... it's coming finally to Cale-idf.
5 65inch-e-Paper-Module-F-2

I will take next two weekends to implement it. I really do not want to do it the GXepd2 way since I don't like how the whole class it's made, so I will just use the Waveshare example and do my own take with it.

New branch feature/29-wave7color
Implemented. Still pending:

  • 5.65 driver class
  • 4.01 driver class
  • SPI Optimization (send full X lines without toggling Chip select)
  • More tests

ESP32-S3 build with error.

IDF: release 4.4
PC: MacOS 12.4
Target: ESP32-S3

Do i need some other configuration?

Build end with lots of errors:

/Demo/cale-idf/components/epdiy/i2s_data_bus.c: In function 'i2s_int_hdl':
/Demo/cale-idf/components/epdiy/i2s_data_bus.c:72:19: error: 'volatile union <anonymous>' has no member named 'out_done'; did you mean 'rx_done'?
   if (dev->int_st.out_done) {
                   ^~~~~~~~
                   rx_done
/Demo/cale-idf/components/epdiy/i2s_data_bus.c: In function 'i2s_switch_buffer':
/Demo/cale-idf/components/epdiy/i2s_data_bus.c:93:50: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'out_link'
   while (i2s_is_busy() && dma_desc_addr() != I2S1.out_link.addr) {
                                                  ^
/Demo/cale-idf/components/epdiy/i2s_data_bus.c: In function 'i2s_start_line_output':
/Demo/cale-idf/components/epdiy/i2s_data_bus.c:102:8: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf'; did you mean 'rx_conf'?
   dev->conf.tx_start = 0;
        ^~~~
        rx_conf
/Demo/cale-idf/components/epdiy/i2s_data_bus.c:103:8: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf'; did you mean 'rx_conf'?
   dev->conf.tx_reset = 1;
        ^~~~
        rx_conf
/Demo/cale-idf/components/epdiy/i2s_data_bus.c:104:8: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf'; did you mean 'rx_conf'?
   dev->conf.tx_fifo_reset = 1;
        ^~~~
        rx_conf
/Demo/cale-idf/components/epdiy/i2s_data_bus.c:105:8: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf'; did you mean 'rx_conf'?
   dev->conf.rx_fifo_reset = 1;
        ^~~~
        rx_conf
/Demo/cale-idf/components/epdiy/i2s_data_bus.c:106:8: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf'; did you mean 'rx_conf'?
   dev->conf.tx_reset = 0;
        ^~~~
        rx_conf
/Demo/cale-idf/components/epdiy/i2s_data_bus.c:107:8: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf'; did you mean 'rx_conf'?
   dev->conf.tx_fifo_reset = 0;
        ^~~~
        rx_conf
/Demo/cale-idf/components/epdiy/i2s_data_bus.c:108:8: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf'; did you mean 'rx_conf'?
   dev->conf.rx_fifo_reset = 0;
        ^~~~
        rx_conf
/Demo/cale-idf/components/epdiy/i2s_data_bus.c:109:6: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'out_link'
   dev->out_link.addr = dma_desc_addr();
      ^~
/Demo/cale-idf/components/epdiy/i2s_data_bus.c:110:6: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'out_link'
   dev->out_link.start = 1;
      ^~
/Demo/cale-idf/components/epdiy/i2s_data_bus.c:115:8: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf'; did you mean 'rx_conf'?
   dev->conf.tx_start = 1;
        ^~~~
        rx_conf
/Demo/cale-idf/components/epdiy/i2s_data_bus.c: In function 'i2s_bus_init':
/Demo/cale-idf/components/epdiy/i2s_data_bus.c:131:21: error: 'I2S1O_DATA_OUT0_IDX' undeclared (first use in this function); did you mean 'I2S1O_WS_OUT_IDX'?
   int signal_base = I2S1O_DATA_OUT0_IDX;
                     ^~~~~~~~~~~~~~~~~~~
                     I2S1O_WS_OUT_IDX
/Demo/cale-idf/components/epdiy/i2s_data_bus.c:131:21: note: each undeclared identifier is reported only once for each function it appears in
/Demo/cale-idf/components/epdiy/i2s_data_bus.c:145:8: error: 'i2s_dev_t' {aka 'volatile struct i2s_dev_s'} has no member named 'conf'; did you mean 'rx_conf'?
   dev->conf.tx_reset = 1;
...

With main/CmakeList.txt

idf_component_register(
    # CALE official ESP-IDF Firmware
    
    SRCS "cale.cpp"
    # SRCS "cale-7-color.cpp"

    # SRCS "demos/cale-sensor.cpp"
    # CALE with grayscale support (For now only plasticLogic)
    # Grayscale is also good to test parallel epaper with 16 gray levels
    SRCS "cale-grayscale.cpp"

    # Generic demos for touch displays (With an added layer or Gdew027w3T that comes with touch mounted)
    # SRCS "demos/demo-epaper.cpp"
    #SRCS "demos/demo-4-grays-7inch"
    
    # TOUCH examples. 1- Touch indepently from Epd class uses Gdew027w3   2- Touch implemented in Gdew027w3T class
    #SRCS "demos/demo-touch.cpp"
    #SRCS "demos/demo-touch-epd-implemented.cpp"
    #SRCS "demos/demo-touch-keyboard.cpp"

    # Generic demos for any displays
    #SRCS "demos/demo-sleep-clock.cpp"
    # SRCS "demo-sleep-clock-v2.cpp"
    #SRCS "demos/demo-fonts.cpp"

    # Demo to print 7 colors in Waveshare Acep epapers
    #SRCS "demos/demo-7-colors.cpp"

    # Demo only for plasticlogic.com epapers:
    #SRCS "demos/demo-epaper-plasticlogic.cpp"

    # Plasticlogic video demo: Please build it in www-image/video

    # Only parallel epapers (Driven by I2Sbus)
    SRCS "demos/parallel/demo-epaper-parallel.cpp"
    SRCS "demos/parallel/demo-epaper-parallel-partial.cpp"
    SRCS "demos/parallel/demo-touch-parallel.cpp"
    SRCS "demos/parallel/demo-touch-keyboard.cpp"
    INCLUDE_DIRS ".")

    # This is just to avoid that BitBank2 components like AnimatedGIF include Arduino.h
idf_build_set_property(COMPILE_OPTIONS "-D __LINUX__" APPEND) 

100/100 transform IDF SPI Master example into a C++ Class

This is merely an exercise but is the ground stone of the architecture base. Is my take to refactor a pure C example into a C++ class with methods. This example will remain and be transformed in the IDF version of cale_tft Firmware

In the last iteration, it should just do this:

  1. Connect to WiFI
  2. Download an image from the web
  3. Render it on the TFT display

The goal is to have a tiny "human-readable" code in cale.cpp main file and that the rest is encapsulated in classes.

unable to build

Edit: the issue was the ESP-IDF framework version, the version used is actually v4.2, despite what platformio.ini states (additionally platformio doesn't currently support building with this version of the framework so you to use the actual Espressif tools/VSCode extension - wasn't clear to me initially!).

@martinberlin would be great if you could include something in the README stating the required ESP-IDF version


Hello, thank you for your work here.

I am trying to build the project from master (using platformIO from within VSCode).

Unfortunately I am hitting this error and unsure why.

Hardware: TTGO T-Beam ESP32, Waveshare 12.48in epaper module B

> Executing task in folder cale-idf: pio run <

Warning! Ignore unknown configuration option `monitor_filters` in section [platformio]
Processing ttgo-t-beam (platform: espressif32; framework: espidf; board: ttgo-t-beam)
------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/ttgo-t-beam.html
PLATFORM: Espressif 32 (2.0.0) > TTGO T-Beam
HARDWARE: ESP32 240MHz, 1.25MB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-espidf 3.40100.200827 (4.1.0) 
 - tool-cmake 3.16.4 
 - tool-esptoolpy 1.20600.0 (2.6.0) 
 - tool-ninja 1.9.0 
 - toolchain-esp32ulp 1.22851.191205 (2.28.51) 
 - toolchain-xtensa32 2.80200.200827 (8.2.0)
Reading CMake configuration...
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/ttgo-t-beam/esp-idf/main/cale.cpp.o
Archiving .pio/build/ttgo-t-beam/esp-idf/app_trace/libapp_trace.a
Indexing .pio/build/ttgo-t-beam/esp-idf/app_trace/libapp_trace.a
Archiving .pio/build/ttgo-t-beam/esp-idf/app_update/libapp_update.a
Indexing .pio/build/ttgo-t-beam/esp-idf/app_update/libapp_update.a
main/cale.cpp: In function 'esp_err_t _http_event_handler(esp_http_client_event_t*)':
main/cale.cpp:197:28: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
             if (bmp.height < 0)
                 ~~~~~~~~~~~^~~
main/cale.cpp: In function 'void http_post()':
main/cale.cpp:407:9: warning: missing initializer for member 'esp_http_client_config_t::host' [-Wmissing-field-initializers]
         };
         ^
main/cale.cpp:407:9: warning: missing initializer for member 'esp_http_client_config_t::port' [-Wmissing-field-initializers]
main/cale.cpp:407:9: warning: missing initializer for member 'esp_http_client_config_t::username' [-Wmissing-field-initializers]
main/cale.cpp:407:9: warning: missing initializer for member 'esp_http_client_config_t::password' [-Wmissing-field-initializers]
main/cale.cpp:407:9: warning: missing initializer for member 'esp_http_client_config_t::auth_type' [-Wmissing-field-initializers]
main/cale.cpp:407:9: warning: missing initializer for member 'esp_http_client_config_t::path' [-Wmissing-field-initializers]
main/cale.cpp:407:9: warning: missing initializer for member 'esp_http_client_config_t::query' [-Wmissing-field-initializers]
main/cale.cpp:407:9: warning: missing initializer for member 'esp_http_client_config_t::cert_pem' [-Wmissing-field-initializers]
main/cale.cpp:407:9: warning: missing initializer for member 'esp_http_client_config_t::client_cert_pem' [-Wmissing-field-initializers]
main/cale.cpp:407:9: warning: missing initializer for member 'esp_http_client_config_t::client_key_pem' [-Wmissing-field-initializers]
main/cale.cpp:407:9: warning: missing initializer for member 'esp_http_client_config_t::disable_auto_redirect' [-Wmissing-field-initializers]
main/cale.cpp:407:9: warning: missing initializer for member 'esp_http_client_config_t::max_redirection_count' [-Wmissing-field-initializers]
main/cale.cpp:407:9: warning: missing initializer for member 'esp_http_client_config_t::transport_type' [-Wmissing-field-initializers]
main/cale.cpp:407:9: warning: missing initializer for member 'esp_http_client_config_t::buffer_size_tx' [-Wmissing-field-initializers]
main/cale.cpp:407:9: warning: missing initializer for member 'esp_http_client_config_t::user_data' [-Wmissing-field-initializers]
main/cale.cpp:407:9: warning: missing initializer for member 'esp_http_client_config_t::is_async' [-Wmissing-field-initializers]
main/cale.cpp:407:9: warning: missing initializer for member 'esp_http_client_config_t::use_global_ca_store' [-Wmissing-field-initializers]
main/cale.cpp:407:9: warning: missing initializer for member 'esp_http_client_config_t::skip_cert_common_name_check' [-Wmissing-field-initializers]
main/cale.cpp: In function 'void wifi_init_sta()':
main/cale.cpp:488:5: error: 'esp_event_handler_instance_t' was not declared in this scope
     esp_event_handler_instance_t instance_any_id;
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
main/cale.cpp:488:5: note: suggested alternative: 'esp_event_handler_unregister'
     esp_event_handler_instance_t instance_any_id;
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
     esp_event_handler_unregister
main/cale.cpp:489:33: error: expected ';' before 'instance_got_ip'
     esp_event_handler_instance_t instance_got_ip;
                                 ^~~~~~~~~~~~~~~~
                                 ;
In file included from /Users/xeijin/.platformio/packages/framework-espidf/components/esp_common/include/esp_timer.h:44,
                 from /Users/xeijin/.platformio/packages/framework-espidf/components/freertos/include/freertos/portmacro.h:84,
                 from /Users/xeijin/.platformio/packages/framework-espidf/components/freertos/include/freertos/portable.h:96,
                 from /Users/xeijin/.platformio/packages/framework-espidf/components/freertos/include/freertos/FreeRTOS.h:107,
                 from main/cale.cpp:2:
main/cale.cpp:494:58: error: 'instance_any_id' was not declared in this scope
                                                         &instance_any_id));
                                                          ^~~~~~~~~~~~~~~
/Users/xeijin/.platformio/packages/framework-espidf/components/esp_common/include/esp_err.h:118:31: note: in definition of macro 'ESP_ERROR_CHECK'
         esp_err_t __err_rc = (x);                                       \
                               ^
main/cale.cpp:490:21: error: 'esp_event_handler_instance_register' was not declared in this scope
     ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT,
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/xeijin/.platformio/packages/framework-espidf/components/esp_common/include/esp_err.h:118:31: note: in definition of macro 'ESP_ERROR_CHECK'
         esp_err_t __err_rc = (x);                                       \
                               ^
main/cale.cpp:490:21: note: suggested alternative: 'esp_event_handler_unregister'
     ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT,
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/xeijin/.platformio/packages/framework-espidf/components/esp_common/include/esp_err.h:118:31: note: in definition of macro 'ESP_ERROR_CHECK'
         esp_err_t __err_rc = (x);                                       \
                               ^
main/cale.cpp:499:58: error: 'instance_got_ip' was not declared in this scope
                                                         &instance_got_ip));
                                                          ^~~~~~~~~~~~~~~
/Users/xeijin/.platformio/packages/framework-espidf/components/esp_common/include/esp_err.h:118:31: note: in definition of macro 'ESP_ERROR_CHECK'
         esp_err_t __err_rc = (x);                                       \
                               ^
main/cale.cpp:495:21: error: 'esp_event_handler_instance_register' was not declared in this scope
     ESP_ERROR_CHECK(esp_event_handler_instance_register(IP_EVENT,
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/xeijin/.platformio/packages/framework-espidf/components/esp_common/include/esp_err.h:118:31: note: in definition of macro 'ESP_ERROR_CHECK'
         esp_err_t __err_rc = (x);                                       \
                               ^
main/cale.cpp:495:21: note: suggested alternative: 'esp_event_handler_unregister'
     ESP_ERROR_CHECK(esp_event_handler_instance_register(IP_EVENT,
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/xeijin/.platformio/packages/framework-espidf/components/esp_common/include/esp_err.h:118:31: note: in definition of macro 'ESP_ERROR_CHECK'
         esp_err_t __err_rc = (x);                                       \
                               ^
main/cale.cpp:537:90: error: 'instance_got_ip' was not declared in this scope
     ESP_ERROR_CHECK(esp_event_handler_instance_unregister(IP_EVENT, IP_EVENT_STA_GOT_IP, instance_got_ip));
                                                                                          ^~~~~~~~~~~~~~~
/Users/xeijin/.platformio/packages/framework-espidf/components/esp_common/include/esp_err.h:118:31: note: in definition of macro 'ESP_ERROR_CHECK'
         esp_err_t __err_rc = (x);                                       \
                               ^
main/cale.cpp:537:21: error: 'esp_event_handler_instance_unregister' was not declared in this scope
     ESP_ERROR_CHECK(esp_event_handler_instance_unregister(IP_EVENT, IP_EVENT_STA_GOT_IP, instance_got_ip));
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/xeijin/.platformio/packages/framework-espidf/components/esp_common/include/esp_err.h:118:31: note: in definition of macro 'ESP_ERROR_CHECK'
         esp_err_t __err_rc = (x);                                       \
                               ^
main/cale.cpp:537:21: note: suggested alternative: 'esp_event_handler_unregister'
     ESP_ERROR_CHECK(esp_event_handler_instance_unregister(IP_EVENT, IP_EVENT_STA_GOT_IP, instance_got_ip));
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/xeijin/.platformio/packages/framework-espidf/components/esp_common/include/esp_err.h:118:31: note: in definition of macro 'ESP_ERROR_CHECK'
         esp_err_t __err_rc = (x);                                       \
                               ^
main/cale.cpp:538:89: error: 'instance_any_id' was not declared in this scope
     ESP_ERROR_CHECK(esp_event_handler_instance_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, instance_any_id));
                                                                                         ^~~~~~~~~~~~~~~
/Users/xeijin/.platformio/packages/framework-espidf/components/esp_common/include/esp_err.h:118:31: note: in definition of macro 'ESP_ERROR_CHECK'
         esp_err_t __err_rc = (x);                                       \
                               ^
main/cale.cpp:538:21: error: 'esp_event_handler_instance_unregister' was not declared in this scope
     ESP_ERROR_CHECK(esp_event_handler_instance_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, instance_any_id));
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/xeijin/.platformio/packages/framework-espidf/components/esp_common/include/esp_err.h:118:31: note: in definition of macro 'ESP_ERROR_CHECK'
         esp_err_t __err_rc = (x);                                       \
                               ^
main/cale.cpp:538:21: note: suggested alternative: 'esp_event_handler_unregister'
     ESP_ERROR_CHECK(esp_event_handler_instance_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, instance_any_id));
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/xeijin/.platformio/packages/framework-espidf/components/esp_common/include/esp_err.h:118:31: note: in definition of macro 'ESP_ERROR_CHECK'
         esp_err_t __err_rc = (x);                                       \
                               ^
Compiling .pio/build/ttgo-t-beam/esp-idf/asio/asio/asio/src/asio.cpp.o
*** [.pio/build/ttgo-t-beam/esp-idf/main/cale.cpp.o] Error 1
============================================================= [FAILED] Took 7.73 seconds =============================================================
The terminal process "pio 'run'" terminated with exit code: 1.

Add Grayscale support

  • Add grayscale support to CALE Firmware (BMP download)

  • Add grayscale support to epaper models
    PlasticLogic* support grayscale (4 bit per pixel)
    Parallel epaper models using the EPDiy class support 16 grayscales (4 bit per pixel)

  • Add grayscale support to Good Display Model-gdew075T7 related to #10

  • Other Goodisplay models? -> A: Not going to happen at least for the moment.

Add an example of IR detection using interrupts, simple gallery image request

The idea is to have an epaper that detects motion reading an interrupt GPIO fed by an IR motion sensor.
CALE.es counterpart in Issue 34

The detection will do either:

  • A restart
  • Download again the same URL image and render it

Example to attach a GPIO interrupt: https://github.com/espressif/esp-idf/blob/f8bda324ecde58214aaa00ab5e0da5eea9942aaf/examples/peripherals/gpio/main/gpio_example_main.c

Need to check what kind of signal gives the PR (usually RISING)

  // PIR Motion Sensor mode INPUT_PULLUP
  pinMode(motionSensor, INPUT_PULLUP);
  // Set motionSensor pin as interrupt, assign interrupt function and set RISING mode
  attachInterrupt(digitalPinToInterrupt(motionSensor), detectsMovement, RISING);

The interrupt should not happen again for NN seconds, even if triggered, so maybe is a good idea to make an IF condition and check that the time since last refresh is not less than this seconds.

This will render a new image from the web in the epaper
gdew075c64

Target of this demo are exposition galleries, with a new plugin, that will enable to rotate uploaded images in CALE.es

Error on 4bpp bitmaps for 2.13" epaper / Error in handling of padding in cale.cpp

I adapted your code for my need to print a bitmap from memory. What I found is you show the correct image, however you are drawing too many pixels.
E.g. when there is a width of 200 pixels, your calculations are giving rowSize = 28 = 224 pixels. Which is fine, however what you are doing is drawing pixels line by line from 0 to 224 which is too much. You should only draw until 200.
You can see this in your debug output:
printf("Total drawPixel calls: %d\noutX: %d outY: %d\n", totalDrawPixels, drawX, drawY);
Which will for a 200x200 pic emit 44800 (200x224) pixels.

I have it working for my needs however I am not sure how to fix it for your code.

Compiling cale-idf in target esp32c3

Implementation branch: 39-c3

We need to exclude epd_driver from build since it's ESP32's only:
idf.py set-target esp32c3

#include "xtensa/core-macros.h"
          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[954/1012] Building C object esp-idf/epd_driver/CMakeFiles/__idf_epd_driver.dir/font.c.obj
../components/epd_driver/font.c: In function 'uncompress':
../components/epd_driver/font.c:103:68: warning: passing argument 3 of 'tinfl_decompress' from incompatible pointer type [-Wincompatible-pointer-types]
     tinfl_status decomp_status = tinfl_decompress(&decomp, source, &source_size, dest, dest, &uncompressed_size, TINFL_FLAG_PARSE_ZLIB_HEADER | TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF);

It seems EPDiy is using some includes that are not meant to work in C3. But of course using parallel is excluded from testing this since it does not even has enough PINs for something like this.

Building this with target esp32c3 gives issues with SPI:```

../components/CalEPD/models/plasticlogic/epdspi2cs.cpp:66:28: error: 'EPD_HOST' was not declared in this scope
ret=spi_bus_initialize(EPD_HOST, &buscfg, DMA_CHAN);
^~~~~~~~
../components/CalEPD/models/plasticlogic/epdspi2cs.cpp:66:28: note: suggested alternative: 'SPI_HOST'
ret=spi_bus_initialize(EPD_HOST, &buscfg, DMA_CHAN);
^~~~~~~~
SPI_HOST
../components/CalEPD/models/plasticlogic/epdspi2cs.cpp:66:47: error: 'DMA_CHAN' was not declared in this scope
ret=spi_bus_initialize(EPD_HOST, &buscfg, DMA_CHAN);
^~~~~~~~
../components/CalEPD/models/plasticlogic/epdspi2cs.cpp:66:47: note: suggested alternative: 'DMA_ATTR'
ret=spi_bus_initialize(EPD_HOST, &buscfg, DMA_CHAN);
^~~~~~~~
DMA_ATTR

Refactor EPDiy integration and add new parallel epaper models

As per my last communication with the EPDiy developer Valentin

I've just merged the refactoring branch, where these issues should be resolved.

The issue that we described with the GFXGlyph structs that collided with Adafruit GFX own names should be solved. That means that we should not "copy the entirely" library here and use git submodules instead which habe the advantage to keep EPDiy up-to-date and also remove the Files from this one leaving the library lighter for those who use only SPI epapers.

Add new parallel models

  • ED060SC4 | 6" | 800 x 600

I will try that first in a development branch when the new parallel T5S from Lilygo arrives. And if all works like expected then it will be the first real "submodule" on Cale-idf

CALE main image download to buffer

This needs replicate what is done in the Arduino version on Image HTTP to buffer function.

  • Connect to WiFI
  • Check how to make an HTTP request and stream byte per byte in display.drawpixel function

NOTE: Using the huge buffer epaper (Wave12i48 with 160Kb _buffer) and using WiFi comes the following error

region `dram0_0_seg' overflowed by 17776 bytes

Indicating clearly that using such a big data buffer calls for external memory.

gdew075T7 Reduce black-white transitions during display update or invoke partial update

We have implemented latest cale-idf repo but now see an issue with display.update - every update causes 3 transistions from black->white before new contents is visible. As we are using the waveshare 7.5" V2 display I assume that a partial update is not possible?
However why do we need 3 transistions, is there a way to reduce to one transition?

Forking Policy

I disagree with your fork policy. First off central control it is somewhat antithetical to the idea of decentralized development. People fork for other reasons than you mention. For example I often fork vital libraries so I can control when my project decides to update. I can't always rely on projects having good tagging practices to fix releases.

I have had too many builds break because of this kind of issue to simply trust the maintainers, and I don't think that is an unreasonable assumption. Also I have had projects disappear on me, either moved to another host without warning or simply deleted for whatever reason.

My point is there are reasons why people fork that are beyond simple "bookmarking", and I think it would be better if you didn't use such perscriptive language for something outside of your control.

You are, of course, free to disagree...

L58Touch sometimes doesn't show x values between about 148 and 272.

Describe the bug
A column of my screen between the x values of about 148 and 272 sometimes doesn't show correct x values between those points.
-Touches can be detected anywhere on screen, including in that column.
-A stroke that begins somewhere in that column registers touches with y values correct, but the x values are always either about 148 or about 272.
-A stroke that begins outside of the column and crosses it may or may not register correct x values as it crosses the column. Strokes that are closer to horizontal seem to have a better chance of showing correct x values.
-When the x value does jump across the column in the middle of a stroke, event shown is 0 instead of 3.

To Reproduce
Lilygo T5-4.7 with capacitive touch cover. Initiate a touch between x = 148 and x = 272 to get an incorrect x, drag finger across that column from a point before or after to get possibly correct, possibly incorrect X values. Readout from a mostly-correct attempt:
02:35:24.484 -> X:125 Y:188 E:3
02:35:24.523 -> X:127 Y:189 E:3
02:35:24.562 -> X:129 Y:191 E:3
02:35:24.604 -> X:129 Y:191 E:3
02:35:24.653 -> X:132 Y:194 E:3
02:35:24.653 -> X:144 Y:198 E:3
02:35:24.694 -> X:162 Y:203 E:3
02:35:24.736 -> X:183 Y:209 E:3
02:35:24.774 -> X:203 Y:215 E:3
02:35:24.813 -> X:213 Y:218 E:3
02:35:24.861 -> X:235 Y:225 E:3
02:35:24.904 -> X:258 Y:232 E:0
02:35:26.472 -> X:274 Y:275 E:3
02:35:26.518 -> X:274 Y:275 E:3
02:35:26.560 -> X:274 Y:275 E:3
02:35:26.602 -> X:274 Y:275 E:3
02:35:26.642 -> X:274 Y:275 E:3
02:35:26.688 -> X:276 Y:275 E:3
02:35:26.688 -> X:279 Y:275 E:3
02:35:26.731 -> X:283 Y:275 E:3
02:35:26.772 -> X:287 Y:275 E:3
02:35:26.815 -> X:289 Y:275 E:3

Readout from a mostly incorrect attempt:
02:43:55.206 -> X:146 Y:474 E:3
02:43:55.246 -> X:147 Y:472 E:3
02:43:55.286 -> X:147 Y:472 E:3
02:43:55.325 -> X:147 Y:472 E:3
02:43:55.366 -> X:147 Y:472 E:3
02:43:55.405 -> X:147 Y:472 E:3
02:43:55.446 -> X:147 Y:472 E:0
02:43:55.486 -> X:273 Y:433 E:3
02:43:55.526 -> X:273 Y:423 E:3
02:43:55.566 -> X:273 Y:409 E:3
02:43:55.606 -> X:274 Y:392 E:3
02:43:55.646 -> X:274 Y:382 E:3
02:43:55.686 -> X:275 Y:366 E:3

Expected behavior
Touches should register the correct x and y values anywhere on the screen.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Firefox

Implement 12.48in waveshare 3-colour in a new class

Hello, many thanks for your hard work on this, please note this is my first hardware project so appreciate your patience with me!

After a couple days hacking I have been unable to get three colour version 12.48in waveshare display working.

problem: epaper is not updating (no effect on display with either cale-idf or the original waveshare demos)


board

  • LILYGO TTGO T-Energy (WROVER chip with PSIRAM)

  • some wiring changes I had to make vs your 1248in waveshare wiki page (the board does not have soldered headers, so I am using dupont jumper wires, I had to use slightly different pins to make this work)

code

display configuration in sdkconfig
# Display Configuration
#...
CONFIG_EINK_SPI_MOSI=14
CONFIG_EINK_SPI_CLK=13
CONFIG_EINK_SPI_CS=-1
CONFIG_EINK_DC=-1
CONFIG_EINK_RST=-1
CONFIG_EINK_BUSY=-1
#...
CONFIG_EINK_SPI_CS2=-1
CONFIG_EINK_SPI_MISO=-1
#...
CONFIG_EINK_SPI_M1_CS=23
CONFIG_EINK_SPI_S1_CS=22
CONFIG_EINK_SPI_M2_CS=26
# 16 -> 26
CONFIG_EINK_SPI_S2_CS=19
CONFIG_EINK_SPI_M1_BUSY=32
CONFIG_EINK_SPI_S1_BUSY=21
# 26 -> 21
CONFIG_EINK_SPI_M2_BUSY=18
CONFIG_EINK_SPI_S2_BUSY=4
CONFIG_EINK_M1S1_DC=25
CONFIG_EINK_M2S2_DC=27
# 17 -> 27
CONFIG_EINK_M1S1_RST=33
CONFIG_EINK_M2S2_RST=5
# end of Display Configuration
serial output (with main/cale.cpp)
--- idf_monitor on /dev/cu.usbserial-0200D385 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:4
load:0x3fff0034,len:7080
load:0x40078000,len:13964
load:0x40080400,len:4816
0x40080400: _init at ??:?

entry 0x400806f4
I (29) boot: ESP-IDF v4.2-rc-5-g511965b26 2nd stage bootloader
I (29) boot: compile time 15:51:14
I (29) boot: chip revision: 1
I (33) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (40) boot.esp32: SPI Speed      : 40MHz
I (45) boot.esp32: SPI Mode       : DIO
I (49) boot.esp32: SPI Flash Size : 4MB
I (54) boot: Enabling RNG early entropy source...
I (59) boot: Partition Table:
I (63) boot: ## Label            Usage          Type ST Offset   Length
I (70) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (78) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (85) boot:  2 factory          factory app      00 00 00010000 00200000
I (93) boot:  3 vfs              Unknown data     01 81 00210000 001f0000
I (100) boot: End of partition table
I (104) boot_comm: chip revision: 1, min. application chip revision: 0
I (111) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x25b10 (154384) map
I (187) esp_image: segment 1: paddr=0x00035b38 vaddr=0x3ffb0000 size=0x03b6c ( 15212) load
I (195) esp_image: segment 2: paddr=0x000396ac vaddr=0x40080000 size=0x00404 (  1028) load
0x40080000: _WindowOverflow4 at /Users/xeijin/esp-idf/components/freertos/xtensa/xtensa_vectors.S:1730

I (195) esp_image: segment 3: paddr=0x00039ab8 vaddr=0x40080404 size=0x06560 ( 25952) load
I (216) esp_image: segment 4: paddr=0x00040020 vaddr=0x400d0020 size=0xa28e4 (665828) map
0x400d0020: _stext at ??:?

I (504) esp_image: segment 5: paddr=0x000e290c vaddr=0x40086964 size=0x0df38 ( 57144) load
0x40086964: wifi_bt_common_module_enable at /Users/xeijin/esp-idf/components/driver/periph_ctrl.c:55

I (532) esp_image: segment 6: paddr=0x000f084c vaddr=0x400c0000 size=0x0006c (   108) load
I (544) boot: Loaded app from partition at offset 0x10000
I (545) boot: Disabling RNG early entropy source...
I (546) psram: This chip is ESP32-D0WD
I (551) spiram: Found 64MBit SPI RAM device
I (554) spiram: SPI RAM mode: flash 40m sram 40m
I (559) spiram: PSRAM initialized, cache is in low/high (2-core) mode.
I (567) cpu_start: Pro cpu up.
I (570) cpu_start: Application information:
I (575) cpu_start: Project name:     cale-epd
I (580) cpu_start: App version:      b2c7997
I (585) cpu_start: Compile time:     Nov 28 2020 18:47:34
I (591) cpu_start: ELF file SHA256:  aeff39f7f2bfb6e3...
I (597) cpu_start: ESP-IDF:          v4.2-rc-5-g511965b26
I (603) cpu_start: Starting app cpu, entry point is 0x40081e98
0x40081e98: call_start_cpu1 at /Users/xeijin/esp-idf/components/esp32/cpu_start.c:287

I (0) cpu_start: App cpu up.
I (1495) spiram: SPI SRAM memory test OK
I (1497) heap_init: Initializing. RAM available for dynamic allocation:
I (1497) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (1502) heap_init: At 3FFDC058 len 00003FA8 (15 KiB): DRAM
I (1508) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (1515) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (1521) heap_init: At 4009489C len 0000B764 (45 KiB): IRAM
I (1527) cpu_start: Pro cpu start user code
I (1532) spiram: Adding pool of 4082K of external SPI memory to heap allocator
CalEPD component version 1.0
Wave12I48() constructor injects IO and extends Adafruit_GFX(1304,984) Pix Buffer[160392]

Available heap after Epd bootstrap:4194000
I (1559) spi_flash: detected chip: generic
I (1563) spi_flash: flash io: dio
I (1567) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (1577) spiram: Reserving pool of 32K of internal memory for DMA/internal allocations
CalEPD version: 1.0
I (1677) CALE: ESP_WIFI_MODE_STA
I (1697) wifi:wifi driver task: 3ffe8044, prio:23, stack:6656, core=0
I (1697) system_api: Base MAC address is not set
I (1697) system_api: read default base MAC address from EFUSE
I (1747) wifi:wifi firmware version: 1865b55
I (1747) wifi:wifi certification version: v7.0
I (1747) wifi:config NVS flash: enabled
I (1747) wifi:config nano formating: disabled
I (1747) wifi:Init data frame dynamic rx buffer num: 16
I (1757) wifi:Init management frame dynamic rx buffer num: 16
I (1757) wifi:Init management short buffer num: 32
I (1767) wifi:Init static tx buffer num: 16
I (1767) wifi:Init tx cache buffer num: 32
I (1777) wifi:Init static rx buffer size: 1600
I (1777) wifi:Init static rx buffer num: 10
I (1777) wifi:Init dynamic rx buffer num: 16
I (1787) wifi_init: rx ba win: 16
I (1787) wifi_init: tcpip mbox: 32
I (1797) wifi_init: udp mbox: 6
I (1797) wifi_init: tcp mbox: 6
I (1797) wifi_init: tcp tx win: 5744
I (1807) wifi_init: tcp rx win: 5744
I (1807) wifi_init: tcp mss: 1440
I (1937) phy: phy_version: 4500, 0cd6843, Sep 17 2020, 15:37:07, 0, 0
I (1937) wifi:mode : sta (c4:4f:33:57:6d:49)
I (1937) CALE: wifi_init_sta finished.
I (2057) wifi:new:<1,0>, old:<1,0>, ap:<255,255>, sta:<1,0>, prof:1
I (2067) wifi:state: init -> auth (b0)
I (2077) wifi:state: auth -> assoc (0)
I (2077) wifi:state: assoc -> run (10)
I (2107) wifi:connected with MY-NET, aid = 21, channel 1, BW20, bssid = 7c:4c:a5:aa:89:f1
I (2107) wifi:security: WPA2-PSK, phy: bgn, rssi: -59
I (2117) wifi:pm start, type: 1

I (2157) wifi:AP's beacon interval = 102400 us, DTIM period = 1
I (2677) esp_netif_handlers: sta ip: 10.10.100.183, mask: 255.255.255.0, gw: 10.10.100.1
I (2687) CALE: got ip: 10.10.100.183

I (2687) CALE: connected to ap SSID:MY-WLAN password:********
PIN SETUP:
SPI_M1_CS:23 <- all set as output GPIOs
SPI_S1_CS:22
SPI_M2_CS:26
SPI_S2_CS:19

SPI_M1_BUSY:32 <- all set as input,pullup GPIOs
SPI_S1_BUSY:21
SPI_M2_BUSY:18
SPI_S2_BUSY:4

M1S1_DC:25 <- all set as output GPIOs
M2S2_DC:27
M1S1_RST:33
M2S2_RST:5

Available heap after Epd init:4185952
Free heap: 4185952 (After epaper instantiation)
DRAM     : 4187268
POST data: ip=10.10.100.183
Bearer: 
I (2937) CALE: HTTP_EVENT_ON_CONNECTED
I (2947) CALE: HTTP_EVENT_HEADER_SENT
I (5047) CALE: HTTP_EVENT_ON_HEADER, key=Date, value=Sat, 28 Nov 2020 18:48:04 GMT
I (5057) CALE: HTTP_EVENT_ON_HEADER, key=Server, value=Apache/2.4.46 (Amazon) OpenSSL/1.0.2k-fips PHP/7.2.34
I (5057) CALE: HTTP_EVENT_ON_HEADER, key=Vary, value=Authorization
I (5067) CALE: HTTP_EVENT_ON_HEADER, key=X-Powered-By, value=PHP/7.2.34
I (5077) CALE: HTTP_EVENT_ON_HEADER, key=Cache-Control, value=no-cache, private, max-age=172800
I (5087) CALE: HTTP_EVENT_ON_HEADER, key=Content-Length, value=161438
I (5087) CALE: HTTP_EVENT_ON_HEADER, key=Expires, value=Mon, 30 Nov 2020 18:48:04 GMT
I (5097) CALE: HTTP_EVENT_ON_HEADER, key=Connection, value=keep-alive
I (5107) CALE: HTTP_EVENT_ON_HEADER, key=Content-Type, value=image/bmp
I (5117) CALE: BMP HEADERS
filesize:161438
offset:62
W:1304
H:984
planes:1
depth:1
format:0

I (5127) CALE: BMP isPaddingAware:  1 bit depth are 4 bit padded. Wikipedia gave me a lesson.
Offset comes in first DATA callback. bPointer: 62 == bmp.imageOffset
I (5457) CALE: 10 len:1024

I (5827) CALE: 20 len:1024

I (6167) CALE: 30 len:1024

I (6527) CALE: 40 len:1024

I (6887) CALE: 50 len:1024

I (7247) CALE: 60 len:1024

I (7617) CALE: 70 len:1024

I (7977) CALE: 80 len:1024

I (8337) CALE: 90 len:1024

I (8697) CALE: 100 len:1024

I (9067) CALE: 110 len:1024

I (9437) CALE: 120 len:1024

I (9807) CALE: 130 len:1024

I (10167) CALE: 140 len:1024

I (10517) CALE: 150 len:1024

I (10877) CALE: HTTP_EVENT_ON_FINISH
Download took: 5763 ms
Refresh and go to sleep 60 minutes

Resolution setting
Sending a buffer[160392] via SPI

Available heap after Epd update: 4182592 bytes
STATS (ms)
888 _wakeUp settings+send Buffer
696 _powerOn
1584 total time in millis
  • my current fork: xeijin/cale-idf (branch: 1248in-3colour)
  • have also tried with demo-fonts.cpp, demo-sleep-clock.cpp etc. same issue with all
  • the touch screen component & inclusion of other boards are commented out

thank you in advance for any help!

Can I use cale-idf in Arduino

Hi Martin,
very nice work!
It might be a stupid question but I don't
have issues making a fool of myself. .-)
Can I use the library in Arduino?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.