From 7fad17aa3e5dad1626e3fabe26834ed8d6c54699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knuti=5Fin=5FP=C3=A4se?= <122045840+PaeserBastelstube@users.noreply.github.com> Date: Wed, 11 Jan 2023 15:01:54 +0100 Subject: [PATCH] RPI extend debug meassage for better understanding The response of HardwareInfoResponse contains 16 byte, but only 8 bytes are known. Analyse result of the last 2 bytes: This bytes contain the CRC-modbus. To observe the double-byte (6, 10, 12), this extended log message could help. --- tools/rpi/hoymiles/decoders/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/rpi/hoymiles/decoders/__init__.py b/tools/rpi/hoymiles/decoders/__init__.py index f67cdfda..b9ebc45e 100644 --- a/tools/rpi/hoymiles/decoders/__init__.py +++ b/tools/rpi/hoymiles/decoders/__init__.py @@ -333,7 +333,11 @@ class HardwareInfoResponse(UnknownResponse): { FLD_FW_VERSION, UNIT_NONE, CH0, 0, 2, 1 }, { FLD_FW_BUILD_YEAR, UNIT_NONE, CH0, 2, 2, 1 }, { FLD_FW_BUILD_MONTH_DAY, UNIT_NONE, CH0, 4, 2, 1 }, - { FLD_HW_ID, UNIT_NONE, CH0, 8, 2, 1 } + { FLD_unknown, UNIT_NONE, CH0, 6, 2, 1 }, + { FLD_HW_ID, UNIT_NONE, CH0, 8, 2, 1 }, + { FLD_unknown, UNIT_NONE, CH0, 10, 2, 1 }, + { FLD_unknown, UNIT_NONE, CH0, 12, 2, 1 }, + { FLD_CRC-M, UNIT_NONE, CH0, 14, 2, 1 } }; self.response = bytes('\x27\x1a\x07\xe5\x04\x4d\x03\x4a\x00\x68\x00\x00\x00\x00\xe6\xfb', 'latin1') """ @@ -345,6 +349,8 @@ class HardwareInfoResponse(UnknownResponse): fw_build_mm = int(fw_build_mmdd / 100) fw_build_dd = int(fw_build_mmdd % 100) logging.debug(f'Firmware: {fw_version_maj}.{fw_version_min}.{fw_version_pat} build at {fw_build_dd}/{fw_build_mm}/{fw_build_yyyy}, HW revision {hw_id}') + responce_info = self.response + logging.debug(f'HardwareInfoResponse: {struct.unpack(">HHHHHHHH", responce_info)}') class DebugDecodeAny(UnknownResponse): """Default decoder"""