OTA Programming of ESP32
David Bird Videos
- Tech Note 082 - ESP32 Over-the-Air (OTA) Updating
youtube
- Tech Note 084 - ESP Hints and Tips (Config erase, Restart, C ternary operator)
youtube
- Tech Note 086 - Uploading Files to an ESP32/ESP8266
youtube
- First study this YouTube video, we will study the same code:
Tech Note 087 - ESP32/8266 Download, Upload, Delete, Stream and Directory Services
To view list of files in ESP memory, upload or download images/ files study:
ESP32-ESP8266-File-Download-Upload-Delete-Stream-and-Directory from GitHub
IMPORTANT You must know about Partition Schemes in Arduino IDE Screen-shot: Arduino_IDE_PartScheme.png
Will need use OTA partitions.
To Do
- To upload compiled code (binary) to ESP32-CAM using WiFI:
Study the structure of this code example:
Select AI Thinker ESP32 CAM Board
Examples -> ArduinoOTA -> OTA web updater
- Perform the following tasks:
- Upload this modified SPIFFS_Test.ino file (PFA) to using the partition scheme (PFA) and see the output on serial port
- After the above step a few sample files will be created in SPI file system
- Assuming that you have soldered the "push button switch" on camera plate
- Now upload the 2023_07_21_a.zip [ jm_eTFT_cam_pca.ino ]
- See the instructions on the TFT, Serial Monitor, Code comments
- When you will RESET the ESP32-CAM,
watch the TFT display (or the Serial Moniter Baud 9600)
there will be two modes to select from:
- WiFI Browser mode
- normal Robot Software Run mode
- Press the push button switch on Camera Plate [WiFI Browser mode]
- On the TFT Display and serial moniter you can fins the IP address assigned to your ESP32
Example: http://172.20.10.11
- NOTE: Laptop and ESP32 MUST use the same hotspot for WiFI (example your mobile). In this way both will be part of the same network
- Copy the string http://172.20.10.11 from the Serial Moniter and paste it in the address bar of the browser.
- A web page showing the ESP32 SPIFFS will appear
- Now you can browse all files, upload, download, update firmware binary
- Also click on the "Directory" button on web-page to "list" the directories created by SPIFFS_Test.ino
Tips for OTA Upload
- Whenever you write a code in Arduino IDE and compile it, an executable binary code is generated (which we upload to the board)
- To get a firmware binary of your code, you should go to:
Sketch -> Export Compiled Binary
- It will give you a binary file in the sketch folder:
Example: \build\esp32.esp32.esp32cam\jm_eTFT_cam_pca.ino.bin
- You can use sketch upload button on the Web browser to upload this binary On The Air (OTA)
You should also know (Optional Study Material, for extra knowledge) :-
- Basic text read write: Good tutorial:
YouTube video ESP32 SPIFFS Arduino - Save files with data onto your ESP32's Flash
-
Nice tutorial:
SPIFFS in ESP32 [Tutorials Point]
- Official Doccumentation:
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/storage/spiffs.html
- Displaying photo/images from SPIFFS: 3 methods:
https://randomnerdtutorials.com/display-images-esp32-esp8266-web-server/