Skip to content

Latest commit

History

History
37 lines (25 loc) 路 1.27 KB

File metadata and controls

37 lines (25 loc) 路 1.27 KB

Serial Message Receiver

This script reads and parses structured messages from a serial (COM) port.
It is designed to work with a specific binary protocol based on a start flag, payload length, 8-byte counter, CRC-8, and an end flag.

馃洜 Message Structure

  • Start flag (0xAA)
  • Payload length (1 byte)
  • 8-byte counter (payload)
  • CRC-8 checksum (calculated over counter (payload))
  • End flag (0x55)
+------------+--------+----------------+--------+------------+
| Start Flag | Length |    Counter     |   CRC  |  End Flag  |
|   (0xAA)   | 1 Byte |    8 bytes     | 1 Byte |   (0x55)   |
+------------+--------+----------------+--------+------------+

CRC is calculated using the CRC-8-CCITT algorithm.

馃摝 Requirements

Before running the script, make sure you have Python 3 and install pySerial:

python -m pip install pyserial

Serial Message Sender

Use the companion sender script available at:

馃憠 https://github.com/meetanthony/SerialMessageSender

This script is designed to send properly formatted packets compatible with this receiver.