fbeauKmi / update_klipper_and_mcus

A bash script to update klipper and mcus in one step
GNU General Public License v3.0
49 stars 7 forks source link

Add a config_name parameter for shared menuconfigs #10

Closed alecplumb closed 13 hours ago

alecplumb commented 2 weeks ago

It would be useful to add something like a config_name parameter so that multiple MCU entries can share the same menuconfig options. This would be primarily useful in toolchangers where you may have several toolhead MCUs that are all the same model of toolhead board.

UKAM already works great for toolchangers and I have set it up on all of my printers. This request would just be a "nice to have".

fbeauKmi commented 2 weeks ago

Thanks for the interest. I like the feature, I'll do it. By default, UKAM uses section name as config name. A working config could be :

[mcu tool1]
quiet_command: enter_bootloader -t usb -d /dev/serial/by-id/usb-Klipper_rp2040_<BOARD1_ID>-if00
action_command: ~/katapult/scripts/flashtools.py -d /dev/serial/by-id/usb-Katapult_rp2040_<BOARD2_ID>-if00

[mcu tool2]
config_name: mcu tool1
quiet_command: enter_bootloader -t usb -d /dev/serial/by-id/usb-Klipper_rp2040_<BOARD2_ID>-if00
action_command: ~/katapult/scripts/flashtools.py -d /dev/serial/by-id/usb-Katapult_rp2040_<BOARD2_ID>-if00

[mcu toolN]
config_name: mcu tool1
quiet_command: enter_bootloader -t usb -d /dev/serial/by-id/usb-Klipper_rp2040_<BOARDN_ID>-if00
action_command: ~/katapult/scripts/flashtools.py -d /dev/serial/by-id/usb-Katapult_rp2040_<BOARDN_ID>-if00

but any identical config_name for all entries will work too.

Let me know if it looks good to you. I just have to make some tests before to push into develop branch

alecplumb commented 2 weeks ago

Looks great, exactly what I was thinking

fbeauKmi commented 1 week ago

I added the feature to the develop branch (see commit https://github.com/fbeauKmi/update_klipper_and_mcus/commit/674cb6e052c2231e2bbd02b242c48cd4094b11a9 ) , I'll probably merge in main in the next few weeks.

There's an incompatibility between config_name and forged USB serial number (not documented in readme). So I've added a check to make sure this doesn't happen.