Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] #12

Open
Engineer997 opened this issue Jul 11, 2023 · 2 comments
Open

[BUG] #12

Engineer997 opened this issue Jul 11, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@Engineer997
Copy link

When attempting to run the mostly stock command CHANGE_TOOL TOOL=1(or 2) I get this error
sh: 0: cannot open ~/printer_data/config/tool_swap.sh: No such file

I changed the directory to /home/pi/ in place of ~/ and I get this error:

/home/pi/printer_data/config/tool_swap.sh: 37: [[: not found
Error: Invalid input. Integer required.

So it looks like with /home/pi/ it can make it to the file but the tool_swap.sh code rejects the 1 and 2 stating they are not integers.

Commenting out the integer check in tool_swap.sh results in printer.cfg being erased.

I followed the instructions here:
https://github.com/rootiest/zippy-klipper_config/tree/master/extras/tool_swap
and I have made no adjustments to the code in swap_tools.cfg and tool_swap.sh but did add my tool configs to the tool1.cfg and tool2.cfg to prevent klipper errors.
CHANGE_TOOL Command and results
CHANGE_TOOL TOOL=2 Command and results
swap_tools cfg
Printer cfg

@Engineer997 Engineer997 added the bug Something isn't working label Jul 11, 2023
@github-actions
Copy link

Welcome Engineer997!\nCongrats on creating your first issue.\nPlease follow the issue template to help us resolve your issue quickly.

@rootiest
Copy link
Owner

rootiest commented Mar 3, 2024

The gcode_shell_command can be really problematic to use.

It's extremely picky about the syntax/formatting, and depending on your OS you may see different behavior/formatting preferred.

Try running the following:

chmod +x /home/pi/printer_data/config/tool_swap.sh

And then change the following lines:

command: sh ~/printer_data/config/tool_swap.sh 1
command: sh ~/printer_data/config/tool_swap.sh 2

to:

command: /home/pi/printer_data/config/tool_swap.sh 1
command: /home/pi/printer_data/config/tool_swap.sh 2

It may work better running that way.

I know this response is incredibly late, I apologize for that!

Please let me know if this helps, either here or you can reach me on Discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants