jmccrohan / pysolarmanv5

A python module to interact with Solarman Data Logging Sticks
MIT License
124 stars 27 forks source link

Bogus frames detection in the decoder #65

Closed githubDante closed 1 month ago

githubDante commented 1 month ago

The decoder will show extra line when such frames are detected. Example:

========== RTU Payload - [Response] ==========
        Slave address: 1
        Function code: 3
        CRC: 00 (valid: True)
        BOGUS FRAME DETECTED - REAL CRC: eb4e
        Quantity: 115

NB: Created a bit of a mess as I forgot to sync before the push.

davidrapan commented 1 month ago

Yup it's working:

py solarman_decoder.py a5 1f 00 10 15 bb 52 b2 6e 3c 6a 02 01 b0 17 ee 00 b4 1a 00 00 62 0e b7 65 01 03 0a 32 31 30 36 32 33 34 32 35 38 30 6e 00 00 d6 15
Frame start: a5 (valid: True)
V5 Checksum: d6 (valid: True)
Length: 31
Control Code: V5Response (hex: 1510)
Sequence numbers: (187, 82) (hex: bb 52)
Serial Hex: 6a3c6eb2
Serial: 1782345394
Frame Type (Inverter): 2
Frame Status: 1
Total Time: 15603632
PowerOn Time: 6836
Offset Time: 1706495586
Frame Time: 2024-07-27 18:47:34+00:00
Checksum: 0 hex: 00 - RTU start at: 01030a3231
========== RTU Payload - [Response] ==========
        Slave address: 1
        Function code: 3
        CRC: 00 (valid: True)
        BOGUS FRAME DETECTED - REAL CRC: 306e
        Quantity: 17
        Data: 01030a32313036323334323538306e0000