To integrate the module ESP8266 with node-red IoT platform has been used MQTT protocol, there are client libraries for esp8266 as MQTT in this case I decided to use the library pubsubclient.

This example will receive Node Red that receives data from the ESP8266 and allow control a LED connected to GPIO 02 from a dashboard created in Node Red Dashboard .

Complete Tutorial ESP8266 and Node-RED MQTT GPIO (Mosquitto) # 1

Note: To successfully complete this tutorial you must perform the following tutorials.
Previous tutorials Recommended

Program ESP8266 con Arduino IDE

Tutorial 1 : Install Lubuntu (Ubuntu)
Tutorial 2 : Installation Node RED platform

Tutorial 3: Installation Node Red Dashboard

Tutorial 4: Installation Modbus TCP IP in Node Red

Tutorial 5: Installation of Mosquitto Broker MQTT in Lubuntu

Step 1: VIDEO Test ESP8266 GPIO MQTT Mosquitto Node-RED IoT # 1

Video Test ESP8266 GPIO MQTT Mosquitto Node-RED IoT # 1

Step 2: Tutorial ESP8266 GPIO MQTT Mosquitto Node Red IoT # 2

Tutorial ESP8266 GPIO MQTT Mosquitto Node Red IoT # 2

Step 3: Bonus : Test ESP8266 Control Servo MQTT Node-Red IoT #3 : PDAControl

Bonus : Test ESP8266 Control Servo MQTT Node-Red IoT #3 : PDAControl

Step 4: View GPIO Control

Arduino IDE add the pubsubclient library using the search engine libraries or manually by downloading the library and storing it in their respective folder for libraries.

Node Red Dashboard

Mosquitto MQTT Broker

Pubsubclient.h lib

Components and materials required for testing

ESP8266 01

ESP8266 03

ESP8266 12F

Diode led


Converter TTL -USB



Github Arduino IDE code ESP8266 MQTT

Github pubsubclient Library

Node Red import code example

More information and Downloads code on this project :

PDAControl English

PDAControl Español

Youtube Channel PDAControl

Thanks to..

Nick O'Leary "knolleary"creator libreria pubsubclient.h Arduino

<p>All of the links are dead??</p>
<p>Hello, retry again, the links are working fine.</p><p><em><a href="http://pdacontrolen.com/" rel="nofollow">http://pdacontrolen.com/</a></em></p>
<p>Links looks to be dead again, all of <em><a href="http://pdacontrolen.com/" rel="nofollow">http://pdacontrolen.com/</a></em></p>
<p>hello</p><p>how can i use it for d1 mini?</p>
<p>Nice! Does this resolve the freak-out issue with the ESP8266 where it reboots randomly? I had been able to get a few lights through the house with relays but then the module would reboot itself and turn everything off. It was not reliable at the time.</p>
Most reboot issues are power related. Make sure you have, enough current and clean power. If you are sure that your power is good, then check your code for glitches.
I don't recall what I see when I did it. I'm going back to the drawing board and giving it another shot then.<br><br>Thanks for the help. Voted.

About This Instructable



Bio: Share &amp; Learn - Makers. Projects, Articles, #automation, #PLC, #Arduino, #IoT and More PDAControl
More by Jhon_Control:ESP8266 Two Serial Ports With SoftwareSerial Library Arduino Slave Modbus RTU & PLC Panasonic RS232 Industrial  Quick View to Platform IoT Emoncms OpenEnergyMonitor in Hosting 
Add instructable to: