OTA Programming of ESP32

David Bird Videos

  1. Tech Note 082 - ESP32 Over-the-Air (OTA) Updating youtube
  2. Tech Note 084 - ESP Hints and Tips (Config erase, Restart, C ternary operator) youtube
  3. Tech Note 086 - Uploading Files to an ESP32/ESP8266 youtube
  4. 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

  1. 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
  2. Perform the following tasks:
    1. Upload this modified SPIFFS_Test.ino file (PFA) to using the partition scheme (PFA) and see the output on serial port
    2. After the above step a few sample files will be created in SPI file system
    3. Assuming that you have soldered the "push button switch" on camera plate
    4. Now upload the 2023_07_21_a.zip [ jm_eTFT_cam_pca.ino ]
    5. See the instructions on the TFT, Serial Monitor, Code comments
    6. 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
    7. Press the push button switch on Camera Plate [WiFI Browser mode]
    8. On the TFT Display and serial moniter you can fins the IP address assigned to your ESP32
      Example: http://172.20.10.11
    9. 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
    10. Copy the string http://172.20.10.11 from the Serial Moniter and paste it in the address bar of the browser.
    11. A web page showing the ESP32 SPIFFS will appear
    12. Now you can browse all files, upload, download, update firmware binary
    13. Also click on the "Directory" button on web-page to "list" the directories created by SPIFFS_Test.ino

Tips for OTA Upload

  1. Whenever you write a code in Arduino IDE and compile it, an executable binary code is generated (which we upload to the board)
  2. To get a firmware binary of your code, you should go to:
    Sketch -> Export Compiled Binary
  3. It will give you a binary file in the sketch folder:
    Example: \build\esp32.esp32.esp32cam\jm_eTFT_cam_pca.ino.bin
  4. 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) :-
  1. Basic text read write: Good tutorial: YouTube video ESP32 SPIFFS Arduino - Save files with data onto your ESP32's Flash
  2. Nice tutorial: SPIFFS in ESP32 [Tutorials Point]
  3. Official Doccumentation: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/storage/spiffs.html
  4. Displaying photo/images from SPIFFS: 3 methods: https://randomnerdtutorials.com/display-images-esp32-esp8266-web-server/