Using MQTT .NET library to communicate with IoT Hub
MQTT is a Machine-to-Machine (M2M) client server publish/subscribe messaging transport protocol. It is a lightweight, low-bandwidth, high-latency network, and easy to implement connectivity protocol.
The key benefits of MQTT protocol are:
- Simple to implement
- Provide Quality of Service (QoS) data delivery
- Lightweight and bandwidth efficient
MQTT protocol can connects multiple devices using the publish/subscribe mechanism to collect data from many devices. The MQTT, targets device data collection mainly for telemetry or remote monitoring purposes. It then transports that data to the backend central system using publish/subscribe mechanism.
In this recipe, we will understand the MQTT protocol and will create a C# console application using M2MQTT
library to connect to the IoT Hub and ingest the data.
Getting ready
If M2M connectivity exist, the device may not be able to use the IoT Hub SDK. But with MQTT support added to the IoT Hub, a public endpoint...