MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.25k stars 19.23k forks source link

[FR] Upload to multiple devices simultaneously in PlatformIO #14513

Open Frostyybeer opened 5 years ago

Frostyybeer commented 5 years ago

Description

Simultaneously upload to multiple serial ports with Auto Build in PlatformIO. Would be handy to upload new firmware changes to all connected 3D printers at once.

Additional Information

Found some useful information but I am having trouble understanding and implementing. https://github.com/platformio/platformio-core/issues/1383

cjstott94 commented 5 years ago

Hey it's been a while since I've used it not sure if it still works

Basically I put extra_scripts = multi_esptool.py

In the platform.ini And also a custom port variable, either Auto to detect all ports or a list of specific ports

;simultaneous_upload_ports = COM3, COM6, COM16 simultaneous_upload_ports = AUTO

Then the multi_esptool.py script runs after building (env.AddPostAction) The after_build function grabs the list of ports, as specified or automatically. Then for each port starts a thread that passes the port to the run function. This function changes the upload port to the passed value env.Replace(UPLOAD_PORT=port) it then grabs the upload command and firmware binary location and executes it It also retries and slows down if it gets an error code

Hopefully that helps

github-actions[bot] commented 4 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label / comment or this will be closed in 5 days.