ESP8266 ESP201 : Blink LED remotely via Adafruit MQTT

After learning to send temperature data from ESP8266 module to a server (Adafruit MQTT), it was time to learn to send data from Adafruit MQTT to ESP8266 module.
In order to create a Toggle button in Adafruit IO which trigger the LED on ESP8266 module, we need to have Adafruit account; https://io.adafruit.com
After login to Adafruit IO :-
- Create a new dashboard. Enter project name.
- Choose Toggle option.
- Then, follow the steps of the setup wizard.
The Toggle button in Adafruit IO looks like on this picture :-


For wiring schematic , see below picture. It includes wiring to upload sketch or code to ESP8266 module :-


The code can be found here  https://github.com/adafruit/Adafruit_MQTT_Library/blob/master/examples/mqtt_esp8266/mqtt_esp8266.ino but it need to be modified because we only use a LED and it does not have code that trigger the LED.
Here is the modified code :-

Comments