September 21st, 2024

Working with compressed (ZSTD) binary data on AWS IoT Core

The article explains using the ESP32 microcontroller to send compressed binary data to AWS IoT Core, employing CBOR and ZSTD for efficiency, with a Lambda function processing the data.

Read original articleLink Icon
Working with compressed (ZSTD) binary data on AWS IoT Core

This article discusses the process of sending compressed binary data using the ESP32 microcontroller through AWS IoT Core, ultimately decoding it in a TypeScript Lambda function. The ESP32 is highlighted for its affordability and built-in connectivity features, making it suitable for IoT applications. The project utilizes PlatformIO for development and the Serverless Framework for managing serverless solutions. The focus is on using compressed CBOR (Concise Binary Object Representation) with ZSTD (Zstandard) to minimize data size, which is crucial for applications with limited bandwidth. The article details the setup of the microcontroller, including the necessary libraries and certificates for secure communication with AWS IoT Core. It also outlines the process of assembling the payload, compressing it, and publishing it to a specific MQTT topic. On the cloud side, the Serverless Framework is used to create an IoT policy and a Lambda function that processes incoming data. The Lambda function decodes the base64-encoded binary data, decompresses it, and parses it into a usable JavaScript object. The conclusion emphasizes the efficiency of these techniques in reducing data size and enhancing cloud integration for IoT projects.

- The ESP32 microcontroller is used for sending compressed data to AWS IoT Core.

- CBOR and ZSTD are employed to minimize data size for efficient transmission.

- The Serverless Framework facilitates the creation of IoT policies and Lambda functions.

- The Lambda function decodes, decompresses, and processes the incoming data.

- Compression ratios can vary, achieving reductions of 30% to 40% based on input data.

Link Icon 0 comments