I’m trying to make an OTA on my ESP32. The cpp is OK and manually triggering the update works fine but when I click on VS Code on the “Upload” button, it defaults to “COMx” instead of the given IP.
Manual call:
python C:\Users\<user>\.platformio\packages\framework-arduinoespressif32\tools\espota.py --ip 192.168.178.51 --port 3232 --timeout 60 --file "firmware.bin" --debug
this works perfectly, I get the given firmware on my ESP.
Call via VS Code
What I want now is to trigger the upload using PlatformIOs IDE buttons on VS code.
My plaftormio.ini file:
[env:az-delivery-devkit-v4]
platform = espressif32
board = az-delivery-devkit-v4
framework = arduino
upload_port = 192.168.178.51
monitor_speed = 115200
; OTA
upload_protocol = espota
upload_flags =
--port=3232
board_build.partitions = min_spiffs.csv
build_unflags = -Os
I build the project → all OK
When I click on UPLOAD, on the terminal I see:
Executing task: C:\Users\<user>\.platformio\penv\Scripts\platformio.exe run --target upload --upload-port COM5
Then it fails with the following information:
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [= ] 8.2% (used 43848 bytes from 532480 bytes)
Flash: [==== ] 42.8% (used 841746 bytes from 1966080 bytes)
Configuring upload protocol...
AVAILABLE: esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = espota
Uploading .pio\build\az-delivery-devkit-v4\firmware.bin
08:53:22 [DEBUG]: Options: {'esp_ip': 'COM5', 'host_ip': '0.0.0.0', 'esp_port': 3232, 'host_port': 30698, 'auth': '', 'image': '.pio\\build\\az-delivery-devkit-v4\\firmware.bin', 'spiffs': False, 'debug': True, 'progress': True, 'timeout': 10}
08:53:22 [INFO]: Starting on 0.0.0.0:30698
08:53:22 [INFO]: Upload size: 841856
Sending invitation to COM5 failed
08:53:24 [ERROR]: Host COM5 Not Found
*** [upload] Error 1
Why is the Upload-button not reading my IP and kept fixed to my COM5? I already disconnected COM5 but it is still defaulting to it.
I’ve removed and reinstalled the platformio IDE on VS Code, but the problem persists.
Any ideas how to fix this?