Tuesday , June 18 2019

MQTT Subscriber in ESP328266 using Arduino

Share on WhatsApp
Share via email Share

Before going to start any coding. First we will talk about the Arduino environment setup.

Firstly, you can download the Arduino setup from here: https://www.arduino.cc/en/main/software

After this now you can configure the Arduino environment for ESP328266

Open the preference setting

Now, you can add the json link into below given section.
This link allows you to install the library for ESP32 Modules.

After this, you need to setup the Board Manager for the ESP328266 Module.

Type ESP in the Board Search menu to get the information about these Board.

Simply, install the board driver as and your Board setup environment for esp328266 is finished.

Further, you will configure you COM Port which is generally different in every case. First you need to confirm which is your port of esp328266. By just plug and unplug into USB port.

In last, you can set your board on this configuration otherwise you should have a problem to upload the code into the esp328266.

This is all about the how to configure your Arduino environment for esp328266.

For MQTT using in ESP328266 you need to install the library name “PUBSUBCLIENT”

There are too many PubSubClient Libraries. But, you can install only that is installed in the given below section.

Finally, now we setup all the environments for each and everything. Lets talk about the business. Means the real code.

This code blink your Builtin LED on your ESP328266 module. Also it will shows the message of your entire publisher topic. I use the same topic which I was declared in the MOSCA server example. So, need to use the Serial Monitor to get this.

Share on WhatsApp
Share via email Share

About Faheem

An adaptable and responsible Software Engineer, who enjoys working with computers and the opportunity to learn new skills and work with new technologies is particularly attractive to me.

Leave a Reply

Your email address will not be published.