Building Edge IoT Applications with AWS IoT Greengrass - Local Processing and Cloud Integration
Run Lambda functions on edge devices and continue local processing even in environments with intermittent cloud connectivity. This guide covers ML inference at the edge and fleet management.
Greengrass Overview
IoT Greengrass is a runtime that executes AWS cloud capabilities locally on edge devices. Installing the Greengrass Core software on a Linux device with at least 256 MB of memory (Raspberry Pi, industrial gateways, EC2) turns that device into an edge computing hub. You can run Lambda functions, Docker containers, and custom components at the edge, completing sensor data preprocessing, ML inference, and device control locally. It is particularly effective in environments with intermittent cloud connectivity, such as factories, farms, ships, and mines.
Components and Local Processing
Greengrass v2 adopts a component-based architecture. You build edge applications by combining AWS-provided public components (stream manager, local MQTT broker, ML inference) with custom components (your own business logic). The stream manager buffers sensor data locally and sends it to the cloud (IoT Core, Kinesis, S3) based on bandwidth constraints. Even if the connection is lost, data is retained locally and automatically sent when connectivity is restored. The local MQTT broker enables messaging between edge devices, allowing device-to-device communication without going through the cloud.
ML Inference and Fleet Management
The ML inference component lets you deploy models trained in SageMaker to edge devices and run real-time inference. It supports TensorFlow Lite and DLR (Deep Learning Runtime), enabling efficient inference even on resource-constrained devices. Common applications include defect detection on manufacturing lines, crop disease detection in agriculture, and person detection on security cameras. For fleet management, you execute OTA component deployments to device groups from the AWS IoT console. Deployment progress can be tracked per device, and rollback is available if failures occur. For a systematic study of Greengrass, related books on Amazon are also a useful reference.
Greengrass Pricing
Installing and running the Greengrass Core software is free. Costs are incurred for the AWS services used for cloud communication, such as IoT Core messaging, S3 data transfer, and Lambda invocations. Hardware costs for edge devices and network line fees are separate. S3 storage and IoT Jobs charges for OTA deployments also apply but are minimal. The key to optimizing overall costs in a Greengrass environment is completing processing at the edge to reduce the volume of data transferred to the cloud.
Summary
When adopting Greengrass, start by selecting the required capabilities from the component catalog (MQTT broker, Stream Manager, ML inference) and design a configuration suited to the edge device's CPU and memory. In environments that require resilience to network outages, prioritize completing processing locally and design cloud data transfers as batch operations upon connectivity recovery. Automate OTA deployments to thousands of devices with fleet management to minimize operational overhead.