Hello everybody,
I got PlatformIO (VSC & Windows 10) with espidf framework to update via OTA.
As for the C code I used the simple_OTA as example, mixed with the AP example, so I have to log in to the ESP32 AccessPoint from my PC. The code worked with a native installation of ESP-IDF and VSC, but panic’d when running it from PlatformIO. This is what I missed, even if it is so obvious:
1.) Provide “fact_two_ota_part.csv” in the root directory (where platformio.ini is)
# Espressif ESP32 Partition table
#
# Factory Boot partition
# OTA Partition 1 & 2
#
# Name, Type, Subtyp, Ofs, Size, Flags
nvs, data, nvs, , 0x4000,
otadata, data, ota, , 0x2000,
phy_init, data, phy, , 0x1000,
factory, app, factory,, 1M,
ota_0, app, ota_0, , 1M,
ota_1, app, ota_1, , 1M,
2.) modify platformio.ini to use this partition.csv file
[env:heltec_wifi_kit_32]
platform = espressif32
board = heltec_wifi_kit_32
framework = espidf
board_build.partitions = fact_two_ota_part.csv
3.) now upload your compiled code one last time via COM onto the board
4.) using powershell [> ] you can now upload via OTA
“curl 192.168.1.1:8032 --data-binary @- < C:\Users\GvT\Documents\ESP32\Basics.pio\build\heltec_wifi_kit_32\firmware.bin” | cmd
this command pipes the curl command to cmd.exe. You need to specify the IP address of your board, the listening port of the OTA server, the type of data as well as the link to the your image (compiled and linked code).
I have not setup a script as pfeerick suggested
Why do I want to use OTA?
- faster than Upload via COM (for me about factor 2)
- no need to connect your board via USB (my Heltec32 is waterproof encased)
Many greetings
and thanks a lot to pfeerick for the hints
Georg