Is it possible to make Google Protocol Buffers work in Arduino?
I have been trying for about a week and can't make it work, and I would like to know if it's even possible.
Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler.
Protobuf supports more data types than JSON. JSON is limited to certain python objects, and it cannot serialize every python object. Protobuf supports a wider range of data types when compared to JSON. For example, enumerations and methods are supported by Protobuf and not supported by JSON.
Protocol buffers provide a language-neutral, platform-neutral, extensible mechanism for serializing structured data in a forward-compatible and backward-compatible way. It's like JSON, except it's smaller and faster, and it generates native language bindings.
This should fit on an Arduino: https://github.com/nanopb/nanopb
I've managed, after several attempts, to compile google protocol buffers for Arduino (using lite runtime), and still, the resulting code size was way over the 32k limit. So, for now, GPB isn't a viable option for Arduino projects. (maybe on Arduino Mega?)
I suggest you look at MQTT for a suitable replacement (I'll do that).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With