ESP32 OTA (Over-the-Air) Updates using AsyncElegantOTA: Arduino IDE or VS Code (ESP8266 NodeMCU)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video we'll show you how to add over-the-air capabilities to your esp32 and the spd26 web server projects in this tutorial we'll use arduino ide but you also give instructions if you want to use vs code with platform io by the end of this video an over-the-air update is the process of loading new firmware to the esp boards using a wi-fi connection rather than serial communication this functionality is extremely useful in case of no physical access to the device there are several ways to perform ota updates in this tutorial we'll cover how to do that using the async elegant ota library in our opinion this is the easiest way to perform ota updates and it is compatible and easy to use with the esp async web server library that we often use in our projects this library creates a web server that you can access on your local network to upload new firmware or files to the file system over the air start by installing the library in your arduino ide go to sketch include library manage libraries and search for async elegant ota and install it you should also install these libraries after installing all the libraries copy this basic example provided by the library it creates a simple web server the root url displays some text and the update url shows the interface to update the firmware and the file system you just need three lines of code to add ota capabilities to your web servers first include the library second add this line to start elegant ota in the setup and finally add this line to the loop insert your network credentials in these variables and upload the code to your board open the serial monitor press the onboard reset button and you should get the esp ip address in your local network open your browser and type the ip address you should get access to the root web page with some text now imagine that you want to modify your web server code to do that via ota go to the espip address followed by update this web page loads every file that you want to upload via ota should be in dot bin format let's see a practical example imagine that you want to upload a new sketch that allows you to control an led via a web interface like this project here are the steps you need to follow copy the code provided and don't forget to insert your network credentials this is the same code used in this project but it contains the needed code to handle elegant ota save your sketch and give it a name generate the dot bin file from your sketch go to sketch export compiled binary and the new binary file is created under the project folder now you just need to upload that file using the update page make sure you have the firmware option selected click on the choose file and select the binary file you've just generated when it's finished click the back button then you can go to the root url to access the new web server you can click the on button to control the onboard led because we've also added ota capabilities to this new web server we can upload a new sketch in the future if needed you can also upload files to the file system using elegant.ta as an example we'll create a web server that serves files from the file system first we'll update the firmware and then we'll upload the html css and javascript files to the file system over the air copy the following code insert your network credentials in these variables and save it create a binary file from this sketch and upload a new firmware as shown previously next we will upload the files to the file system under the project folder create a new folder called data and move the html css and javascript files provided with the esp disconnect from your computer click on this menu or this one depending on the board you're using you'll get an error because there isn't an esp board connect your computer don't worry scroll up on the debugging window until you find the file with this extension or this one that's the file that you should upload here you can see where it is located select the file path and copy to the file explorer bar this is the file that you are looking for to make it easier to find you can copy to your project folder go to your espip address followed by update make sure you have the file system option selected and select the dot bin file after successfully uploading click the back button and go to the root url again you should get access to the following web page that controls the esp outputs using websocket protocol if you use vs code with platform io to program your usb boards and want to use the async elegant ota library you need to copy these lines to your project configuration file to get the firmware bin file you just need to compile the code and it will automatically generate the dot pin file for your project the file is called firmware.pin and it is saved on your project folder on a similar path to get the bin file for the file system image you just need to select this icon and click on the build file system image on the project tasks after that you should have the spiff.win or littlefps.pin file in this path we have a complete guide on how to use elegant ota with the esp using arduino ide or vs code check the links in the video description and that's it now you know how to add ota capabilities to your web server projects and how to upload new firmware and update the file system we hope you found this video useful if you enjoyed this video make sure you click the like button if you are new to the channel consider subscribing and ring the bell for post notifications to catch my next esp projects thanks for watching
Info
Channel: Rui Santos
Views: 43,551
Rating: undefined out of 5
Keywords: rui santos, randomnerdtutorials, random nerd tutorials, ESP32 ESP8266 NodeMCU OTA updates web, ESP32 Over-the-Air OTA Updates VS Code Arduino IDE, ESP8266 NodeMCU Over-the-Air OTA Updates VS Code Arduino IDE
Id: LUcKoJGX38M
Channel Id: undefined
Length: 7min 40sec (460 seconds)
Published: Thu Mar 18 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.