Yeah, I think
PLATFORMIO_EXTRA_SCRIPTS will work!
Could you put a short description of ways you can set extra scripts on the page documenting extra_scripts?
I had looked for ways to set it, but completely missed the environment variables page.
Use case explanation:
TL;DR: We need a script that can deal with multiple PIO projects and 100+ devices in multiple locations that need slightly different configs, we need to store device configs in the easiest to read/modify way possible.
More detailed: We have 100+ tasmota [ GitHub - arendst/Tasmota: Alternative firmware for ESP8266 with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at ] devices, as well as a bunch of other devices that are not yet compiled with pio(That’s what my other thread here is about, and I hope to have time to confirm the fix works on my end later this week).
We have written several scripts to help flash devices, the current version you can see here: https://github.com/i3detroit/Automatic-IoT-module-programming/tree/serial
Apologies for the current state of everything there, I just started cleaning up the python version someone else put together else wrote a few days ago.
tasmota.yaml is the current set of device configs, but I plan to simplify that and make it not yaml so it’s readable, and if possibly simplify it even more soon.
Our script writes a config file, runs sed on
platformio.ini to set flashing mode, and then calls pio for every device.
Using the environment variable will make that much cleaner.
Before now, we had no way to set flashing mode, so there was no reason to try to change
extra_scripts, it was just set it once, and then it would be fine.
There are also non-tasmota devices we have to deal with, so right now that’s just a completely separate script, but I’m hoping to port those other codebases to platformio(That’s the other thread I have here, I’m hoping to confirm the fix worked later this week, sorry about the delay) and then use our new script to flash those as well.
Edit: Completely different issue: the forum told me I can’t link to the host
docs.platformio.org in my reply, I had to edit the above link in. No idea why.