Pio --upload-port not used with v4

I reproduced this with a build and upload of a minimal hello world nodemcu pio project.

The platformio.ini had the wrong upload_port, but I used --upload-port to override.

This works with pio3 but not with pio4.

How is this done now?

platformio.ini

[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino

upload_port = /dev/ttyUSB0

Commandline:

pio run --target upload --upload-port /dev/ttyUSB1

  • with pio3 this uploads to ttyUSB1 as I expected.
  • with pio4 this tries to upload to ttyUSB0 and fails.

I can’t reproduce this. Could you provide an output from pio device list?

Actually, I can… with upload_port upload_port = /dev/ttyUSB0 specified in my platformio.ini, running pio run --target upload --upload-port /dev/ttyUSB1 fails… even though the command line specified port is the correct one… so the CLI doesn’t seem to be overriding the platformio.ini specified port.

AVAILABLE: arduino
CURRENT: upload_protocol = arduino
Looking for upload port...
Use manually specified: /dev/ttyUSB0
*** [upload] could not open port /dev/ttyUSB0: [Errno 2] No such file or directory: '/dev/ttyUSB0'

[pfeerick@asus-h55d bitOfEverything]$ pio device list                                   
/dev/ttyS0
----------
Hardware ID: PNP0501
Description: ttyS0

/dev/ttyUSB1
------------
Hardware ID: USB VID:PID=1A86:7523 LOCATION=1-1.6
Description: USB2.0-Serial

Thanks! This is our bug and has been just fixed. Please re-test with pio upgrade --dev.

1 Like

Yup, that squashed that :bug: ! Thanks :slight_smile:

1 Like