Warning! Ignore unknown configuration option `--host_port` in section [env:ota]

Hi,

I am trying to upload an Arduino sketch to ESP on a different VLAN. When the OTA process starts, espota starts a local service on a random port.

With the normal espota process, I can pass in host_port=58181 which I have allowed in routing and it works fine.

When I do this in PlatformIO, it does not and I see the below warning and the upload fails.

Warning! Ignore unknown configuration option --host_port in section [env:ota]

my platform.ini looks like this:

[env:ota]
 extends = env:USB
 upload_protocol = espota
 upload_port = 10.10.57.151
 upload_flags =
	--host_port=58181
 	--auth=abc123

It’s clearly listening to the ini file as the auth works ok.
When it runs espota, I see this.

You can see in the second image how it’s just supplied a random port to the ota process.

How can I fix this as having an any<>any in my routing rules is not great.

This platformio.ini works perfectly for me:

[env:USB]
platform = espressif8266
framework = arduino
board = d1_mini
monitor_port = COM5
monitor_speed = 115200
upload_port = COM5
upload_speed = 921600

[env:OTA]
extends=env:USB
upload_protocol = espota
upload_port = 192.168.2.31
upload_flags =
  --auth=abc123
  --host_port=58181

Result:

Processing OTA (platform: espressif8266; framework: arduino; board: d1_mini)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/d1_mini.html
PLATFORM: Espressif 8266 (4.2.1) > WeMos D1 R2 and mini
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES:
 - framework-arduinoespressif8266 @ 3.30102.0 (3.1.2)
 - tool-esptool @ 1.413.0 (4.13)
 - tool-esptoolpy @ 1.30000.201119 (3.0.0)
 - tool-mklittlefs @ 1.203.210628 (2.3)
 - tool-mkspiffs @ 1.200.0 (2.0)
 - toolchain-xtensa @ 2.100300.220621 (10.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 37 compatible libraries
Scanning dependencies...
Dependency Graph
|-- ArduinoOTA @ 1.0
|-- ESP8266WiFi @ 1.0
Building in release mode
Retrieving maximum program size .pio\build\OTA\firmware.elf
Checking size .pio\build\OTA\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [====      ]  35.4% (used 28960 bytes from 81920 bytes)
Flash: [===       ]  30.3% (used 316156 bytes from 1044464 bytes)
Configuring upload protocol...
AVAILABLE: espota, esptool
CURRENT: upload_protocol = espota
Uploading .pio\build\OTA\firmware.bin
08:16:47 [DEBUG]: Options: {'esp_ip': '192.168.2.31', 'host_ip': '0.0.0.0', 'esp_port': 8266, 'host_port': 58181, 'auth': 'abc123', 'image': '.pio\\build\\OTA\\firmware.bin', 'spiffs': False, 'debug': True, 'progress': True}
08:16:47 [INFO]: Starting on 0.0.0.0:58181
08:16:47 [INFO]: Upload size: 320304
08:16:47 [INFO]: Sending invitation to: 192.168.2.31
Authenticating...OK
08:16:47 [INFO]: Waiting for device...

Uploading: [                                                            ] 0%

The parameter host_port did not work if it contained spaces, like this:

  --host_port = 58181

Please make sure that there are no spaces or (invisible) special characters.