Easybits Serialization Service

 

Example Easybits device configuration

Summary

Easybits is an on-the-fly Google protobuf stream decoder/encoder for OpenChirp. This service is one of the core services that an embedded device may need in it’s OpenChirp data pipeline.

The idea is that your device would use Google Protobufs to serialize (and deserialize) it’s data and sends it to OpenChirp. The Easybits service is then invoked, which deserializes your data and publishes human readable values back to OpenChirp.

Easybits just needs the user to describe what protobuf types were declared and where to place the data.

How it works

Google Protobufs are great for creating compact serialized data packets for typical sensor values.

Protobufs requires you to create a .proto file that describes what data you intend to send back and forth. It then compiles this .proto file into a set of language specific interface files, which containing functions and objects to represent and aggregate your data.

Here is an example .proto file description for a smart light bulb.

// SmartBulb.proto
syntax = "proto3";
message LightStatus {
    bool  status    = 1;
    int64 intensity = 2;
}

Due to this native language integration, protobufs are easy for end users to pack up and send data messages, but it is non-trivial to create long running services that can interpret all possible custom protobuf messages, without recompilation.

To get around the Protobuf constraint of recompiling for every new protobuf message, Easybits uses dproto to adapt to new user described messages, without even restarting.

Easybits on Github

Next
Previous