asmfreak / esphome_max7219

Other
22 stars 9 forks source link

Compilation error during build on latest (beta/dev) esphome #2

Open T-REX-XP opened 5 years ago

T-REX-XP commented 5 years ago

Hello. I have got a problem with compilation firmware for wemos d1 board, when your module is imported. At first I have fixed all includes.But still have another errors. Could you please fix this module for using with latest version of esphome.

Thanks.

asmfreak commented 5 years ago

Could you copy/paste the errors here? I'm thinking about creating a pull req to esphome from this repo. I'll need some time to polish the code. Link esphome/feature-requests#14

T-REX-XP commented 5 years ago

here is the compilation issue:

INFO Reading configuration /config/esphome/test2.yaml...
INFO Generating C++ source...
INFO Compiling app...
INFO Running:  platformio run -d /config/esphome/test2
Processing test2 (framework: arduino; platform: espressif8266@1.8.0; board: d1_mini)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/d1_mini.html
PLATFORM: Espressif 8266 1.8.0 > WeMos D1 R2 & mini
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: toolchain-xtensa 1.40802.0 (4.8.2), tool-esptool 1.413.0 (4.13), framework-arduinoespressif8266 2.20402.4 (2.4.2)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Looking for Update library in registry
Warning! Library `{'requirements': None, 'name': 'Update'}` has not been found in PlatformIO Registry.
You can ignore this message, if `{'requirements': None, 'name': 'Update'}` is a built-in library (included in framework, SDK). E.g., SPI, Wire, etc.
Found 27 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ESPAsyncTCP> 1.2.0
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS>
|   |-- <ESP8266WiFi> 1.0
|-- <SPI> 1.0
Compiling /data/test2/.pioenvs/test2/src/main.cpp.o
Archiving /data/test2/.pioenvs/test2/lib4d9/libESP8266WiFi.a
Compiling /data/test2/.pioenvs/test2/lib009/ESPAsyncTCP_ID305/AsyncPrinter.cpp.o
Compiling /data/test2/.pioenvs/test2/lib009/ESPAsyncTCP_ID305/ESPAsyncTCP.cpp.o
Compiling /data/test2/.pioenvs/test2/lib009/ESPAsyncTCP_ID305/ESPAsyncTCPbuffer.cpp.o
In file included from src/main.cpp:12:0:
src/max7219grid.hpp:7:1: error: 'ESPHOME_NAMESPACE_BEGIN' does not name a type
 ESPHOME_NAMESPACE_BEGIN
 ^
src/max7219grid.hpp:69:1: error: 'ESPHOME_NAMESPACE_END' does not name a type
 ESPHOME_NAMESPACE_END
 ^
src/max7219grid.hpp:226:1: error: 'ESPHOME_NAMESPACE_END' does not name a type
 ESPHOME_NAMESPACE_END
 ^
Compiling /data/test2/.pioenvs/test2/lib009/ESPAsyncTCP_ID305/SyncClient.cpp.o
*** [/data/test2/.pioenvs/test2/src/main.cpp.o] Error 1
========================== [ERROR] Took 10.28 seconds ==========================
saikek commented 5 years ago

Same for me (including pull request), building for ESP8266 - Nodemcu V3

INFO Generating C++ source...
INFO Compiling app...
INFO Running:  platformio run -d father_clock
Processing father_clock (framework: arduino; platform: espressif8266@1.8.0; board: nodemcuv2)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/nodemcuv2.html
PLATFORM: Espressif 8266 > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz 80KB RAM (4MB Flash)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 27 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS>
|   |-- <ESP8266WiFi> 1.0
|-- <ESPAsyncTCP> 1.2.0
|   |-- <ESP8266WiFi> 1.0
Compiling .pioenvs/father_clock/src/main.cpp.o
Compiling .pioenvs/father_clock/lib5f6/ESP8266WiFi/CertStoreBearSSL.cpp.o
Compiling .pioenvs/father_clock/lib5f6/ESP8266WiFi/ESP8266WiFi.cpp.o
Compiling .pioenvs/father_clock/lib5f6/ESP8266WiFi/ESP8266WiFiAP.cpp.o
Compiling .pioenvs/father_clock/lib5f6/ESP8266WiFi/ESP8266WiFiGeneric.cpp.o
In file included from src/main.cpp:11:0:
src/max7219grid.hpp:7:1: error: 'ESPHOME_NAMESPACE_BEGIN' does not name a type
ESPHOME_NAMESPACE_BEGIN
^
src/max7219grid.hpp:68:1: error: 'ESPHOME_NAMESPACE_END' does not name a type
ESPHOME_NAMESPACE_END
^
src/max7219grid.hpp:225:1: error: 'ESPHOME_NAMESPACE_END' does not name a type
ESPHOME_NAMESPACE_END
^
*** [.pioenvs/father_clock/src/main.cpp.o] Error 1
saikek commented 5 years ago

Apparently, now you need to use

namespace esphome {
}

instead

T-REX-XP commented 5 years ago

Is it resolve compilation issue?

saikek commented 5 years ago

nope... I've tried few tweaks, but my C++ level is not enough to resolve this issue. Also I need some animations, so most likely at this moment I would grab pieces of code from different places (NTP time sync, MAX7129 display, BMP280 sensor).

https://github.com/MKme/Wemos-D1-Subscriber-Counter-MAX7219-LED-Matrix/blob/master/D1MiniSubscriberCounterMAX2719/D1MiniSubscriberCounterMAX2719.ino

looks promising for what I want.

saikek commented 5 years ago

I've ended up using https://github.com/Qrome/marquee-scroller for my specific task if anyone is looking for a library / binary.

bcanning84 commented 4 years ago

Has anyone solved the compilation errors that come up during the build? Also building for ESP8266, Nodemcu V3. As above getting the errors on lines: 'ESPHOME_NAMESPACE_BEGIN' 'ESPHOME_NAMESPACE_END' As above I have tried tweaking and using 'namespace esphome {}' but had no joy, my C++ knowledge is definitely not up to scratch. It would be great to see this as a component in ESPHome eventually!

lotharbach commented 4 years ago

My pull request https://github.com/ASMfreaK/esphome_max7219/pull/4 fixes all compilation issues and works with the scrolling vertical lines example. I don't think the functions to print text or the time are currently working.