airy10 / esphome-m5stickC

esphome components for the M5StickC
82 stars 78 forks source link

Error compiling st775 #5

Open chrnueve opened 4 years ago

chrnueve commented 4 years ago

Hi, I'm trying to upload your sample yaml to a M5StickC from HA ESPHome integration, but is giving me an error on compile time with st7735.h. Here's a log of a compilation

CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/m5stack-core-esp32.html PLATFORM: Espressif 32 > M5Stack Core ESP32 HARDWARE: ESP32 240MHz 320KB 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) Library Dependency Finder -> http://bit.ly/configure-pio-ldf LDF MODES: FINDER(chain) COMPATIBILITY(soft) Collected 27 compatible libraries Scanning dependencies... Dependency Graph |-- 1.0.3 |-- 1.0 | |-- 1.0 |-- 1.0 |-- 1.0.1 |-- 1.0 |-- 1.0 Compiling /data/m5stick1/.pioenvs/m5stick1/src/esphome/components/st7735/st7735.cpp.o Compiling /data/m5stick1/.pioenvs/m5stick1/src/esphome/core/controller.cpp.o Compiling /data/m5stick1/.pioenvs/m5stick1/src/esphome/core/esphal.cpp.o Compiling /data/m5stick1/.pioenvs/m5stick1/src/esphome/core/log.cpp.o In file included from src/esphome/components/st7735/st7735.cpp:1:0: src/esphome/components/st7735/st7735.h:109:39: error: expected template-name before '<' token public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_HIGH, spi::CLOCK_PHASE_TRAILING, ^ src/esphome/components/st7735/st7735.h:109:39: error: expected '{' before '<' token src/esphome/components/st7735/st7735.h:109:39: error: expected unqualified-id before '<' token src/esphome/components/st7735/st7735.cpp:355:1: error: expected '}' at end of input } // namespace esphome ^ src/esphome/components/st7735/st7735.cpp:355:1: error: expected '}' at end of input *** [/data/m5stick1/.pioenvs/m5stick1/src/esphome/components/st7735/st7735.cpp.o] Error 1

I'll check tomorrow to build it using the esphome-cli Thank you for your work!

airy10 commented 4 years ago

I'm not using esphome HA integration. It might be some compatibility with the esphome version used (stable, dev...). I'm using current dev version.

geiseri commented 4 years ago

I had no issues. One thing to note is that you should copy in the custom components before you configure the device. Otherwise, it will select the M5Stack Core ESP32 and that will not work. You need to make sure that it is the following:

esphome:
  name:  my_m5stckc
  platform: ESP32
  board: m5stick-c
  platformio_options:
    upload_speed: 115200

Once I did that it worked like a charm.

@airy10 What is the plan to push this upstream to ESPhome?