victorhurdugaci / SerialProtocol

A protocol for sending data between two Arduino devices, or between an Arduino and another device through a serial port

Home Page:http://victorhurdugaci.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Arduino Serial Protocol

ArduinoSerialProtocol is a protocol for sending data between two Arduino and/or Raspberry PI devices over serial.

Message structure

  • Message start marker: 1 byte
  • Message size: 1 byte
  • Payload (message body): variable number of bytes (max 255)
  • Checksum: 1 byte

Total message size (bytes): Payload + 3

Install Arduino Libraries

  1. Download the Repository as a .zip file.
  2. In Arduino IDE, go to Sketch> Include Library> Add .zip Library.
  3. Select the Downloaded .zip File.

Examples

Arduino Instructions

Open the arduino_app in the Arduino IDE and upload to your Arduino.

Raspberry Pi Instructions

  1. Clone this repository and navigate to the SerialProtocol/extras/raspberry_app folder.
  2. Make the file raspberry_app.cpp
  3. Run the new file. You should see the two devices exchanging a data structure with different numeric types.

Acknowledgements

SerialProtocol is inspired by Arduino-EasyTransfer. It brings a few improvements (over v2.1):

  • The start marker (header) is one byte shorter
  • A detailed error code is given in case of communication failures

License

Copyright Victor Hurdugaci. All rights reserved.
Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

Contributors

Victor Hurdugaci

James Head

About

A protocol for sending data between two Arduino devices, or between an Arduino and another device through a serial port

http://victorhurdugaci.com

License:Apache License 2.0


Languages

Language:C++ 97.8%Language:Makefile 2.2%