PlatformIO extra_script: make ``pio run -t upload`` push over Ethernet.
Adapted from maxgerhardt/pio-esp32-ethernet-ota, which replaces UPLOADCMD with
a custom command — the idea being that OTA should be the same one-button
action as a USB upload, not a separate script you have to remember. The
difference here is that it drives ``ota_upload.py`` (our own protocol and our
own error messages) rather than curl.
Wire it into any project by adding an OTA env to its platformio.ini:
[env:ota]
extends = env:adafruit_feather_esp32s3 ; your normal build env
upload_protocol = custom
extra_scripts = post:../../tools/pio_ota_upload.py ; adjust depth
upload_flags =
--ip=192.168.2.41
Then:
pio run -e ota -t upload
``upload_flags`` are passed straight through to ota_upload.py, so anything it
accepts works here — e.g. ``--port=3232`` or a longer ``--timeout=90``.
The path depth differs per project (the repo's projects sit at different
levels), which is why this is spelled out per project rather than in
platformio-common.ini — the same reason lib_extra_dirs is per-project there.