Toolbox for using protobuf-defined messages with The Things Network.
This repository contains examples about how to use a message defined in the protobuf format with an arduino sketch via nanopb.
It leverages a docker file that comes with all necessary tools installed and the ttn-proto-generator that can take a proto file and generate a Converter
, Decoder
, Encoder
and Validator
for The Things Network Console via protobuf.js.
Install Docker - on Mac you can just run brew bundle
in the root of a checkout of this project and then run
./example.sh
to end up with a buildable Arduino project with a sample usage of example/proto/test.proto
in example/arduino
and the TTN console functions in example/ttn-console
.
Run:
./gen-c.sh \
`pwd`/path/to/your.proto \
`pwd`/path/to/your/arduino/project
The headers, etc. will be generated in /path/to/your/arduino/project
.
Please note the absolute paths
Run:
yarn global ttn-proto-generator
ttn-proto-generator \
-p example/proto/test.proto \
-m com.example.MyMessage \
-o example/ttn-console
to generate the TTN functions in example/ttn-console
.
Head over to https://github.com/thesolarnomad/ttn-proto-generator for details.