Commit Graph

482 Commits

Author SHA1 Message Date
Stefan Allius
685c2dc07b fix unit tests 2024-05-31 20:10:22 +02:00
Stefan Allius
d27fe09006 reduce size of trace file
- trace heartbeat and regular modbus pakets
  only with log level DBEUG
- don't forwar akc pakets from tsun to inverter
  since we answered in before
2024-05-31 20:03:21 +02:00
Stefan Allius
e850a8c534 set tracer log level by environment value 2024-05-31 20:02:21 +02:00
Stefan Allius
3980ac013b catch all OSError errors in the read loop 2024-05-28 21:55:42 +02:00
Stefan Allius
66657888dd add log_level support for modbus commands 2024-05-28 19:32:20 +02:00
Stefan Allius
ab9e798152 add typing 2024-05-28 19:30:58 +02:00
Stefan Allius
fdf3475909 fix unit test 2024-05-27 20:56:03 +02:00
Stefan Allius
edc2c12b5b Send MQTT topic for responses to AT+ commands 2024-05-27 20:52:06 +02:00
Stefan Allius
5c6f9e7414 increase test coverage to 100% 2024-05-23 19:52:55 +02:00
Stefan Allius
0fc74b0d19 improve unit test 2024-05-22 22:54:23 +02:00
Stefan Allius
87cc3fb205 fix frong MQTT not found logs 2024-05-22 22:53:52 +02:00
Stefan Allius
8fc5eb3670 log MQTT to data topic 2024-05-22 22:53:04 +02:00
Stefan Allius
55fc834a1e reduce default loggings 2024-05-22 22:52:02 +02:00
Stefan Allius
da2388941e allow only one MODBUS retry
- More than one retry usually makes no sense, as
  random errors are usually corrected. If the
  first retry also fails, the chance that a second
  or third retry will be successful is very small
2024-05-21 19:37:55 +02:00
Stefan Allius
9e38cb93ea send StatusReq additionally every 30 minutes 2024-05-21 18:59:30 +02:00
Stefan Allius
de1c48fa62 add keyword for timeout to argument list 2024-05-21 18:58:10 +02:00
Stefan Allius
e432441134 don't log Events as Infos 2024-05-21 18:56:52 +02:00
Stefan Allius
98ef252bb0 don't forward invalid MODBUS responses 2024-05-20 18:51:55 +02:00
Stefan Allius
25e3db36c4 Merge pull request #74 from s-allius/s-allius/issue73
S allius/issue73
2024-05-20 18:38:11 +02:00
Stefan Allius
3ac48dad1f cleanup 2024-05-20 18:33:01 +02:00
Stefan Allius
eff3e7558b increase test coverage 2024-05-20 16:53:26 +02:00
Stefan Allius
6ef6f4cd34 cleanup 2024-05-20 00:48:23 +02:00
Stefan Allius
177706c3e6 test Modbus retries 2024-05-19 21:17:56 +02:00
Stefan Allius
9ac1f6f46d add Modbus retrasmissions 2024-05-19 21:17:16 +02:00
Stefan Allius
3cc5f3ec53 - add Modbus fifo and timeout handler 2024-05-19 13:45:52 +02:00
Stefan Allius
23ff2bb05c fix unit tests 2024-05-19 13:44:16 +02:00
Stefan Allius
c761446c11 code cleanup 2024-05-19 13:43:51 +02:00
Stefan Allius
f30aa07431 don't frwd received modbus req directly
- use always the fifoto sent valid req to the inverter
- code cleanup
2024-05-19 13:42:29 +02:00
Stefan Allius
476c5f0006 adapt unit tests 2024-05-19 12:24:35 +02:00
Stefan Allius
282a459ef0 add Modbus response forwarding 2024-05-19 12:23:58 +02:00
Stefan Allius
d25173e591 fix sending next pdu before we have parsed the last response 2024-05-18 23:11:49 +02:00
Stefan Allius
9c39ea27f7 fix unit tests 2024-05-18 23:10:47 +02:00
Stefan Allius
766774224b adapt unit tests 2024-05-18 21:46:28 +02:00
Stefan Allius
f4da16987f add fifo and timeout handler for modbus 2024-05-18 20:18:15 +02:00
Stefan Allius
841877305d timeout handler removed again, as it has no positive effect 2024-05-15 23:15:20 +02:00
Stefan Allius
fb5c6a74cf Merge pull request #70 from s-allius/s-allius/issue69
S allius/issue69
2024-05-13 23:05:34 +02:00
Stefan Allius
14425da5fa improve Modbus logging 2024-05-13 22:48:44 +02:00
Stefan Allius
6877465915 add more unit tests 2024-05-13 22:47:52 +02:00
Stefan Allius
2e214b1e71 avoid sending responses to TSUN for local at commands 2024-05-13 22:46:23 +02:00
Stefan Allius
036af8e127 move the Modbus instance to the parent class 2024-05-13 19:49:00 +02:00
Stefan Allius
92469456b7 fix unit tests 2024-05-12 23:11:55 +02:00
Stefan Allius
1658036a26 store modbus params always on the server side 2024-05-12 23:09:51 +02:00
Stefan Allius
1ae7784bee add more unit tests 2024-05-11 23:41:40 +02:00
Stefan Allius
e43a02c508 improve modbus parsing
- parse Modbus messages well if another msg
   follows in the receive buffer
2024-05-11 23:40:46 +02:00
Stefan Allius
4ea70dee64 improve connection handling
- insure close() call after graceful disconnect,
  to release proxy internal resources
- timeout handler disconnect inverter connection
  if no message was received for longer than 2.5
  minutes
2024-05-11 20:55:31 +02:00
Stefan Allius
6fcf4f47c2 add more unit tests 2024-05-11 20:53:39 +02:00
Stefan Allius
73baffe9e0 also get the 'Daily Generation' every minute 2024-05-11 20:50:26 +02:00
Stefan Allius
3fda08bd25 add more unit tests 2024-05-11 20:48:57 +02:00
Stefan Allius
0e7fbc7820 fix Modbus CRC errors
- parse Modbus messages well if another msg
  follows in the receive buffer
2024-05-11 20:46:36 +02:00
Stefan Allius
26f108cc51 build version string in the same format as TSUN 2024-05-10 20:50:37 +02:00