Upload OTA is missing

I’m aware I can configure different environment for serial and OTA uploads. But I’m wondering why there are are two buttons for Upload filesystem image w/ and w/o OTA, but not for sketch:

immagine

1 Like

That would give the impression that you can just click the “Upload via OTA” and have it work without configuration (i.e., telling PlatformIO the target address) – I think it may confuse people.

Nope. Because with two different buttons the standard one would use the serial protocol and the serial port, while the second the espota protocol and the ip address as port (two different sets of parameters, instead of changing them every time).

I mean, it’s unbelievable I have to change the configuration (that leads to a full rebuild) just to change the upload port or the upload protocol (since they are not related with the build configuration).

1 Like

In PlatformIO terms, until now, each environment can specifiy their own upload_protocol = ... and the upload button will use that for the firmware upload.

Nonetheless, I invite you to file an issue at Issues · platformio/platformio-vscode-ide · GitHub so that this can be discussed with the PlatformIO developers.

Same issue here. It is necessary to make two environments.
Did you open an issue on GitHub @mark-81 ?
Probably there is already an fix i do not know about.

Example:

[env:esp-module-ou]
platform = espressif32
board = esp32dev
framework = arduino
monitor_filters = send_on_enter, colorize
monitor_echo = yes
monitor_speed = 115200
build_flags =
	-DCORE_DEBUG_LEVEL=0
lib_deps = 
	bblanchon/ArduinoJson@^6.20.0
	ottowinter/ESPAsyncWebServer-esphome@^3.0.0
	arkhipenko/TaskScheduler@^3.7.0
	robtillaart/RunningMedian@^0.3.7

[env:esp-module-ou-ota]
platform = espressif32
board = esp32dev
framework = arduino
monitor_filters = send_on_enter, colorize
monitor_echo = yes
monitor_speed = 115200
upload_port = espou
upload_protocol = espota
upload_flags =
	--host_port=45000
build_flags =
	-DCORE_DEBUG_LEVEL=0
lib_deps = 
	bblanchon/ArduinoJson@^6.20.0
	ottowinter/ESPAsyncWebServer-esphome@^3.0.0
	arkhipenko/TaskScheduler@^3.7.0
	robtillaart/RunningMedian@^0.3.7

Btw, the platformio.ini overhead can be significantly reduced by offloading settings that are equal to all environments to [env].

[env]
platform = espressif32
board = esp32dev
framework = arduino
monitor_filters = send_on_enter, colorize
monitor_echo = yes
monitor_speed = 115200
build_flags =
	-DCORE_DEBUG_LEVEL=0
lib_deps = 
	bblanchon/ArduinoJson@^6.20.0
	ottowinter/ESPAsyncWebServer-esphome@^3.0.0
	arkhipenko/TaskScheduler@^3.7.0
	robtillaart/RunningMedian@^0.3.7

[env:esp-module-ou]
; no differing settings

[env:esp-module-ou-ota]
upload_protocol = espota
upload_flags =
	--host_port=45000

But isn’t that exactly how Upload Filesystem Image and Upload Filesystem Image OTA tasks work? The Upload Filesystem Image OTA task gives an impression it could work by just clicking it.

And it is confusing because pressing Upload Filesystem Image OTA uploads via COM port if USB cable is connected.