Hello *,
I think I just made a mistake, but as I analyzed it now for some hours and decided to ask now.
I want to add a script to my python code. What I did:
#loged in via ssh as pi in a MainsailOS default debian image
service klipper stop
cd ~/klipper/klippy/extras/
wget https://github.com/th33xitus/kiauh/raw/master/resources/gcode_shell_command.py
service klipper start
I did this on 2 printers, with a very similar software setup. On one the file is recognized, and the command is available on the other the printer the python code is not compiled, and the command is not available.
I did restart klipper and the printer, renamed the file, retouched the file, compiled it by hand, checked the permission… But no matter what I do, there will not be generated a pyc file (except I generate it myself). So my conclusion is that I miss something.
I did read this, but could not find more information:
I could not find any hint on the logs.
On this printer it works flawless:
log deleted
On this printer the python file will not be recognized:
log deleted
Same python version same patch level on os. Same klipper patch level was tested.
I did forget that I removed the inclusion of the file where I included the shell command!
Thanks!!! You are so helpful and so fast!
So the conclusion is:
The file was not respected because it was not used correct?
Or more precisely, the file was never compiled because the code did never run?
From the log it seems that the file is well respected
The error Unknown command:"RUN_SHELL_COMMAND" might be misleading in the sense that Klipper knows RUN_SHELL_COMMAND but does not know CMD=signal_light, since you forgot to define it via [gcode_shell_command signal_light]