Overview
A special serial communication protocol is used to communicate from software between the BeagleBone and PyCubed. Here, a packet of information is referred to as a message, and the format is as follows:
- Each message starts with a syncword consisting of the character '$'. This is done to allow easier message synchronization for each receiver.
- Following the syncword is a three-character identifier of the message type, followed by a comma.
- Following the message type is a list of data elements, delimited by comma characters.
- The last element is a checksum for the message, not including the preamble. The checksum takes up two regular hexadecimal digits.
- Terminating the message is a newline character.
An example message (CC
indicates the checksum):
$BST,y,n,n,CC
Checksums and Loss Prevention
The two-byte checksum is a hexadecimal representation calculated from the transmitted message (not including the syncword, the three-character message type string, or the first comma). The checksum is used to validate the integrity of the message received. If the checksum received does not equal the one which appears in the message, the entire message is discarded, and the receiver waits until another syncword is read. Additionally, any message not precisely following the format in the table below is discarded.
Types of Messages
Below are the default messages used. Note that the CC
following each message corresponds to the two-byte checksum
field.
Type / Direction | Format | Arguments |
---|---|---|
BeagleBone Status BB → PC |
$BST,x,x,x,CC |
|
PyCubed Status PC → BB |
$PST,x,CC |
|
Radio Packet PC ↔ BB |
$PKT,l,D,CC |
|
IMU Data PC → BB |
$IMU,yyyyMMddhhmmss,x,x,x, |
|
GPS Data PC → BB |
$GPS,yyyyMMddhhmmss,x,x,x,x, |
|
Temperature Data PC → BB |
$TMP,yyyyMMddhhmmss,x,x,CC |
|
Power Data PC → BB |
$PWR,yyyyMMddhhmmss,x,x,x,x,CC |
|