Implementing Auth password for ESP32 OTA

I am trying to set an authentication password for ESP32 OTA. I understood from the documentation that I need to set that as upload_flags options but it’s not working. My ini file looks as follows:

[env:esp32doit-devkit-v1]
platform = espressif32
board = esp32doit-devkit-v1
framework = arduino

build_type = debug
upload_protocol = espota
upload_port = PX-ESP32

upload_flags =  
    --auth = password

Liib_deps =
  # RECOMMENDED
  # Accept new functionality in a backwards compatible manner and patches
  jandrassy/TelnetStream @ ^1.2.1

Upon compilation I get the following error:

esptool.py v3.0
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\esp32doit-devkit-v1\firmware.bin
Usage: espota.py [options]

espota.py: error: no such option: --auth
*** [upload] Error 2

Could you please tell how I can make it work?

Have you tried removing the spaces? --auth=password? I think it’s just a shell escape issue.

1 Like