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

Allow gcode macros to call external scripts #3454

Closed
abduct opened this issue Oct 21, 2020 · 4 comments
Closed

Allow gcode macros to call external scripts #3454

abduct opened this issue Oct 21, 2020 · 4 comments
Labels

Comments

@abduct
Copy link

abduct commented Oct 21, 2020

Hello

I think a feature that should be implemented is allowing gcode macros to be able to call external scripts passing data via the command line.

This would open up a vast cove of extra features without much work on the klipper side of things. For example, say I have created a ruby script that uses the a push notification gem that when called will send my phone a notification of printer status obtained from the provided command line arguments. You could then extend various macros to include notification results. This is only one example. You can use this for print statistics, error notifications, ready state notifications, etc.

For example you may be able to extend the END_PRINT macro like so to obtain the first example where a phone would be notified of a finished print:

[gcode_macro END_PRINT]
gcode:
    # Turn off bed, extruder, and fan
    M140 S0
    M104 S0
    M106 S0
    # Move nozzle away from print while retracting
    G91
    G1 X-2 Y-2 E-3 F300
    # Raise nozzle by 10mm
    G1 Z10 F3000
    G90
    # Disable steppers
    M84
   RUN_EXTERNAL_END_PRINT

[gcode_macro RUN_EXTERNAL_END_PRINT]
   RUN_EXTERNAL "ruby ~/scripts/notify.rb 'print finished!'"

I am not familiar with python, but if pointed to the right section of the code base, I may be able to figure out a POC for this feature request.

Any suggestions, improvements, or opinions about this feature request would be appreciated.

Thanks/

@klipper-gitissuebot
Copy link

Hi @abduct,

It did not look like there was a Klipper log file attached to this ticket. The log file has been engineered to answer common questions the Klipper developers have about the software and its environment (software version, hardware type, configuration, event timing, and hundreds of other questions).

Unfortunately, too many people have opened tickets without providing the log. That consumes developer time; time that would be better spent enhancing the software. If this ticket references an event that has occurred while running the software then the Klipper log must be attached to this ticket. Otherwise, this ticket will be automatically closed in a few days.

For information on obtaining the Klipper log file see: https://github.com/KevinOConnor/klipper/blob/master/docs/Contact.md

The log can still be attached to this ticket - just add a comment and attach the log to that comment.

Best regards,
~ Your friendly GitIssueBot

PS: I'm just an automated script, not a human being.

@OldCurmudgeon3DP
Copy link

Octorant and a couple of other programs already handle the specific example given. There may be other uses for the expansion though.

@abduct
Copy link
Author

abduct commented Oct 26, 2020

This issue can be closed as it is a duplicate of #2173. I left my remarks and hopefully it can be merged eventually.

@github-actions
Copy link

Hello,

It looks like there hasn't been any recent updates on this
Klipper github issue. If you created this issue and no
longer consider it open, then please login to github and
close the issue. Otherwise, if there is no further activity
on this thread then it will be automatically closed in a few
days.

Best regards,

~ Your friendly GitIssueBot

PS: I'm just an automated script, not a human being.

@github-actions github-actions bot added the Stale label Nov 17, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Nov 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants