elupus / esphome-nibe

Esphome components for nibe heat pumps
MIT License
57 stars 19 forks source link

ESP32 problem #26

Closed flopp999 closed 1 year ago

flopp999 commented 1 year ago

Attached is the error log.

Don't mind the name for the yaml, I just reused an ESP32 that I had for other project.

I am not sure what board I have. I just started to play with ESP32. Other project(not NIBE) was working fine and this is what was writen in YAML:

esp32:
  board: esp32dev
  framework:
    type: arduino

First error is this line "error map" https://github.com/elupus/esphome-nibe/blob/master/components/nibegw/NibeGwComponent.h#L43

INFO Reading configuration /config/esphome/water.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing water (board: esp32dev; framework: arduino; platform: platformio/espressif32 @ 5.2.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- WiFi @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- Update @ 2.0.0
|-- ESP32 Async UDP @ 2.0.0
Compiling /data/water/.pioenvs/water/src/esphome/components/nibegw/NibeGwComponent.cpp.o
Compiling /data/water/.pioenvs/water/src/esphome/components/socket/lwip_raw_tcp_impl.cpp.o
Compiling /data/water/.pioenvs/water/src/esphome/components/socket/socket.cpp.o
Compiling /data/water/.pioenvs/water/src/esphome/components/uart/uart.cpp.o
Compiling /data/water/.pioenvs/water/src/esphome/components/uart/uart_component.cpp.o
Compiling /data/water/.pioenvs/water/src/esphome/components/uart/uart_component_esp32_arduino.cpp.o
In file included from src/esphome/components/nibegw/NibeGwComponent.cpp:1:
src/esphome/components/nibegw/NibeGwComponent.h:43:10: error: 'map' in namespace 'std' does not name a template type
     std::map<request_key_type, std::queue<request_data_type>> requests_;
          ^~~
src/esphome/components/nibegw/NibeGwComponent.h:43:5: note: 'std::map' is defined in header '<map>'; did you forget to '#include <map>'?
src/esphome/components/nibegw/NibeGwComponent.h:19:1:
+#include <map>
 #endif
src/esphome/components/nibegw/NibeGwComponent.h:43:5:
     std::map<request_key_type, std::queue<request_data_type>> requests_;
     ^~~
src/esphome/components/nibegw/NibeGwComponent.h:44:10: error: 'map' in namespace 'std' does not name a template type
     std::map<request_key_type, request_data_type>             requests_const_;
          ^~~
src/esphome/components/nibegw/NibeGwComponent.h:44:5: note: 'std::map' is defined in header '<map>'; did you forget to '#include <map>'?
     std::map<request_key_type, request_data_type>             requests_const_;
     ^~~
Compiling /data/water/.pioenvs/water/src/esphome/components/uart/uart_component_esp8266.cpp.o
src/esphome/components/nibegw/NibeGwComponent.h: In member function 'void NibeGwComponent::set_const_request(int, int, request_data_type)':
src/esphome/components/nibegw/NibeGwComponent.h:74:9: error: 'requests_const_' was not declared in this scope
         requests_const_[request_key_type(address, token)] = std::move(request);
         ^~~~~~~~~~~~~~~
src/esphome/components/nibegw/NibeGwComponent.h:74:9: note: suggested alternative: 'requests_queue_max'
         requests_const_[request_key_type(address, token)] = std::move(request);
         ^~~~~~~~~~~~~~~
         requests_queue_max
src/esphome/components/nibegw/NibeGwComponent.h: In member function 'void NibeGwComponent::add_queued_request(int, int, request_data_type)':
src/esphome/components/nibegw/NibeGwComponent.h:79:23: error: 'requests_' was not declared in this scope
         auto& queue = requests_[request_key_type(address, token)];
                       ^~~~~~~~~
src/esphome/components/nibegw/NibeGwComponent.h:79:23: note: suggested alternative: 'request'
         auto& queue = requests_[request_key_type(address, token)];
                       ^~~~~~~~~
                       request
Compiling /data/water/.pioenvs/water/src/esphome/components/uart/uart_component_esp_idf.cpp.o
src/esphome/components/nibegw/NibeGwComponent.cpp: In member function 'int NibeGwComponent::callback_msg_token_received(eTokenType, byte*)':
src/esphome/components/nibegw/NibeGwComponent.cpp:83:26: error: 'requests_' was not declared in this scope
         const auto& it = requests_.find(key);
                          ^~~~~~~~~
src/esphome/components/nibegw/NibeGwComponent.cpp:96:26: error: 'requests_const_' was not declared in this scope
         const auto& it = requests_const_.find(key);
                          ^~~~~~~~~~~~~~~
Compiling /data/water/.pioenvs/water/src/esphome/components/uart/uart_component_rp2040.cpp.o
src/esphome/components/nibegw/NibeGwComponent.cpp:96:26: note: suggested alternative: 'requests_queue_max'
         const auto& it = requests_const_.find(key);
                          ^~~~~~~~~~~~~~~
                          requests_queue_max
Compiling /data/water/.pioenvs/water/src/esphome/components/uart/uart_debugger.cpp.o
Compiling /data/water/.pioenvs/water/src/esphome/components/wifi/wifi_component.cpp.o
*** [/data/water/.pioenvs/water/src/esphome/components/nibegw/NibeGwComponent.cpp.o] Error 1
flopp999 commented 1 year ago

This is the board I have

ESP32 TYPE-C USB CP2102 ESP32-DevKitC-32 ESP-WROOM-32 https://a.aliexpress.com/_EIr59nF

flopp999 commented 1 year ago

I was using wrong example :) When I tried with this it worked fine https://github.com/elupus/esphome-nibe/blob/master/examples/lilygo-t-can485.yaml