Bosch IoT Insights

Services: Protocol Buffer

Protocol Buffer (Protobuf) is a fast and efficient mechanism for serializing structured data. In particular, it was designed to be smaller and faster than XML.

Bosch IoT Insights supports the possibility to add Protobuf specification files to your project.

When sending binary Protobuf data to your project, the data is decoded based on the specification file and stored into the database for further analyses.

The Protobuf decoding requires a processor that controls the data flow.

Bosch IoT Insights supports .proto files with the language specification proto2 and proto3, refer to the documentation located at Google Protocol Buffer - Guide.

This .proto file must be in .zip format for the upload and contains the required data structures in so-called messages.

This example explains how a specification file is uploaded and the decoder tested.

Uploading and testing a Protobuf specification file

The following example shows a simple specification file. This specification file contains two data structures Test1 and Test2. Each has two integer variables.

syntax = "proto2";
message Test1 {
required int32 a = 1;
required int32 b = 2;
message Test2 {
optional int32 c = 1;
optional int32 d = 2;

To execute this example, the following files have to be downloaded:

Proceed as follows

  1. Click the Services > Decoder menu item.

  2. Click the Upload Decoder Specification button to upload the Protobuf specification file located in the folder.
    → The Upload decoder specification dialog is displayed.

    1. In the Type drop-down list, select Protocol Buffers.

    2. In the Specification file field, upload the folder.

    3. In the Name field, enter any name for the decoder specification.

    4. Click the Upload & Decode button.
      → The decoder is displayed.

  3. Test the decoder:

    • Open the Hex Data tab and enter the hex data from which the variable values are decoded: 08 A2 02 10 FF 01images/confluence/download/attachments/1075023293/example_services_decoder_hex_data-version-2-modificationdate-1687420409000-api-v2.png

    • Open the Binary Data tab and upload the test.bin file in the Binary file field.

  4. Click the Decode button.
    → The decoding result displays the value 290 for variable a and the value 255 for variable b.