PlatformIO Community

Upload_port to support mulitple

not sure you can do this today but would be really nice if I could specify more than one COM port so it compiles and uploads to more than 1 device … currently I need to do it one at a time and even worse it does a full re-compile when I just need to change the COM port :frowning:

For multiple devices, it might be simpler to use global and local scope env blocks so you can have an env for each port (note that you need to be running at least PIO v4.0 for this option):

i.e.

[env]
platform = atmelavr
framework = arduino
board = uno

[env:COM1]
upload_port = COM1

[env:COM2]
upload_port = COM2

Or if you want to be more explicit or need more control, use the extends parameter (note that you need the just released PIO v4.1 for this option):

[env:uno]
platform = atmelavr
framework = arduino
board = uno

[env:micro]
platform = atmelavr
framework = arduino
board = micro

[env:uno-COM1]
extends=env:uno
upload_port = COM1

[env:micro-COM2]
extends=env:micro
upload_port = COM2

Alternately, advanced scripting is the other option - you can see from this issue comment how someone approached multiple simultaneous OTA uploading using the advanced scripting functionality of PIO.

1 Like