jmccrohan / pysolarmanv5

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

Using LSW5BLE Not able to decode the frames #58

Closed psunny28 closed 3 weeks ago

psunny28 commented 1 month ago

Structure Breakdown:

Start (1 byte): 0xA5
Length (2 bytes): Data field length
Control Code (2 bytes): Control code for specific commands
Serial (2 bytes): Serial number
Logger Serial (4 bytes): Logger serial number
Frame Type (1 byte): Frame type
Status (1 byte): Status information
Total Working Time (4 bytes)
Power On Time (4 bytes)
Offset Time (4 bytes)
Modbus RTU Frame (variable bytes)
Checksum (1 byte)
End (1 byte): 0x15

Provided Hex Message:

A5 04 01 10 42 73 94 8c 6e 91 d1 01 01 dd d6 d1 06 00 44 08 00 00 c0 38 5c 66 01 00 84 03 00 00 31 31 31 35 43 32 33 31 32 31 31 41 30 31 31 31 50 56 42 4c 49 4e 4b 20 20 20 20 20 20 20 20 20 50 56 42 53 36 4b 2d 4d 31 20 20 20 20 20 20 20 01 03 3e 00 09 00 16 17 70 02 00 01 00 00 27 10 00 00 17 8e 27 10 00 00 00 7c 00 00 00 00 00 07 0a 52 02 57 01 c6 00 00 00 00 00 00 00 00 08 d9 00 04 04 40 06 b1 00 05 03 aa 00 07 00 00 00 00 00 00 00 00 00 00 00 06 00 00 00 24 00 00 00 00 00 00 01 7a 00 00 00 00 00 00 8c 66 00 05 6a 26 07 e8 06 07 12 33 18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 09 5b 13 89 00 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 28 00 00 00 00 00 00 00 00 00 00 05 6c 00 00 05 6b ff ff ff db ff ff ff ce ab 15

Decoding Step-by-Step:

Start Code (1 byte): A5
Length (2 bytes): 04 01
    Interpreted as 260 bytes.
Control Code (2 bytes): 10 42
Serial (2 bytes): 73 94
    Needs further context for interpretation.
Logger Serial (4 bytes): 8c 6e 91 d1
    In reversed hex: D1 91 6E 8C
Frame Type (1 byte): 01
Status (1 byte): 01
Total Working Time (4 bytes): dd d6 d1 06
    In decimal: 1152928202 (interpreted as needed)
Power On Time (4 bytes): 00 44 08 00
    In decimal: 278528
Offset Time (4 bytes): 00 c0 38 5c
    In decimal: 12600988
Modbus RTU Frame (variable bytes):
    66 01 00 84 03 00 00 31 31 31 35 43 32 33 31 32 31 31 41 30 31 31 31 50 56 42 4c 49 4e 4b 20 20 20 20 20 20 20 20 20 50 56 42 53 36 4b 2d 4d 31 20 20 20 20 20 20 20 01 03 3e 00 09 00 16 17 70 02 00 01 00 00 27 10 00 00 17 8e 27 10 00 00 00 7c 00 00 00 00 00 07 0a 52 02 57 01 c6 00 00 00 00 00 00 00 00 08 d9 00 04 04 40 06 b1 00 05 03 aa 00 07 00 00 00 00 00 00 00 00 00 00 00 06 00 00 00 24 00 00 00 00 00 00 01 7a 00 00 00 00 00 00 8c 66 00 05 6a 26 07 e8 06 07 12 33 18 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 09 5b 13 89 00 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 28 00 00 00 00 00 00 00 00 00 00 05 6c 00 00 05 6b ff ff ff db ff ff ff ce
    This is a detailed data payload and needs specific context from the device documentation.
Checksum (1 byte): ab
End Code (1 byte): 15

Key Decoded Values:

Start Code: A5
Length: 260 bytes
Control Code: 10 42
Serial: 73 94
Logger Serial: D1 91 6E 8C
Frame Type: 01
Status: 01
Total Working Time: 1152928202 (in decimal)
Power On Time: 278528 (in decimal)
Offset Time: 12600988 (in decimal)
Checksum: ab
End Code: 15

Modbus RTU Frame Analysis:

Contains device-specific data such as strings, status values, time values, etc.
Example strings extracted:
    1115C231211A0111
    PVBLINK
    PVBS6K-M1

Each byte sequence has specific meaning based on device protocol documentation, and full interpretation requires context from that documentation.

Can anyone help decoding this frame