From a62864218d6ebb8a490850f7c6f3f53db6459691 Mon Sep 17 00:00:00 2001 From: Stefan Allius Date: Fri, 7 Jun 2024 19:48:41 +0200 Subject: [PATCH] update for version 0.8.0 --- CHANGELOG.md | 5 +- app/proxy.svg | 424 +++++++++++++++++++++++++------------------------ app/proxy.yuml | 4 +- 3 files changed, 221 insertions(+), 212 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63c3f31..3d4eeed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,10 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - improve logging: add protocol or node_id to connection logs - improve logging: log ignored AT+ or MODBUS commands +- improve tracelog: log level depends on message type and source - fix typo in docker-compose.yaml and remove the external network definition - trace heartbeat and regular modbus pakets witl log level DEBUG - GEN3PLUS: don't forward ack paket from tsun to the inverter -- add allow and block filter for AT+ commands +- GEN3PLUS: add allow and block filter for AT+ commands - catch all OSError errors in the read loop - log Modbus traces with different log levels - add Modbus fifo and timeout handler @@ -27,7 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - change logging level to DEBUG for some logs - remove experimental value Register.VALUE_1 - format Register.POWER_ON_TIME as integer -- ignore non realtime values for now +- ignore catch-up values from the inverters for now ## [0.7.0] - 2024-04-20 diff --git a/app/proxy.svg b/app/proxy.svg index 9ee1aba..b111fd4 100644 --- a/app/proxy.svg +++ b/app/proxy.svg @@ -4,246 +4,254 @@ - - + + G - + A0 - - - -You can stick notes -on diagrams too! + + + +You can stick notes +on diagrams too! A1 - -Singleton + +Singleton A2 - -Mqtt - -<static>ha_restarts -<static>__client -<static>__cb_MqttIsUp - -<async>publish() -<async>close() + +Mqtt + +<static>ha_restarts +<static>__client +<static>__cb_MqttIsUp + +<async>publish() +<async>close() A1->A2 - - + + A11 - -Inverter - -cls.db_stat -cls.entity_prfx -cls.discovery_prfx -cls.proxy_node_id -cls.proxy_unique_id -cls.mqtt:Mqtt - + +Inverter + +cls.db_stat +cls.entity_prfx +cls.discovery_prfx +cls.proxy_node_id +cls.proxy_unique_id +cls.mqtt:Mqtt + A2->A11 - + A3 - -Modbus - -err -retry_cnt - -build_msg() -recv_req() -recv_resp() + +Modbus + +que +snd_handler +rsp_handler +timeout:max_retires +last_xxx +err +retry_cnt +req_pend +tim + +build_msg() +recv_req() +recv_resp() A4 - -IterRegistry - - -__iter__ + +IterRegistry + + +__iter__ A5 - -Message - -server_side:bool -header_valid:bool -header_len:unsigned -data_len:unsigned -unique_id -node_id -sug_area -_recv_buffer:bytearray -_send_buffer:bytearray -_forward_buffer:bytearray -db:Infos -new_data:list - -_read():void<abstract> -close():void -inc_counter():void -dec_counter():void + +Message + +server_side:bool +header_valid:bool +header_len:unsigned +data_len:unsigned +unique_id +node_id +sug_area +_recv_buffer:bytearray +_send_buffer:bytearray +_forward_buffer:bytearray +db:Infos +new_data:list +state + +_read():void<abstract> +close():void +inc_counter():void +dec_counter():void A4->A5 - - + + A6 - -Talent - -await_conn_resp_cnt -id_str -contact_name -contact_mail -db:InfosG3 -mb:Modbus -switch - -msg_contact_info() -msg_ota_update() -msg_get_time() -msg_collector_data() -msg_inverter_data() -msg_unknown() -close() + +Talent + +await_conn_resp_cnt +id_str +contact_name +contact_mail +db:InfosG3 +mb:Modbus +switch + +msg_contact_info() +msg_ota_update() +msg_get_time() +msg_collector_data() +msg_inverter_data() +msg_unknown() +close() A5->A6 - - + + A7 - -SolarmanV5 - -control -serial -snr -db:InfosG3P -mb:Modbus -switch - -msg_unknown() -close() + +SolarmanV5 + +control +serial +snr +db:InfosG3P +mb:Modbus +switch + +msg_unknown() +close() A5->A7 - - + + A6->A3 - - -1 -has + + +1 +has A8 - -ConnectionG3 - -remoteStream:ConnectionG3 - -close() + +ConnectionG3 + +remoteStream:ConnectionG3 + +close() A6->A8 - - + + A7->A3 - - -1 -has + + +1 +has A9 - -ConnectionG3P - -remoteStream:ConnectionG3P - -close() + +ConnectionG3P + +remoteStream:ConnectionG3P + +close() A7->A9 - - + + A8->A8 - - -0..1 -has + + +0..1 +has A12 - -InverterG3 - -__ha_restarts - -async_create_remote() -close() + +InverterG3 + +__ha_restarts + +async_create_remote() +close() A8->A12 - - + + A9->A9 - - -0..1 -has + + +0..1 +has @@ -259,118 +267,118 @@ A9->A13 - - + + A10 - -AsyncStream - -reader -writer -addr -r_addr -l_addr - -<async>server_loop() -<async>client_loop() -<async>loop -disc() -close() -__async_read() -async_write() -__async_forward() + +AsyncStream + +reader +writer +addr +r_addr +l_addr + +<async>server_loop() +<async>client_loop() +<async>loop +disc() +close() +__async_read() +async_write() +__async_forward() A10->A8 - - + + A10->A9 - - + + A11->A12 - - + + A11->A13 - - + + A14 - -Infos - -stat -new_stat_data -info_dev - -static_init() -dev_value() -inc_counter() -dec_counter() -ha_proxy_conf -ha_conf -update_db -set_db_def_value -get_db_value -ignore_this_device + +Infos + +stat +new_stat_data +info_dev + +static_init() +dev_value() +inc_counter() +dec_counter() +ha_proxy_conf +ha_conf +update_db +set_db_def_value +get_db_value +ignore_this_device A15 - -InfosG3 - - -ha_confs() -parse() + +InfosG3 + + +ha_confs() +parse() A14->A15 - - + + A16 - -InfosG3P - - -ha_confs() -parse() + +InfosG3P + + +ha_confs() +parse() A14->A16 - - + + A15->A6 - - + + A16->A7 - - + + diff --git a/app/proxy.yuml b/app/proxy.yuml index e2ce12b..60b506e 100644 --- a/app/proxy.yuml +++ b/app/proxy.yuml @@ -4,8 +4,8 @@ [note: You can stick notes on diagrams too!{bg:cornsilk}] [Singleton]^[Mqtt|ha_restarts;__client;__cb_MqttIsUp|publish();close()] -[Modbus|err;retry_cnt|build_msg();recv_req();recv_resp()] -[IterRegistry||__iter__]^[Message|server_side:bool;header_valid:bool;header_len:unsigned;data_len:unsigned;unique_id;node_id;sug_area;_recv_buffer:bytearray;_send_buffer:bytearray;_forward_buffer:bytearray;db:Infos;new_data:list|_read():void;close():void;inc_counter():void;dec_counter():void] +[Modbus|que;;snd_handler;rsp_handler;timeout:max_retires;last_xxx;err;retry_cnt;req_pend;tim|build_msg();recv_req();recv_resp()] +[IterRegistry||__iter__]^[Message|server_side:bool;header_valid:bool;header_len:unsigned;data_len:unsigned;unique_id;node_id;sug_area;_recv_buffer:bytearray;_send_buffer:bytearray;_forward_buffer:bytearray;db:Infos;new_data:list;state|_read():void;close():void;inc_counter():void;dec_counter():void] [Message]^[Talent|await_conn_resp_cnt;id_str;contact_name;contact_mail;db:InfosG3;mb:Modbus;switch|msg_contact_info();msg_ota_update();msg_get_time();msg_collector_data();msg_inverter_data();msg_unknown();;close()] [Message]^[SolarmanV5|control;serial;snr;db:InfosG3P;mb:Modbus;switch|msg_unknown();;close()] [Talent]^[ConnectionG3|remoteStream:ConnectionG3|close()]