jeroendoggen / Arduino-serial-messaging

Library to exchange short messages (sensordata, commands) between an Arduino and a software application running on a PC. (Linux, embedded Linux, Windows, OS X)
GNU General Public License v2.0
78 stars 27 forks source link

Library to exchange short messages (sensordata, commands) between an Arduino and a software application running on a PC. (Linux, embedded Linux, Windows, OS X) (clients currently under development)

Both sides are able send and receive a range of "standardised" messages over the serial port. All communication is done by sending short human readable ASCII messages. We define several standard command and data packet IDs to provide interoperability between different applications.

The protocol was designed to be relatively easy to comprehend and process by both human and computer.

The Message Types

The library support seven basic packet types.

More info in defines.h

Standard Messages

Data messages are used when we want to send sensor data from the Arduino to applications running on a PC. More info

Command messages are used when we want to send instructions from one application to the Arduino module. More info

We define several standard command and data message IDs. The actual meaning of the payload of these messages is standardised to provide interoperability between different applications (00h -> 7Fh). Half of the packet IDs are undefined (80h -> FFh). These IDs can be chosen based on the needs of your own application.

Example Messages

Command message T01N00I12PFFQ21 : "set motor speed of 'Arduino zero' to +100%:

Data message T12N00I10P08Q0A : "temperature of 'Arduino zero' is 8 degrees"

Sending Messages from Arduino Code

Example sketch: SendPackets.ino

PC Clients