Cześć,
a czy miał ktoś problem z kompilacją?
INFO ESPHome 2024.9.0
INFO Reading configuration /config/esphome/water.yaml...
INFO Detected timezone 'Europe/Warsaw'
INFO Generating C++ source...
INFO Compiling app...
Processing water (board: nodemcuv2; framework: arduino; platform: platformio/espressif8266@4.2.1)
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
Dependency Graph
|-- ESPAsyncTCP-esphome @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.2.2
|-- DNSServer @ 1.1.1
|-- ESP8266WiFi @ 1.0
|-- ESP8266mDNS @ 1.2
|-- noise-c @ 0.1.6
|-- SPI @ 1.0
|-- SmartRC-CC1101-Driver-Lib @ 2.5.7
Compiling .pioenvs/water/src/esphome/components/wmbus/utils.cpp.o
Compiling .pioenvs/water/src/esphome/components/wmbus/wmbus.cpp.o
src/esphome/components/wmbus/utils.cpp: In function 'double addMonths(double, int)':
src/esphome/components/wmbus/utils.cpp:615:15: error: aggregate 'tm time' has incomplete type and cannot be defined
615 | struct tm time;
| ^~~~
src/esphome/components/wmbus/utils.cpp:616:5: error: 'localtime_r' was not declared in this scope; did you mean 'locale_t'?
616 | localtime_r( &ut,&time);
| ^~~~~~~~~~~
| locale_t
src/esphome/components/wmbus/utils.cpp:618:20: error: 'mktime' was not declared in this scope; did you mean 'mktemp'?
618 | return (double)mktime(&time);
| ^~~~~~
| mktemp
src/esphome/components/wmbus/utils.cpp: In function 'void addMonths(tm*, int)':
src/esphome/components/wmbus/utils.cpp:623:37: error: invalid use of incomplete type 'struct tm'
623 | bool is_last_day_in_month = date->tm_mday == get_days_in_month(date->tm_year, date->tm_mon);
| ^~
In file included from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/cwchar:44,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/bits/postypes.h:40,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/bits/char_traits.h:40,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/string:40,
from src/esphome/core/log.h:5,
from src/esphome/components/wmbus/utils.h:6,
from src/esphome/components/wmbus/utils.cpp:5:
/data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/wchar.h:82:8: note: forward declaration of 'struct tm'
82 | struct tm;
| ^~
src/esphome/components/wmbus/utils.cpp:623:72: error: invalid use of incomplete type 'struct tm'
623 | bool is_last_day_in_month = date->tm_mday == get_days_in_month(date->tm_year, date->tm_mon);
| ^~
In file included from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/cwchar:44,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/bits/postypes.h:40,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/bits/char_traits.h:40,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/string:40,
from src/esphome/core/log.h:5,
from src/esphome/components/wmbus/utils.h:6,
from src/esphome/components/wmbus/utils.cpp:5:
/data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/wchar.h:82:8: note: forward declaration of 'struct tm'
82 | struct tm;
| ^~
src/esphome/components/wmbus/utils.cpp:623:87: error: invalid use of incomplete type 'struct tm'
623 | bool is_last_day_in_month = date->tm_mday == get_days_in_month(date->tm_year, date->tm_mon);
| ^~
In file included from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/cwchar:44,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/bits/postypes.h:40,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/bits/char_traits.h:40,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/string:40,
from src/esphome/core/log.h:5,
from src/esphome/components/wmbus/utils.h:6,
from src/esphome/components/wmbus/utils.cpp:5:
/data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/wchar.h:82:8: note: forward declaration of 'struct tm'
82 | struct tm;
| ^~
src/esphome/components/wmbus/utils.cpp:625:20: error: invalid use of incomplete type 'struct tm'
625 | int year = date->tm_year + months / 12;
| ^~
In file included from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/cwchar:44,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/bits/postypes.h:40,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/bits/char_traits.h:40,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/string:40,
from src/esphome/core/log.h:5,
from src/esphome/components/wmbus/utils.h:6,
from src/esphome/components/wmbus/utils.cpp:5:
/data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/wchar.h:82:8: note: forward declaration of 'struct tm'
82 | struct tm;
| ^~
src/esphome/components/wmbus/utils.cpp:626:21: error: invalid use of incomplete type 'struct tm'
626 | int month = date->tm_mon + months % 12;
| ^~
In file included from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/cwchar:44,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/bits/postypes.h:40,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/bits/char_traits.h:40,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/string:40,
from src/esphome/core/log.h:5,
from src/esphome/components/wmbus/utils.h:6,
from src/esphome/components/wmbus/utils.cpp:5:
/data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/wchar.h:82:8: note: forward declaration of 'struct tm'
82 | struct tm;
| ^~
src/esphome/components/wmbus/utils.cpp:648:28: error: invalid use of incomplete type 'struct tm'
648 | day = std::min(date->tm_mday, get_days_in_month(year, month));
| ^~
In file included from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/cwchar:44,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/bits/postypes.h:40,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/bits/char_traits.h:40,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/string:40,
from src/esphome/core/log.h:5,
from src/esphome/components/wmbus/utils.h:6,
from src/esphome/components/wmbus/utils.cpp:5:
/data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/wchar.h:82:8: note: forward declaration of 'struct tm'
82 | struct tm;
| ^~
src/esphome/components/wmbus/utils.cpp:651:9: error: invalid use of incomplete type 'struct tm'
651 | date->tm_year = year;
| ^~
In file included from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/cwchar:44,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/bits/postypes.h:40,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/bits/char_traits.h:40,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/string:40,
from src/esphome/core/log.h:5,
from src/esphome/components/wmbus/utils.h:6,
from src/esphome/components/wmbus/utils.cpp:5:
/data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/wchar.h:82:8: note: forward declaration of 'struct tm'
82 | struct tm;
| ^~
src/esphome/components/wmbus/utils.cpp:652:9: error: invalid use of incomplete type 'struct tm'
652 | date->tm_mon = month;
| ^~
In file included from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/cwchar:44,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/bits/postypes.h:40,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/bits/char_traits.h:40,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/string:40,
from src/esphome/core/log.h:5,
from src/esphome/components/wmbus/utils.h:6,
from src/esphome/components/wmbus/utils.cpp:5:
/data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/wchar.h:82:8: note: forward declaration of 'struct tm'
82 | struct tm;
| ^~
src/esphome/components/wmbus/utils.cpp:653:9: error: invalid use of incomplete type 'struct tm'
653 | date->tm_mday = day;
| ^~
In file included from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/cwchar:44,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/bits/postypes.h:40,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/bits/char_traits.h:40,
from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/string:40,
from src/esphome/core/log.h:5,
from src/esphome/components/wmbus/utils.h:6,
from src/esphome/components/wmbus/utils.cpp:5:
/data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/wchar.h:82:8: note: forward declaration of 'struct tm'
82 | struct tm;
| ^~
src/esphome/components/wmbus/utils.cpp: In function 'std::string strdate(tm*)':
src/esphome/components/wmbus/utils.cpp:673:5: error: 'strftime' was not declared in this scope
673 | strftime(buf, sizeof(buf), "%Y-%m-%d", date);
| ^~~~~~~~
src/esphome/components/wmbus/utils.cpp: In function 'std::string strdate(double)':
src/esphome/components/wmbus/utils.cpp:680:15: error: aggregate 'tm date' has incomplete type and cannot be defined
680 | struct tm date;
| ^~~~
src/esphome/components/wmbus/utils.cpp:682:5: error: 'localtime_r' was not declared in this scope; did you mean 'locale_t'?
682 | localtime_r( &t,&date);
| ^~~~~~~~~~~
| locale_t
src/esphome/components/wmbus/utils.cpp: In function 'std::string strdatetime(tm*)':
src/esphome/components/wmbus/utils.cpp:689:5: error: 'strftime' was not declared in this scope
689 | strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M", datetime);
| ^~~~~~~~
src/esphome/components/wmbus/utils.cpp: In function 'std::string strdatetime(double)':
src/esphome/components/wmbus/utils.cpp:696:15: error: aggregate 'tm datetime' has incomplete type and cannot be defined
696 | struct tm datetime;
| ^~~~~~~~
src/esphome/components/wmbus/utils.cpp:698:5: error: 'localtime_r' was not declared in this scope; did you mean 'locale_t'?
698 | localtime_r( &t,&datetime);
| ^~~~~~~~~~~
| locale_t
src/esphome/components/wmbus/utils.cpp: In function 'std::string strdatetimesec(tm*)':
src/esphome/components/wmbus/utils.cpp:705:5: error: 'strftime' was not declared in this scope
705 | strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", datetime);
| ^~~~~~~~
src/esphome/components/wmbus/utils.cpp: In function 'std::string strdatetimesec(double)':
src/esphome/components/wmbus/utils.cpp:711:15: error: aggregate 'tm datetime' has incomplete type and cannot be defined
711 | struct tm datetime;
| ^~~~~~~~
src/esphome/components/wmbus/utils.cpp:713:5: error: 'localtime_r' was not declared in this scope; did you mean 'locale_t'?
713 | localtime_r( &t,&datetime);
| ^~~~~~~~~~~
| locale_t
src/esphome/components/wmbus/utils.cpp: In function 'std::string strTimestampUTC(double)':
src/esphome/components/wmbus/utils.cpp:783:15: error: aggregate 'tm ts' has incomplete type and cannot be defined
783 | struct tm ts;
| ^~
src/esphome/components/wmbus/utils.cpp:784:5: error: 'gmtime_r' was not declared in this scope; did you mean 'time_t'?
784 | gmtime_r( &d,&ts);
| ^~~~~~~~
| time_t
src/esphome/components/wmbus/utils.cpp:785:5: error: 'strftime' was not declared in this scope
785 | strftime(datetime, sizeof(datetime), "%FT%TZ", &ts);
| ^~~~~~~~
*** [.pioenvs/water/src/esphome/components/wmbus/utils.cpp.o] Error 1
In file included from src/esphome/components/web_server_base/web_server_base.h:11,
from src/esphome/components/captive_portal/captive_portal.h:11,
from src/esphome/components/wmbus/wmbus.cpp:11:
.piolibdeps/water/ESPAsyncWebServer-esphome/src/ESPAsyncWebServer.h:280:68: warning: 'warning_x' attribute directive ignored [-Wattributes]
280 | const String& ASYNCWEBSERVER_REGEX_ATTRIBUTE pathArg(size_t i) const;
| ^~~~~
src/esphome/components/wmbus/wmbus.cpp:14:25: error: expected constructor, destructor, or type conversion before '(' token
14 | SET_LOOP_TASK_STACK_SIZE(16 * 1024);
| ^
In file included from src/esphome/components/wmbus/wmbus.h:3,
from src/esphome/components/wmbus/wmbus.cpp:1:
src/esphome/components/wmbus/wmbus.cpp: In member function 'virtual void esphome::wmbus::WMBusComponent::dump_config()':
src/esphome/components/wmbus/wmbus.cpp:314:43: error: 'class EspClass' has no member named 'getEfuseMac'
314 | ESP_LOGCONFIG(TAG, " MAC: %08X", ESP.getEfuseMac());
| ^~~~~~~~~~~
src/esphome/core/log.h:97:90: note: in definition of macro 'esph_log_config'
97 | esp_log_printf_(ESPHOME_LOG_LEVEL_CONFIG, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__)
| ^~~~~~~~~~~
src/esphome/components/wmbus/wmbus.cpp:314:5: note: in expansion of macro 'ESP_LOGCONFIG'
314 | ESP_LOGCONFIG(TAG, " MAC: %08X", ESP.getEfuseMac());
| ^~~~~~~~~~~~~
*** [.pioenvs/water/src/esphome/components/wmbus/wmbus.cpp.o] Error 1
========================== [FAILED] Took 3.22 seconds ==========================
Mój config:
esphome:
name: "water"
esp8266:
board: nodemcuv2
external_components:
- source: github://SzczepanLeon/esphome-components@main
#- source: github://SzczepanLeon/esphome-components@3.2.3
components: [ wmbus ]
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "jHethNoYJTVa7Y8BmGro="
ota:
platform: esphome
# web_server:
# port: 80
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esphome-Web-0E8F12"
password: "ttrf8rP"
time:
- platform: sntp
id: time_sntp
captive_portal:
wmbus:
mosi_pin: GPIO13
miso_pin: GPIO12
clk_pin: GPIO14
cs_pin: GPIO15
gdo0_pin: GPIO5
gdo2_pin: GPIO4
# frequency: 868.950
# all_drivers: False
# sync_mode: True
# log_all: True
sensor:
- platform: wmbus
meter_id: 0x2533145
#add_prefix: false
type: apator162
key: "00000000000000000000000000000000"
#total_water_m3:
#name: "WaterCounter"
sensors:
- name: "WaterCounter"
field: "total"
accuracy_decimals: 3
unit_of_measurement: "m³"
device_class: "water"
state_class: "total_increasing"
icon: "mdi:water"
- platform: wmbus
meter_id: 0x7147257
#add_prefix: false
type: apator162
key: "00000000000000000000000000000000"
# total_water_m3:
# name: "GardenWaterCounter"
sensors:
- name: "GardenWaterCounter"
field: "total"
accuracy_decimals: 3
unit_of_measurement: "m³"
device_class: "water"
state_class: "total_increasing"
icon: "mdi:water"
- platform: adc
name: "WaterPressure"
pin: A0
id: pressure
update_interval: 60s
unit_of_measurement: "bar"
accuracy_decimals: 2
# attenuation: 11db
filters:
- calibrate_linear:
- 0.0 -> 0.0
- 0.51 -> 4.0