Dilbert66 / esphome-vistaECP

This is an implementation of an ESPHOME custom component and ESP Library to interface directly to a Safewatch/Honeywell/Ademco Vista 15/20 alarm system using the ECP interface and very inexpensive ESP8266/ESP32 modules .
GNU Lesser General Public License v2.1
124 stars 21 forks source link

error: call of overloaded 'millis()' is ambiguous #57

Closed adamurban closed 2 years ago

adamurban commented 2 years ago

Was trying to update to the latest esphome (2021.10.0) and vistaECP source and am getting this error trying to compile... User error? Something else?

INFO Reading configuration /config/esphome/VistaAlarm.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing vistaalarm (board: nodemcuv2; framework: arduino; platform: platformio/espressif8266 @ 2.6.2)
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: 
 - framework-arduinoespressif8266 3.20704.0 (2.7.4) 
 - tool-esptool 1.413.0 (4.13) 
 - tool-esptoolpy 1.20800.0 (2.8.0) 
 - toolchain-xtensa 2.40802.200502 (4.8.2)
Library Manager: Installing Update
In file included from src/main.cpp:69:0:
src/vistaAlarm.h: In member function 'virtual void vistaECPHome::setup()':
src/vistaAlarm.h:330:36: error: call of overloaded 'millis()' is ambiguous
             zones[x].time = millis();
                                    ^
src/vistaAlarm.h:330:36: note: candidates are:
In file included from src/esphome/components/esp8266/gpio.h:6:0,
                 from src/esphome.h:19,
                 from src/main.cpp:3:
/data/cache/platformio/packages/framework-arduinoespressif8266/cores/esp8266/Arduino.h:187:15: note: long unsigned int millis()
 unsigned long millis(void);
               ^
In file included from src/esphome/components/binary_sensor/automation.h:7:0,
                 from src/esphome.h:15,
                 from src/main.cpp:3:
src/esphome/core/hal.h:37:10: note: uint32_t esphome::millis()
 uint32_t millis();
          ^
Dilbert66 commented 2 years ago

Do a Clean Build Files first.

Dilbert66 commented 2 years ago

Looks like one of the updated libraries is breaking stuff. Typical. I can't see any solution at this point right now. Might need to wait for an updated fix from the upstream libraries

Dilbert66 commented 2 years ago

Ok, i see the solution. Need to wrap my header code in an esphome namespace declaration in order to use esphome's definititions and not the upstream conflicting version. This should not need to be done but alas, it must I will post an updated vistaalarm.h version shortly

Dilbert66 commented 2 years ago

Code updated now.

adamurban commented 2 years ago

Thanks, will try it out shortly!

Dilbert66 commented 2 years ago

There is new esphome 2021.10.1 out now that addresses this issue as well as a few others. I'll leave the namespace add in in my code for now but if I see it causes issues, i'll remove it.

adamurban commented 2 years ago

May as well revert it. Can confirm that with 2021.10.1 the "old" code compiled and installed just fine.