Files
tsun-gen3-proxy/app/tests/timestamp_old.svg
Stefan Allius a42ba8a8c6 Dev 0.9 (#115)
* make timestamp handling stateless

* adapt tests for stateless timestamp handling

* initial version

* add more type annotations

* add more type annotations

* fix Generator annotation for ha_proxy_confs

* fix names of issue branches

* add more type annotations

* don't use depricated varn anymore

* don't mark all test as async

* fix imports

* fix solarman unit tests

- fake Mqtt class

* print image build time during proxy start

* update changelog

* fix pytest collect warning

* cleanup msg_get_time handler

* addapt unit test

* label debug images with debug

* dump droped packages

* fix warnings

* add systemtest with invalid start byte

* update changelog

* update changelog

* add exposed ports and healthcheck

* add wget for healthcheck

* add aiohttp

* use config validation for healthcheck

* add http server for healthcheck

* calculate msg prossesing time

* add healthy check methods

* fix typo

* log ConfigErr with DEBUG level

* Update async_stream.py

- check if processing time is < 5 sec

* add a close handler to release internal resources

* call modbus close hanlder on a close call

* add exception handling for forward handler

* update changelog

* isolate Modbus fix

* cleanup

* update changelog

* add heaithy handler

* log unrelease references

* add healtcheck

* complete exposed port list

* add wget for healtcheck

* add aiohttp

* use Enum class for State

* calc processing time for healthcheck

* add HTTP server for healthcheck

* cleanup

* Update CHANGELOG.md

* updat changelog

* add docstrings to state enum

* set new state State.received

* add healthy method

* log healthcheck infos with DEBUG level

* update changelog

* S allius/issue100 (#101)

* detect dead connections

- disconnect connection on Msg receive timeout
- improve connection trace (add connection id)

* update changelog

* fix merge conflict

* fix unittests

* S allius/issue108 (#109)

* add more data types

* adapt unittests

* improve test coverage

* fix linter warning

* update changelog

* S allius/issue102 (#110)

* hotfix: don't send two MODBUS commands together

* fix unit tests

* remove read loop

* optional sleep between msg read and sending rsp

* wait after read 0.5s before sending a response

* add pending state

* fix state definitions

* determine the connection timeout by the conn state

* avoid sending MODBUS cmds in the inverter's reporting phase

* update changelog

* S allius/issue111 (#112)

Synchronize regular MODBUS commands with the status of the inverter to prevent the inverter from crashing due to unexpected packets.

* inital checkin

* remove crontab entry for regular MODBUS cmds

* add timer for regular MODBUS polling

* fix Stop method call for already stopped timer

* optimize MB_START_TIMEOUT value

* cleanup

* update changelog

* fix buildx warnings

* fix timer cleanup

* fix Config.class_init()

- return error string or None
- release Schema structure after building thr config

* add quit flag to docker push

* fix timout calculation

* rename python to debugpy

* add asyncio log

* cleanup shutdown
- stop webserver on shutdown
- enable asyncio debug mode for debug versions

* update changelog

* update changelog

* fix exception in MODBUS timeout callback

* update changelog
2024-07-01 23:41:56 +02:00

2 lines
8.4 KiB
XML

<svg xmlns="http://www.w3.org/2000/svg" width="624.75" height="952">
<defs><marker id="arrow-filled" refX="6" refY="3" markerWidth="6" markerHeight="6" orient="auto"><path d="M0,0 6,3 0,6z" style="stroke: none; fill: black;"></path></marker><marker id="arrow-open" refX="6" refY="3" markerWidth="6" markerHeight="6" orient="auto"><path d="M0,0 6,3 0,6" style="stroke-width: 1; fill: none; stroke: black;"></path></marker></defs><rect width="88" height="38" style="stroke-width: 1; fill: none; stroke: black;" x="10" y="20"></rect><g><text fill="black" font-family="Helvetica,sans-Serif" x="54" y="39" style="text-anchor: middle; alignment-baseline: central;">Inverter</text></g><rect width="88" height="38" style="stroke-width: 1; fill: none; stroke: black;" x="10" y="894"></rect><g><text fill="black" font-family="Helvetica,sans-Serif" x="54" y="913" style="text-anchor: middle; alignment-baseline: central;">Inverter</text></g><path d="M54,58 v836" style="stroke-width: 1; fill: none; stroke: black;"></path><rect width="62.5" height="38" style="stroke-width: 1; fill: none; stroke: black;" x="195.75" y="20"></rect><g><text fill="black" font-family="Helvetica,sans-Serif" x="227" y="39" style="text-anchor: middle; alignment-baseline: central;">Proxy</text></g><rect width="62.5" height="38" style="stroke-width: 1; fill: none; stroke: black;" x="195.75" y="894"></rect><g><text fill="black" font-family="Helvetica,sans-Serif" x="227" y="913" style="text-anchor: middle; alignment-baseline: central;">Proxy</text></g><path d="M227,58 v836" style="stroke-width: 1; fill: none; stroke: black;"></path><rect width="62.5" height="38" style="stroke-width: 1; fill: none; stroke: black;" x="398.75" y="20"></rect><g><text fill="black" font-family="Helvetica,sans-Serif" x="430" y="39" style="text-anchor: middle; alignment-baseline: central;">Cloud</text></g><rect width="62.5" height="38" style="stroke-width: 1; fill: none; stroke: black;" x="398.75" y="894"></rect><g><text fill="black" font-family="Helvetica,sans-Serif" x="430" y="913" style="text-anchor: middle; alignment-baseline: central;">Cloud</text></g><path d="M430,58 v836" style="stroke-width: 1; fill: none; stroke: black;"></path><rect width="113.5" height="38" style="stroke-width: 1; fill: none; stroke: black;" x="481.25" y="20"></rect><g><text fill="black" font-family="Helvetica,sans-Serif" x="538" y="39" style="text-anchor: middle; alignment-baseline: central;">MQTT-Broker</text></g><rect width="113.5" height="38" style="stroke-width: 1; fill: none; stroke: black;" x="481.25" y="894"></rect><g><text fill="black" font-family="Helvetica,sans-Serif" x="538" y="913" style="text-anchor: middle; alignment-baseline: central;">MQTT-Broker</text></g><path d="M538,58 v836" style="stroke-width: 1; fill: none; stroke: black;"></path><g><text fill="black" font-family="Helvetica,sans-Serif" x="140.5" y="83" style="text-anchor: middle; alignment-baseline: central;">ContactInd</text></g><path d="M54,96 h173" style="stroke-width: 1; fill: none; stroke: black;" marker-end="url(#arrow-filled)"></path><path d="M403,116 L403,123 L410,123 L403,116 L247,116 L247,162 L410,162 L410,123 Z" style="stroke-width: 1; fill: cornsilk; stroke: black;"></path><g><text fill="black" font-family="Helvetica,sans-Serif" x="328.5" y="130" style="text-anchor: middle; alignment-baseline: central;">store Contact Info</text><text fill="black" font-family="Helvetica,sans-Serif" x="328.5" y="148" style="text-anchor: middle; alignment-baseline: central;">in proxy</text></g><g><text fill="black" font-family="Helvetica,sans-Serif" x="140.5" y="187" style="text-anchor: middle; alignment-baseline: central;">ContactRsp (Ok)</text></g><path d="M227,200 h-173" style="stroke-width: 1; fill: none; stroke: black;" stroke-dasharray="7,4" marker-end="url(#arrow-filled)"></path><g><text fill="black" font-family="Helvetica,sans-Serif" x="140.5" y="225" style="text-anchor: middle; alignment-baseline: central;">getTimeReq</text></g><path d="M54,238 h173" style="stroke-width: 1; fill: none; stroke: black;" marker-end="url(#arrow-filled)"></path><g><text fill="black" font-family="Helvetica,sans-Serif" x="328.5" y="263" style="text-anchor: middle; alignment-baseline: central;">ContactInd</text></g><path d="M227,276 h203" style="stroke-width: 1; fill: none; stroke: black;" marker-end="url(#arrow-filled)"></path><g><text fill="black" font-family="Helvetica,sans-Serif" x="328.5" y="301" style="text-anchor: middle; alignment-baseline: central;">ContactRsp (Ok)</text></g><path d="M430,314 h-203" style="stroke-width: 1; fill: none; stroke: black;" stroke-dasharray="7,4" marker-end="url(#arrow-filled)"></path><g><text fill="black" font-family="Helvetica,sans-Serif" x="328.5" y="339" style="text-anchor: middle; alignment-baseline: central;">getTimeReq</text></g><path d="M227,352 h203" style="stroke-width: 1; fill: none; stroke: black;" marker-end="url(#arrow-filled)"></path><g><text fill="black" font-family="Helvetica,sans-Serif" x="328.5" y="377" style="text-anchor: middle; alignment-baseline: central;">TimeRsp (time)</text></g><path d="M430,390 h-203" style="stroke-width: 1; fill: none; stroke: black;" stroke-dasharray="7,4" marker-end="url(#arrow-filled)"></path><g><text fill="black" font-family="Helvetica,sans-Serif" x="140.5" y="415" style="text-anchor: middle; alignment-baseline: central;">TimeRsp (time)</text></g><path d="M227,428 h-173" style="stroke-width: 1; fill: none; stroke: black;" stroke-dasharray="7,4" marker-end="url(#arrow-filled)"></path><path d="M179,448 L179,455 L186,455 L179,448 L74,448 L74,494 L186,494 L186,455 Z" style="stroke-width: 1; fill: cornsilk; stroke: black;"></path><g><text fill="black" font-family="Helvetica,sans-Serif" x="130" y="462" style="text-anchor: middle; alignment-baseline: central;">set clock in</text><text fill="black" font-family="Helvetica,sans-Serif" x="130" y="480" style="text-anchor: middle; alignment-baseline: central;">inverter</text></g><g><text fill="black" font-family="Helvetica,sans-Serif" x="140.5" y="519" style="text-anchor: middle; alignment-baseline: central;">DataInd (ts:=time)</text></g><path d="M54,532 h173" style="stroke-width: 1; fill: none; stroke: black;" marker-end="url(#arrow-filled)"></path><g><text fill="black" font-family="Helvetica,sans-Serif" x="140.5" y="557" style="text-anchor: middle; alignment-baseline: central;">DataRsp</text></g><path d="M227,570 h-173" style="stroke-width: 1; fill: none; stroke: black;" marker-end="url(#arrow-filled)"></path><g><text fill="black" font-family="Helvetica,sans-Serif" x="328.5" y="595" style="text-anchor: middle; alignment-baseline: central;">DataInd (ts)</text></g><path d="M227,608 h203" style="stroke-width: 1; fill: none; stroke: black;" marker-end="url(#arrow-open)"></path><g><text fill="black" font-family="Helvetica,sans-Serif" x="382.5" y="633" style="text-anchor: middle; alignment-baseline: central;">DataInd</text></g><path d="M227,646 h311" style="stroke-width: 1; fill: none; stroke: black;" marker-end="url(#arrow-open)"></path><g><text fill="black" font-family="Helvetica,sans-Serif" x="328.5" y="671" style="text-anchor: middle; alignment-baseline: central;">DataRsp</text></g><path d="M430,684 h-203" style="stroke-width: 1; fill: none; stroke: black;" marker-end="url(#arrow-open)"></path><g><text fill="black" font-family="Helvetica,sans-Serif" x="140.5" y="709" style="text-anchor: middle; alignment-baseline: central;">DataInd (ts:=time)</text></g><path d="M54,722 h173" style="stroke-width: 1; fill: none; stroke: black;" marker-end="url(#arrow-filled)"></path><g><text fill="black" font-family="Helvetica,sans-Serif" x="140.5" y="747" style="text-anchor: middle; alignment-baseline: central;">DataRsp</text></g><path d="M227,760 h-173" style="stroke-width: 1; fill: none; stroke: black;" marker-end="url(#arrow-filled)"></path><g><text fill="black" font-family="Helvetica,sans-Serif" x="328.5" y="785" style="text-anchor: middle; alignment-baseline: central;">DataInd (ts)</text></g><path d="M227,798 h203" style="stroke-width: 1; fill: none; stroke: black;" marker-end="url(#arrow-open)"></path><g><text fill="black" font-family="Helvetica,sans-Serif" x="382.5" y="823" style="text-anchor: middle; alignment-baseline: central;">DataInd</text></g><path d="M227,836 h311" style="stroke-width: 1; fill: none; stroke: black;" marker-end="url(#arrow-open)"></path><g><text fill="black" font-family="Helvetica,sans-Serif" x="328.5" y="861" style="text-anchor: middle; alignment-baseline: central;">DataRsp</text></g><path d="M430,874 h-203" style="stroke-width: 1; fill: none; stroke: black;" marker-end="url(#arrow-open)"></path></svg>