IoT Connectivity using MQTT
Last updated
Last updated
IoT protocols are sets of rules and standards that govern how devices in an IoT ecosystem exchange data and interact with each other. They define how data is exchanged, what format it should be in, and how it should be encrypted and authenticated for security purposes. Most popular IoT protocols include REST API and MQTT.
REST APIs, or RESTful APIs, are interfaces that enable interaction between different software applications. REST (Representational State Transfer) is an architectural style that utilizes a stateless communication protocol, typically HTTP. REST APIs operate by using standard HTTP methods, such as GET, POST, PUT, PATCH, and DELETE. These methods correspond to create, read, update, and delete (or CRUD) operations, respectively. Each request from a client to a server is stateless, meaning it contains all the information the server needs to fulfill the request. Responses from the server are typically in the form of resources, such as HTML, XML, JSON, or plain text.
MQTT (Message Queuing Telemetry Transport) is a communications protocol designed for IoT devices with extremely high latency and restricted low bandwidth. It is a TCP-based protocol relying on the publish/subscribe messaging transport that is ideal for connecting remote devices with a small code footprint and minimal network bandwidth. MQTT allows for messaging between device to cloud and cloud to device. This makes for easy broadcasting messages to groups of things. The heart of the MQTT protocol is the MQTT broker. All communications must be received by the broker, who will then sort them, ascertain who subscribed to each one, and deliver the messages to the clients who have subscribed.