@ _Szczepan, próbuję skompilować przykładowy kod dla wmbus z gitbub. Już podczas kompilacji wyskakuje parę ostrzeżeń:
In file included from src\esphome\components\wmbus\wmbus.cpp:2:
src\esphome\components\wmbus\wmbus.cpp: In member function 'virtual void esphome::wmbus::WMBusComponent::loop()':
src\esphome\components\wmbus\wmbus.cpp:59:25: warning: too many arguments for format [-Wformat-extra-args]
59 | ESP_LOGE(TAG, "Something was not OK during decrypting telegram for ID [0x%08X] '%s' key: '$s'", meter_id, sele
cted_driver->get_name().c_str(), key.c_str());
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:69:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
69 | #define ESPHOME_LOG_FORMAT(format) format
| ^~~~~~
src/esphome/core/log.h:146:28: note: in expansion of macro 'esph_log_e'
146 | #define ESP_LOGE(tag, ...) esph_log_e(tag, __VA_ARGS__)
| ^~~~~~~~~~
src\esphome\components\wmbus\wmbus.cpp:59:11: note: in expansion of macro 'ESP_LOGE'
59 | ESP_LOGE(TAG, "Something was not OK during decrypting telegram for ID [0x%08X] '%s' key: '$s'", meter_id, sele
cted_driver->get_name().c_str(), key.c_str());
| ^~~~~~~~
In file included from src\esphome\components\wmbus\sensor\wmbus_sensor.cpp:1:
src\esphome\components\wmbus\sensor\wmbus_sensor.cpp: In member function 'virtual void esphome::wmbus::WMBusSensor::dump_config(
)':
src\esphome\components\wmbus\sensor\wmbus_sensor.cpp:24:22: warning: format '%lu' expects argument of type 'long unsigned int',
but argument 5 has type 'uint32_t' {aka 'unsigned int'} [-Wformat=]
24 | ESP_LOGCONFIG(TAG, " ID: %lu [0x%08X]", this->id, this->id);
Compiling .pioenvs\wemoswmbus\src\esphome\core\helpers.cpp.o
| ^~~~~~~~~~~~~~~~~~~~
src/esphome/core/log.h:69:36: note: in definition of macro 'ESPHOME_LOG_FORMAT'
69 | #define ESPHOME_LOG_FORMAT(format) format
| ^~~~~~
src/esphome/core/log.h:154:33: note: in expansion of macro 'esph_log_config'
154 | #define ESP_LOGCONFIG(tag, ...) esph_log_config(tag, __VA_ARGS__)
| ^~~~~~~~~~~~~~~
src\esphome\components\wmbus\sensor\wmbus_sensor.cpp:24:3: note: in expansion of macro 'ESP_LOGCONFIG'
24 | ESP_LOGCONFIG(TAG, " ID: %lu [0x%08X]", this->id, this->id);
| ^~~~~~~~~~~~~
src\esphome\components\wmbus\sensor\wmbus_sensor.cpp:24:31: note: format string is defined here
24 | ESP_LOGCONFIG(TAG, " ID: %lu [0x%08X]", this->id, this->id);
Compiling .pioenvs\wemoswmbus\src\esphome\core\log.cpp.o
| ~~^
| |
| long unsigned int
| %u
oraz:
Compiling .pioenvs\wemoswmbus\liba37\wMbus-lib\3outof6.cpp.o
Compiling .pioenvs\wemoswmbus\liba37\wMbus-lib\aes.cpp.o
Compiling .pioenvs\wemoswmbus\liba37\wMbus-lib\crc.cpp.o
.piolibdeps\wemoswmbus\SmartRC-CC1101-Driver-Lib\ELECHOUSE_CC1101_SRC_DRV.cpp: In member function 'void ELECHOUSE_CC1101::Reset(
)':
.piolibdeps\wemoswmbus\SmartRC-CC1101-Driver-Lib\ELECHOUSE_CC1101_SRC_DRV.cpp:149:3: warning: this 'while' clause does not guard
... [-Wmisleading-indentation]
149 | while(digitalRead(MISO_PIN));
| ^~~~~
.piolibdeps\wemoswmbus\SmartRC-CC1101-Driver-Lib\ELECHOUSE_CC1101_SRC_DRV.cpp:150:2: note: ...this statement, but the latter is
misleadingly indented as if it were guarded by the 'while'
150 | digitalWrite(SS_PIN, HIGH);
| ^~~~~~~~~~~~
Compiling .pioenvs\wemoswmbus\liba37\wMbus-lib\mbus_packet.cpp.o
Compiling .pioenvs\wemoswmbus\liba37\wMbus-lib\rf_mbus.cpp.o
Compiling .pioenvs\wemoswmbus\liba37\wMbus-lib\utils.cpp.o
.piolibdeps\wemoswmbus\SmartRC-CC1101-Driver-Lib\ELECHOUSE_CC1101_SRC_DRV.cpp: In member function 'void ELECHOUSE_CC1101::setPA(
int)':
.piolibdeps\wemoswmbus\SmartRC-CC1101-Driver-Lib\ELECHOUSE_CC1101_SRC_DRV.cpp:498:13: warning: 'a' may be used uninitialized in
this function [-Wmaybe-uninitialized]
498 | PA_TABLE[1] = a;
| ~~~~~~~~~~~~^~~
Zaznaczam, że obecnie nie mam podłączonego cc1101 ale chyba esp nie powinien załapywać bootloop’a w takim przypadku. Mam to w logu ESP:
[20:58:44]←[0;35m[C][api:025]: Setting up Home Assistant API server...←[0m
[20:58:44]
[20:58:46]
[20:58:46]--------------- CUT HERE FOR EXCEPTION DECODER ---------------
[20:58:46]
[20:58:46]Soft WDT reset
[20:58:46]
[20:58:46]>>>stack>>>
←[33mWARNING Found stack trace! Trying to decode it←[0m
[20:58:46]
[20:58:46]ctx: cont
[20:58:46]sp: 3ffffc60 end: 3fffffc0 offset: 01a0
[20:58:46]3ffffe00: 3fff19dc 00000002 3fff241d 4022690d
←[33mWARNING Decoded 0x4022690d: ELECHOUSE_CC1101::Reset()←[0m
[20:58:46]3ffffe10: 3ffffe80 00000002 3fff2414 402274fc
←[33mWARNING Decoded 0x402274fc: ELECHOUSE_CC1101::Init()←[0m
[20:58:46]3ffffe20: 3fff3d3c 00000002 3fff2414 4021fc3d
←[33mWARNING Decoded 0x4021fc3d: rf_mbus_init(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char, unsigne
d char)←[0m
[20:58:46]3ffffe30: 0000000f 0000000d 0000000e 40236c0c
←[33mWARNING Decoded 0x40236c0c: operator delete(void*) at /workdir/repo/gcc-gnu/libstdc++-v3/libsupc++/del_op.cc:50←[0m
[20:58:46]3ffffe40: ffff2a45 3ffe8cbc 00000020 00000002
[20:58:46]3ffffe50: 00000005 0000000d 3fff321c 4021127a
←[33mWARNING Decoded 0x4021127a: esphome::wmbus::WMBusComponent::setup()←[0m
[20:58:46]3ffffe60: 3ffffea0 3fff54a4 00000000 402138d9
←[33mWARNING Decoded 0x402138d9: void std::__push_heap<__gnu_cxx::__normal_iterator<std::unique_ptr<esphome::Scheduler::Schedule
rItem, std::default_delete<esphome::Scheduler::SchedulerItem> >*, std::vector<std::unique_ptr<esphome::Scheduler::SchedulerItem,
std::default_delete<esphome::Scheduler::SchedulerItem> >, std::allocator<std::unique_ptr<esphome::Scheduler::SchedulerItem, std
::default_delete<esphome::Scheduler::SchedulerItem> > > > >, int, std::unique_ptr<esphome::Scheduler::SchedulerItem, std::defaul
t_delete<esphome::Scheduler::SchedulerItem> >, __gnu_cxx::__ops::_Iter_comp_val<bool (*)(std::unique_ptr<esphome::Scheduler::Sch
edulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> > const&, std::unique_ptr<esphome::Scheduler::SchedulerItem,
std::default_delete<esphome::Scheduler::SchedulerItem> > const&)> >(__gnu_cxx::__normal_iterator<std::unique_ptr<esphome::Schedu
ler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> >*, std::vector<std::unique_ptr<esphome::Scheduler::S
chedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> >, std::allocator<std::unique_ptr<esphome::Scheduler::Sched
ulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> > > > >, int, int, std::unique_ptr<esphome::Scheduler::Schedule
rItem, std::default_delete<esphome::Scheduler::SchedulerItem> >, __gnu_cxx::__ops::_Iter_comp_val<bool (*)(std::unique_ptr<espho
me::Scheduler::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> > const&, std::unique_ptr<esphome::Schedule
r::SchedulerItem, std::default_delete<esphome::Scheduler::SchedulerItem> > const&)>&)←[0m
[20:58:46]3ffffe70: 00000000 3fff54a4 3fff54a8 3fff3ef0
[20:58:46]3ffffe80: 0000000f 0000000e 3fff1540 3fff3ef0
[20:58:46]3ffffe90: 00000000 3fff3eec 3fff1540 00000102
[20:58:46]3ffffea0: 3fff321c 00000011 3fff1540 40228ebc
←[33mWARNING Decoded 0x40228ebc: esphome::Component::call_setup()←[0m
[20:58:46]3ffffeb0: 3fff3414 3ffffed0 3fff1540 40228f74
←[33mWARNING Decoded 0x40228f74: esphome::Component::call()←[0m
[20:58:46]3ffffec0: 3fff3890 00000010 3fff1540 402127b9
←[33mWARNING Decoded 0x402127b9: esphome::Application::setup()←[0m
[20:58:46]3ffffed0: 0000000c 0000000c 3fff3e0c 4020942c
←[33mWARNING Decoded 0x4020942c: esphome::sensor::Sensor::set_unit_of_measurement(std::__cxx11::basic_string<char, std::char_tra
its<char>, std::allocator<char> > const&)←[0m
[20:58:46]3ffffee0: 00000048 0000002c 0000000b 3ffeac1c
[20:58:46]3ffffef0: 3fff3b00 3fff1540 3fff3ad4 3ffeac1c
[20:58:46]3fffff00: 3fff3b00 3fff1540 3fff15fc 40214ed6
←[33mWARNING Decoded 0x40214ed6: setup←[0m
[20:58:46]3fffff10: 3fffff18 00000003 00b3c26d 65740072
[20:58:46]3fffff20: 6e650072 00687467 00000000 00000000
[20:58:46]3fffff30: 3fffff38 0000000a 33303630 37383437
[20:58:46]3fffff40: 00003437 00000000 00000000 00000000
[20:58:46]3fffff50: 00000000 00000000 00000000 00000000
[20:58:46]3fffff60: 00000000 00000000 3fffff70 00000004 <
[20:58:46]3fffff70: 72617a69 36317200 fe000032 feefeffe
[20:58:46]3fffff80: 3fff3950 00000000 3fff3ad4 00000002
[20:58:46]3fffff90: feefeffe feefeffe feefeffe 3fff1ba4
[20:58:46]3fffffa0: 3fffdad0 00000000 3fff1b90 4022407c
←[33mWARNING Decoded 0x4022407c: loop_wrapper() at core_esp8266_main.cpp←[0m
[20:58:46]3fffffb0: feefeffe feefeffe 3ffe8684 401004a5
←[33mWARNING Decoded 0x401004a5: cont_wrapper←[0m
[20:58:46]<<<stack<<<
[20:58:46]
[20:58:46]--------------- CUT HERE FOR EXCEPTION DECODER ---------------
[20:58:46]
[20:58:46] ets Jan 8 2013,rst cause:2, boot mode:(3,6)
P.S. czy planujesz rozszerzyć komponent o obsługę liczników hydrodigit (BMETERS), gdzieś wcześniej pojawiała się taka informacja od Ciebie, że potrafisz to zdekodować ale nie widzę pliku w komponencie dla tego wodomierza? obecnie mam to zrobione na wmbusmeters, w razie czego służe ramkami i ewentualnie moimi skryptami w pythonie gdzie odczytywałem je zanim nastał wmbusmeters.