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:

  1. Each message starts with a syncword consisting of the character '$'. This is done to allow easier message synchronization for each receiver.
  2. Following the syncword is a three-character identifier of the message type, followed by a comma.
  3. Following the message type is a list of data elements, delimited by comma characters.
  4. The last element is a checksum for the message, not including the preamble. The checksum takes up two regular hexadecimal digits.
  5. 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
  1. [y/n] Successful startup
  2. [y/n] Ready for power loss
  3. [y/n] Kill radio transmission
PyCubed Status
PC → BB
$PST,x,CC
  1. [y/n] BeagleBone shutdown requested
Radio Packet
PC ↔ BB
$PKT,l,D,CC
  1. Packet length in bytes
  2. Binary packet contents
IMU Data
PC → BB
$IMU,yyyyMMddhhmmss,x,x,x,
x,x,x,x,x,x,x,x,x,CC
  1. Timestamp of reading
  2. Acceleration x coordinate
  3. Acceleration y coordinate
  4. Acceleration z coordinate
  5. Magnetic field x coordinate
  6. Magnetic field y coordinate
  7. Magnetic field z coordinate
  8. Angular velocity x coordinate
  9. Angular velocity y coordinate
  10. Angular velocity z coordinate
GPS Data
PC → BB
$GPS,yyyyMMddhhmmss,x,x,x,x,
x,x,x,x,CC
  1. Timestamp of reading
  2. [y/n] Indicates whether the GPS has a fix. No fix means the following data is discarded
  3. Latitude in degrees
  4. Longitude in degrees
  5. Fix quality (0, 1, or 2)
  6. Number of satellites used
  7. Altitude in meters
  8. Speed in meters per second
  9. Azimuth in degrees
  10. Horizontal dilution
Temperature Data
PC → BB
$TMP,yyyyMMddhhmmss,x,x,CC
  1. Timestamp of reading
  2. The CPU temperature in celsius
  3. The battery temperature in celsius
Power Data
PC → BB
$PWR,yyyyMMddhhmmss,x,x,x,x,CC
  1. Timestamp of reading
  2. Battery voltage
  3. Charge current in milliamps
  4. System voltage
  5. System current draw in milliamps