Hi,
I am using
- Home Assistant OS 11.2
- Home Assistant Supervisor 2023.11.6
- Home Assistant Core Update 2023.12.1
I installed a CO2 captor SCD40 on esp8266, board: d1_mini (framework: version 2.7.4)
When I try to call the api, I get compilation errors.
Sample Code to call the api :
api:
encryption:
key: “#SecretKey”
Logs obtained when code related to api is enabled :
INFO ESPHome 2023.11.6
INFO Reading configuration /config/esphome/co2.yaml…
WARNING The selected Arduino framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
WARNING The selected Arduino framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
INFO Generating C++ source…
INFO Compiling app…
Processing co2 (board: d1_mini; framework: arduino; platform: platformio/[email protected])HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
Dependency Graph
|-- ESP8266WiFi @ 1.0
|-- ESP8266mDNS @ 1.2
|-- noise-c @ 0.1.4
|-- Wire @ 1.0
|-- FastLED @ 3.3.2
Compiling .pioenvs/co2/src/esphome/components/api/api_connection.cpp.o
Compiling .pioenvs/co2/src/esphome/components/api/api_server.cpp.o
Compiling .pioenvs/co2/src/esphome/components/api/list_entities.cpp.o
Compiling .pioenvs/co2/src/esphome/components/api/subscribe_state.cpp.o
In file included from src/esphome/components/api/api_connection.h:6:0,
from src/esphome/components/api/api_connection.cpp:1:
src/esphome/components/api/api_server.h:118:96: error: invalid use of ‘::’
Trigger<std::string, std::string> *client_connected_trigger_ = new Trigger<std::string, std::string>();
^
src/esphome/components/api/api_server.h:118:96: error: expected ‘;’ at end of member declaration
src/esphome/components/api/api_server.h:118:102: error: expected unqualified-id before ‘>’ token
Trigger<std::string, std::string> *client_connected_trigger_ = new Trigger<std::string, std::string>();
^
src/esphome/components/api/api_server.h:119:99: error: invalid use of ‘::’
Trigger<std::string, std::string> *client_disconnected_trigger_ = new Trigger<std::string, std::string>();
^
src/esphome/components/api/api_server.h:119:99: error: expected ‘;’ at end of member declaration
src/esphome/components/api/api_server.h:119:105: error: expected unqualified-id before ‘>’ token
Trigger<std::string, std::string> *client_disconnected_trigger_ = new Trigger<std::string, std::string>();
^
src/esphome/components/api/api_server.h:118:83: error: template argument 1 is invalid
Trigger<std::string, std::string> *client_connected_trigger_ = new Trigger<std::string, std::string>();
^
src/esphome/components/api/api_server.h:119:86: error: template argument 1 is invalid
Trigger<std::string, std::string> *client_disconnected_trigger_ = new Trigger<std::string, std::string>();
^
In file included from src/esphome/components/api/api_server.cpp:1:0:
src/esphome/components/api/api_server.h:118:96: error: invalid use of ‘::’
Trigger<std::string, std::string> *client_connected_trigger_ = new Trigger<std::string, std::string>();
^
src/esphome/components/api/api_server.h:118:96: error: expected ‘;’ at end of member declaration
src/esphome/components/api/api_server.h:118:102: error: expected unqualified-id before ‘>’ token
Trigger<std::string, std::string> *client_connected_trigger_ = new Trigger<std::string, std::string>();
^
src/esphome/components/api/api_server.h:119:99: error: invalid use of ‘::’
Trigger<std::string, std::string> *client_disconnected_trigger_ = new Trigger<std::string, std::string>();
^
src/esphome/components/api/api_server.h:119:99: error: expected ‘;’ at end of member declaration
src/esphome/components/api/api_server.h:119:105: error: expected unqualified-id before ‘>’ token
Trigger<std::string, std::string> *client_disconnected_trigger_ = new Trigger<std::string, std::string>();
^
src/esphome/components/api/api_server.h:118:83: error: template argument 1 is invalid
Trigger<std::string, std::string> *client_connected_trigger_ = new Trigger<std::string, std::string>();
^
src/esphome/components/api/api_server.h:119:86: error: template argument 1 is invalid
Trigger<std::string, std::string> *client_disconnected_trigger_ = new Trigger<std::string, std::string>();
^
In file included from src/esphome/components/api/api_connection.h:6:0,
from src/esphome/components/api/subscribe_state.cpp:2:
src/esphome/components/api/api_server.h:118:96: error: invalid use of ‘::’
Trigger<std::string, std::string> *client_connected_trigger_ = new Trigger<std::string, std::string>();
^
src/esphome/components/api/api_server.h:118:96: error: expected ‘;’ at end of member declaration
src/esphome/components/api/api_server.h:118:102: error: expected unqualified-id before ‘>’ token
Trigger<std::string, std::string> *client_connected_trigger_ = new Trigger<std::string, std::string>();
^
src/esphome/components/api/api_server.h:119:99: error: invalid use of ‘::’
Trigger<std::string, std::string> *client_disconnected_trigger_ = new Trigger<std::string, std::string>();
^
src/esphome/components/api/api_server.h:119:99: error: expected ‘;’ at end of member declaration
src/esphome/components/api/api_server.h:119:105: error: expected unqualified-id before ‘>’ token
Trigger<std::string, std::string> *client_disconnected_trigger_ = new Trigger<std::string, std::string>();
^
src/esphome/components/api/api_server.h:118:83: error: template argument 1 is invalid
Trigger<std::string, std::string> *client_connected_trigger_ = new Trigger<std::string, std::string>();
^
src/esphome/components/api/api_server.h:119:86: error: template argument 1 is invalid
Trigger<std::string, std::string> *client_disconnected_trigger_ = new Trigger<std::string, std::string>();
^
In file included from src/esphome/components/api/api_connection.h:6:0,
from src/esphome/components/api/list_entities.cpp:5:
src/esphome/components/api/api_server.h:118:96: error: invalid use of ‘::’
Trigger<std::string, std::string> *client_connected_trigger_ = new Trigger<std::string, std::string>();
^
src/esphome/components/api/api_server.h:118:96: error: expected ‘;’ at end of member declaration
src/esphome/components/api/api_server.h:118:102: error: expected unqualified-id before ‘>’ token
Trigger<std::string, std::string> *client_connected_trigger_ = new Trigger<std::string, std::string>();
^
src/esphome/components/api/api_server.h:119:99: error: invalid use of ‘::’
Trigger<std::string, std::string> *client_disconnected_trigger_ = new Trigger<std::string, std::string>();
^
src/esphome/components/api/api_server.h:119:99: error: expected ‘;’ at end of member declaration
src/esphome/components/api/api_server.h:119:105: error: expected unqualified-id before ‘>’ token
Trigger<std::string, std::string> *client_disconnected_trigger_ = new Trigger<std::string, std::string>();
^
src/esphome/components/api/api_server.h:118:83: error: template argument 1 is invalid
Trigger<std::string, std::string> *client_connected_trigger_ = new Trigger<std::string, std::string>();
^
src/esphome/components/api/api_server.h:119:86: error: template argument 1 is invalid
Trigger<std::string, std::string> *client_disconnected_trigger_ = new Trigger<std::string, std::string>();
^
cc1plus: warning: unrecognized command line option “-Wno-nonnull-compare” [enabled by default]
cc1plus: warning: unrecognized command line option “-Wno-nonnull-compare” [enabled by default]
*** [.pioenvs/co2/src/esphome/components/api/list_entities.cpp.o] Error 1
*** [.pioenvs/co2/src/esphome/components/api/subscribe_state.cpp.o] Error 1
cc1plus: warning: unrecognized command line option “-Wno-nonnull-compare” [enabled by default]
*** [.pioenvs/co2/src/esphome/components/api/api_connection.cpp.o] Error 1
cc1plus: warning: unrecognized command line option “-Wno-nonnull-compare” [enabled by default]
*** [.pioenvs/co2/src/esphome/components/api/api_server.cpp.o] Error 1
========================== [FAILED] Took 3.09 seconds ==========================
Can anyone please guide me where I should look or if the api sample is correct and compatible with used frameworks and versions ?