Member-only story
Pushing Sensor Data to the Cloud
ESP32’s MQTT connectivity talks to AWS
In this earlier story Human Presence Telemetry, it was shown that an ESP32-C6 could communicate with a web server. A local HTTP server (not TLS/SSL, or HTTPS) server was used to receive data from a human presence radar sensor. It was also explained that the setup was not production-ready in the modern world of edge computing. Specifically there were holes in security, and the use of direct web communication may not scale well for a large number of devices.
This article shows how to plug at least some of the holes. A different protocol exists (and was established long ago) that is more specific to sensors than HTTP. Called MQTT, it uses a publish/subscribe model to allow clients like Edge Computing devices to publish messages to topics, or subscribe to topics and receive messages, or both. This is a well-known paradigm in software, exemplified by things like RabbitMQ, or AWS’ Simple Messaging Service (SMS). But, in addition to SMS, AWS also has the requisite publish / subscribe “broker” for MQTT. In addition, it supports secure transport. Like HTTPS, the secure sockets or TLS version is also designated with a trailing “s”. This secured MQTTS protocol provides “encryption in flight”, so that your messages cannot easily be understood even if they are intercepted.







