Here we will focus on OTA via Arduino IDE.
Note: OTA is not supported on chipset with 512KB of space.
OTA can be done using: –
- Arduino IDE
- Web Browser
- HTTP Server
ota updates arduino Prerequisite: –
- Arduino ID and ESP8266 to be in the same network.
- Arduino IDE 1.6.7 or its newer versions- https://www.arduino.cc/en/Main/Software
- Arduino core for ESP8266 Wi-Fi___33 chip. ESP8266/Arduino platform package 2.0.0 or newer
- For instructions follow https://github.com/esp8266/Arduino#installing-with-boards-manager .
- This project brings support for ESP8266 chip to the Arduino environment.
- Python 2.7 (python 3.5 not supported) – https://www.python.org/
Note: Windows users should select “Add python.exe to Path” while installing python 2.7
- An ESP8266 Wi-Fi module described in A Breakout Board for ESP 8266 ESP – 12E is available at ESP8266 ESP-12 Breakout
1. Connect your ESP8266 to your computer with a USB cable
2. Uploading Basic OTA.ino with serial communication
3. Go to Tools to select your ESP board model. You also need to choose your ESP’s COM port
4. Open Arduino IDE and select Basic OTA sketch at File > Examples > ArduinoOTA > BasicOTA
NOTE:- you need to change the sketch example with your SSID and password. (e.g. SSID- XXXXXX, Password-XXXXXXXXX)
5. Press the “Upload” button in the Arduino IDE and wait for the “Done uploading” message.
6. Open the Arduino IDE serial monitor at a baud rate of 115200. If you’ve entered the right network credentials you should see your ESP IP address after a few seconds.
7. Uploading New sketch over the Air (OTA): -Now your ESP8266 is ready to receive OTA firmware updates. You can unplug your ESP8266 from your computer and power it through any power source (for example a power bank). If your ESP8266 has a wireless connection to your router, you should be fine to upload new firmware.
8. Go to your Arduino IDE. Open Tools tab select the Port option and you should see something like this: esp8266-xxxxxx at your_esp_ip_address.
9. Copy the following sketch to your Arduino IDE and upload it to your ESP8266. This sketch blinks the ESP12-E NodeMCU kit built-in LED every second.
10. Press the “Upload” button in the Arduino IDE and wait for the “Done uploading” message.
11. Your ESP should have its built-in LED blinking every second.
1) Include all dependent file for OTA
2) Set network credentials
3) Setup Wi-Fi connection
4) ArduinoOTA.onStart function will check the file type, download the sketch, change the pointer of the pointer and reset.
5) OTA.onError function gives the types of error occur during the flashing of code
6) OTA begin function will start executing OTA functionality
7) In the loop function OTA Handle function handle obtained from esp_ota_begin. This will continuously chech for the OTA request.