This recipe is going to demonstrate how to upload a sketch to an ESP8266 board over the air. We will upload a simple LED blinking program onto our ESP8266 board using OTA and implement some OTA routines to ensure safety during the upload.
In this recipe, we will need the following components:
ESP8266 board
USB cable
220 Ω resistor (https://www.sparkfun.com/products/10969)
Breadboard
Jumper wires
Start by mounting the LED onto the breadboard. Connect one end of the 220 Ω resistor to the positive leg of the LED (the positive leg of an LED is usually the taller one of the two legs). Connect the other end of the resistor to pin 5 of the ESP8266 board. Then use a jumper wire to connect the negative leg of the LED to the GND pin of the ESP8266.
The setup is shown in the following diagram: