IoT protocols with ESP32
There are a number of application layer protocols for IoT devices to communicate with remote servers. Their design principles and architectures are quite different, so it is really a matter of requirements and constraints which one to choose in an IoT project. Let's discuss some popular protocols and their features with examples.
MQTT
Message Queue Telemetry Transport (MQTT) is a many-to-many communication protocol with a message broker as the mediator. There are publishers that send messages to the topics on the broker, and there are subscribers that receive messages from the topics that they have subscribed to. A node can be a publisher and subscriber at the same time:
For MQTT, TCP is the underlying transport protocol and TLS can be configured for communication security.
Let's see how MQTT works with a simple example. We will develop a sensor device with DHT11...