MQTT is a lightweight transfer protocol aimed at small IoT enabled devices. While the Arduino on its own has no networking capability, it can be connected to an Ethernet shield, allowing it to connect to the internet. Using the Ethernet and MQTT library, we can quickly get our Arduino talking to MQTT servers to submit and retrieve data!
You need to search and install “PubSubClient” Library which is a lightweight MQTT library and “Ethernet” Library for Ethernet Shield.
Let’s see the YouTube clip about this project.
If you can follow up, the output window of Arduino IDE shows the result below.
For more details, please visit the original post.