kotope / esphome_eink_dashboard

Home Assistant Dashboard for LilyGO T5 4.7 E-Ink display
67 stars 7 forks source link

Installation error #1

Closed balbulator closed 10 months ago

balbulator commented 2 years ago

First of all, I want to thank you for an interesting idea. An error occurs when trying to install

INFO Reading configuration /config/esphome/eink.yaml...
INFO Detected timezone 'Europe/Kiev'
INFO Generating C++ source...
INFO Compiling app...
Processing eink (board: esp32dev; framework: arduino; platform: platformio/espressif32 @ 3.5.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- <AsyncTCP-esphome> 1.2.2
|-- <WiFi> 1.0
|-- <FS> 1.0
|-- <Update> 1.0
|-- <ESPAsyncWebServer-esphome> 2.1.0
|   |-- <AsyncTCP-esphome> 1.2.2
|-- <DNSServer> 1.1.0
|-- <ESPmDNS> 1.0
|-- <ArduinoJson> 6.18.5
|-- <epdiy> 1.0.0+sha.3e2c515
Archiving /data/eink/.pioenvs/eink/lib915/libESPmDNS.a
Compiling /data/eink/.pioenvs/eink/lib364/epdiy/board/epd_board_v6.c.o
Compiling /data/eink/.pioenvs/eink/lib364/epdiy/display_ops.c.o
Compiling /data/eink/.pioenvs/eink/lib364/epdiy/epd_board.c.o
Compiling /data/eink/.pioenvs/eink/lib364/epdiy/epd_driver.c.o
/data/eink/.piolibdeps/eink/epdiy/src/epd_driver/board/epd_board_v6.c: In function 'epd_board_init':
/data/eink/.piolibdeps/eink/epdiy/src/epd_driver/board/epd_board_v6.c:102:7: error: 'i2c_config_t {aka struct <anonymous>}' has no member named 'clk_flags'
   conf.clk_flags = I2C_SCLK_SRC_FLAG_FOR_NOMAL;
       ^
/data/eink/.piolibdeps/eink/epdiy/src/epd_driver/board/epd_board_v6.c:102:20: error: 'I2C_SCLK_SRC_FLAG_FOR_NOMAL' undeclared (first use in this function)
   conf.clk_flags = I2C_SCLK_SRC_FLAG_FOR_NOMAL;
                    ^
/data/eink/.piolibdeps/eink/epdiy/src/epd_driver/board/epd_board_v6.c:102:20: note: each undeclared identifier is reported only once for each function it appears in
*** [/data/eink/.pioenvs/eink/lib364/epdiy/board/epd_board_v6.c.o] Error 1
========================== [FAILED] Took 8.79 seconds ==========================

This person has the same problem https://github.com/esphome/issues/issues/3372#issue-1272268835

Help me fix the error Thanks in advance

kotope commented 2 years ago

Seems like your epdiy library is referring to different lib than mine is and that's most probably causing the error (even though the version is same, but SHA is different => source is not the same)

Here's my full build log:

INFO Reading configuration /config/esphome/eink-dashboard.yaml...
INFO Detected timezone 'Europe/Helsinki'
INFO Generating C++ source...
INFO Compiling app...
Processing eink-dashboard (board: esp32dev; framework: arduino; platform: platformio/espressif32 @ 3.5.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- <AsyncTCP-esphome> 1.2.2
|-- <WiFi> 1.0
|-- <FS> 1.0
|-- <Update> 1.0
|-- <ESPAsyncWebServer-esphome> 2.1.0
|   |-- <AsyncTCP-esphome> 1.2.2
|-- <DNSServer> 1.1.0
|-- <ESPmDNS> 1.0
|-- <ArduinoJson> 6.18.5
|-- <epdiy> 1.0.0+sha.3ffb83c
RAM:   [==        ]  15.0% (used 49152 bytes from 327680 bytes)
Flash: [========  ]  75.9% (used 1393670 bytes from 1835008 bytes)
========================= [SUCCESS] Took 3.14 seconds =========================
balbulator commented 2 years ago

sha indeed a different number, but where does it come from? Checked a simple example, it works

esphome:
  name: lilygo-test

esp32:
  board: esp32dev
  framework:
    type: arduino

logger:

api:

ota:
  password: ************

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

external_components:
  - source: github://ashald/esphome@lilygo-t5-47
    components:
      - lilygo_t5_47

time:
  - platform: homeassistant
    id: ntp

font:
  - id: large
    file: "fonts/digital-7 (mono).ttf"
    size: 100

display:
  - platform: lilygo_t5_47
    id: t5_display
    update_interval: 10s
    full_update_every: 6
    lambda: |-
      it.printf(20, 20, id(large), id(ntp).now().strftime("%Y-%m-%d").c_str());
      it.printf(20, 150, id(large), id(ntp).now().strftime("%H:%M:%S").c_str());

pay attention to external_components

balbulator commented 2 years ago

I solved the first problem by providing a ready IP address. But there is another problem...

INFO Reading configuration /config/esphome/eink.yaml...
INFO Detected timezone 'Europe/Kiev'
INFO Generating C++ source...
INFO Compiling app...
Processing eink-dashboard (board: esp32dev; framework: arduino; platform: platformio/espressif32 @ 3.5.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- <AsyncTCP-esphome> 1.2.2
|-- <WiFi> 1.0
|-- <FS> 1.0
|-- <Update> 1.0
|-- <ESPAsyncWebServer-esphome> 2.1.0
|   |-- <AsyncTCP-esphome> 1.2.2
|-- <DNSServer> 1.1.0
|-- <ESPmDNS> 1.0
|-- <epdiy> 1.0.0+sha.3e2c515
Compiling /data/eink-dashboard/.pioenvs/eink-dashboard/src/main.cpp.o
Compiling /data/eink-dashboard/.pioenvs/eink-dashboard/libc74/ESPAsyncWebServer-esphome/WebResponses.cpp.o
Compiling /data/eink-dashboard/.pioenvs/eink-dashboard/libc74/ESPAsyncWebServer-esphome/WebServer.cpp.o
Compiling /data/eink-dashboard/.pioenvs/eink-dashboard/lib333/DNSServer/DNSServer.cpp.o
Archiving /data/eink-dashboard/.pioenvs/eink-dashboard/lib333/libDNSServer.a
Compiling /data/eink-dashboard/.pioenvs/eink-dashboard/lib915/ESPmDNS/ESPmDNS.cpp.o
Compiling /data/eink-dashboard/.pioenvs/eink-dashboard/lib304/epdiy/board/epd_board_common.c.o
/config/esphome/eink.yaml: In lambda function:
/config/esphome/eink.yaml:431:11: error: 'DynamicJsonDocument' was not declared in this scope
           DynamicJsonDocument doc(2048);
           ^
/config/esphome/eink.yaml:432:27: error: 'doc' was not declared in this scope
           deserializeJson(doc, (id(w_forecast).state.c_str()));
                           ^
/config/esphome/eink.yaml:432:59: error: 'deserializeJson' was not declared in this scope
           deserializeJson(doc, (id(w_forecast).state.c_str()));
                                                           ^
/config/esphome/eink.yaml:433:11: error: 'JsonArray' was not declared in this scope
           JsonArray root = doc.as<JsonArray>();
           ^
/config/esphome/eink.yaml:436:13: error: 'JsonObject' was not declared in this scope
             JsonObject root_0 = root[i];
             ^
/config/esphome/eink.yaml:441:43: error: 'root_0' was not declared in this scope
             std::string root_0_datetime = root_0["datetime"];
                                           ^
Compiling /data/eink-dashboard/.pioenvs/eink-dashboard/lib304/epdiy/board/epd_board_lilygo_t5_47.c.o
Archiving /data/eink-dashboard/.pioenvs/eink-dashboard/lib915/libESPmDNS.a
Compiling /data/eink-dashboard/.pioenvs/eink-dashboard/lib304/epdiy/board/epd_board_v2_v3.c.o
Archiving /data/eink-dashboard/.pioenvs/eink-dashboard/libc74/libESPAsyncWebServer-esphome.a
Compiling /data/eink-dashboard/.pioenvs/eink-dashboard/lib304/epdiy/board/epd_board_v4.c.o
*** [/data/eink-dashboard/.pioenvs/eink-dashboard/src/main.cpp.o] Error 1
Compiling /data/eink-dashboard/.pioenvs/eink-dashboard/lib304/epdiy/board/epd_board_v5.c.o
========================= [FAILED] Took 15.00 seconds =========================
troxor commented 10 months ago

I had to add the following:

dashboard.yaml:

esphome:
  libraries:
    - "ArduinoJson"

and common.h:

#include <ArduinoJson.h>