OTA to multiple boards of same type

I tried this in platform.ini

[env:d1_mini]
platform = espressif8266
board = d1_mini
framework = arduino
upload_port=MagicButtonBox1.local

[env:d1_mini]
platform = espressif8266
board = d1_mini
framework = arduino
upload_port=MagicButtonBox2.local

This didn’t work. I was hoping for that the result would be multiple OTA updates but the build system only used the last one defined. Also tried multiple rows only for upload_port. Only used the last one.

A possible improvement.

:slight_smile:

and

Do you see a difference? :sunny:

I know, it’s the same. What I wanted was just to make it possible to update to several boards of the same type but with different port names. So I just experimented by first having two rows for port and then duplicated target sections but with different ports. So, is it possible to have a list of ports to upload to after new build? Or should I use the “environment parameter”?

Just make UNIQUE environments in configuration file, that is why I pointed you… PIO sees only 1 env in your config, they have the same name.

OK, I understand now, thank you! Works like I want it to, just didn’t understand the environment section in the ini file.

Is there a way to do this without needing to specify each board in the ini file? I have 150 boards I want to update at once. Although actually I would prefer to update all available boards found via pio device list --mdns

See