We're close to publicly releasing UART support for Adafruit.io and WipperSnapper. This would enable a device running WipperSnapper to initialize a physically connected UART device, such as the PM2.5 Air Quality Sensor and Breadboard Adapter Kit - PMS5003, and send its data to Adafruit.io. As always with WipperSnapper firmware, this is all performed without requiring a user to write code.
Below is a sneak peek of the following, but how did we get to this result over the course of a month? What went into adding a feature to Adafruit.io and WipperSnapper Firmware?
Protocol Buffers: How WipperSnapper and Adafruit IO Communicate
When we developed WipperSnapper, we employed Protocol Buffers (Google's open-source data interchange format) to send data between a Device and Adafruit IO.
What are Protocol Buffers? (via protobuf.dev)
Protocol buffers are Google’s language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages
The core of this communication revolves around the Adafruit IO website, specifically the component picker form. When you select a UART component on Adafruit.io, it will look something like this:
This form enables you to select which specific air quality measurements you'd like the device to send to Adafruit.io and how often. But, where are the protocol buffers?!
The communication occurs when you click that blue Create Component button. Specifically, a message within uart.proto, UARTDeviceAttachRequest, is sent from Adafruit.io to a device. This communication occurs over MQTT and the protobuf data is considered to be the MQTT payload. The full sequence diagram of what happens when you click "Create Component" looks like this: