Proton communication protocol.
Documentation is available here
Proton has several external requirements for both code generation and runtime usage
nanopb(included): lightweight protobuf library and code generator for protonc
libboost-all-dev: Specifically forboost/asio.hpp: an asynchronous serial input/output executorprotobuf-compiler: Used at both build-time (for generating code versions of .proto files), and as a general protobuf library for protoncpplibyaml-cpp-dev: For parsing bundle config files during the code generation step.
protobuf: pip package fornanopbcode generatorpyyaml: yaml file parser
Build all C/C++ code with:
mkdir build
cd build
cmake ..
make
NOTE: CMake does not check for Python packages. If you run into problems running the
nanopbcode generator, install the above Python dependencies in avenv
python3 -m venv venv
. venv/bin/activate
pip3 install protobuf pyyaml
The A300 example consists of a C MCU node communicating with a C++ PC node over UDP.
./build/examples/a300/a300_mcu_c
./build/examples/a300/a300_pc_cpp
The J100 example consists of a C MCU node communicating with a C++ PC node over Serial.
To simulate serial transport, create virtual serial ports with socat:
socat PTY,link=/tmp/ttyPC,raw,echo=0 PTY,link=/tmp/ttyMCU,raw,echo=0
./build/examples/j100/j100_mcu_c
./build/examples/j100/j100_pc_cpp
This example consists of 3 nodes communicating with each other over both UDP and Serial. Each node is implemented in C and C++ and can be used interchangeably.
To simulate serial transport, create virtual serial ports with socat:
socat PTY,link=/tmp/ttyPC,raw,echo=0 PTY,link=/tmp/ttyMCU,raw,echo=0
Node 1 produces log bundles and sends them to both Node 2 and 3. It also receives node_name bundles from both Node 2 and 3. It communicates with Node 2 over UDP, and with Node 3 over serial.
./build/examples/multi_node/multi_node_1_c
./build/examples/multi_node/multi_node_1_cpp
Node 2 produces node_name bundles that it sends to Node 1, and also time bundles that it sends to Node 3. It consumes log bundles It communicates with both nodes over UDP.
./build/examples/multi_node/multi_node_2_c
./build/examples/multi_node/multi_node_2_cpp
Node 3 produces node_name bundles which it sends to Node 1. It consumes log bundles from Node 1, and time bundles from Node 2. It communicates with Node 1 over Serial, and Node 2 over UDP.
./build/examples/multi_node/multi_node_3_c
./build/examples/multi_node/multi_node_3_cpp