OTA Upload host detected as COM port

Is there a way to force PlatformIO to use OTA?

I’m trying to upload code to my ESP32 running Arduino with OTA via hostname, but PlatformIO tries to open a COM port instead. (See below)

Programming works when I set upload_port = ip.ad.dr.ess but not when I set upload_port = blink.

If I ping blink on my machine, it works.

blink.local is detected as a host and PIO does not try to use a serial port. However I am not using mDNS.

I have tried with blink.mysearchdomain as well to no avail.

It even fails if I try to fully quality the domain: blink.mysearchdomain..

Configuring upload protocol...
AVAILABLE: esp-prog, 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 = esptool
Looking for upload port...
Use manually specified: blink
Uploading .pioenvs\esp32doit-devkit-v1\firmware.bin
Serial port blink
Traceback (most recent call last):
File "C:\Users\Cameron\.platformio\packages\tool-esptoolpy\esptool.py", line 2849, in <module>
File "C:\Users\Cameron\.platformio\packages\tool-esptoolpy\esptool.py", line 2842, in _main
File "C:\Users\Cameron\.platformio\packages\tool-esptoolpy\esptool.py", line 2549, in main
esp = chip_class(each_port, initial_baud, args.trace)
File "C:\Users\Cameron\.platformio\packages\tool-esptoolpy\esptool.py", line 213, in __init__
self._port = serial.serial_for_url(port)
File "c:\users\cameron\.platformio\penv\lib\site-packages\serial\__init__.py", line 88, in serial_for_url
File "c:\users\cameron\.platformio\penv\lib\site-packages\serial\serialwin32.py", line 62, in open
raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
serial.serialutil.SerialException: could not open port 'blink': WindowsError(2, 'The system cannot find the file specified.')
*** [upload] Error 1
platform = espressif32
board = esp32doit-devkit-v1
framework = arduino

Does it work with the latest upstream version Espressif 32 — PlatformIO latest documentation?

+1 , ran across this just now too.

extends = env:d1_mini
upload_protocol = espota
upload_port = espp1mons1.local
upload_flags =  


Configuring upload protocol...
AVAILABLE: espota, esptool
CURRENT: upload_protocol = espota
Uploading .pio\build\d1_mini_ota\firmware.bin
21:48:07 [DEBUG]: Options: {'esp_ip': 'COM3', 'host_ip': '', 'esp_port': 8266, 'host_port': 13835, 'auth': 'admin', 'image': '.pio\\build\\d1_mini_ota\\firmware.bin', 'spiffs': False, 'debug': True, 'progress': True}
21:48:07 [INFO]: Starting on
21:48:07 [INFO]: Upload size: 514512
21:48:07 [INFO]: Sending invitation to: COM3