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

POWER control new type: shell script #932

Open
Jaj0 opened this issue Jan 1, 2025 · 3 comments
Open

POWER control new type: shell script #932

Jaj0 opened this issue Jan 1, 2025 · 3 comments
Labels
enhancement New feature or request

Comments

@Jaj0
Copy link

Jaj0 commented Jan 1, 2025

Is your feature request related to a problem? Please describe

[power printer] config has a lot of different types of supported switches, but the issue is that all of them are very device specific.
But there might be cases that all of available solutions are not working for specific case. Then some universal solution would be appropriate.

Example case: im running klipper+moonraker+mainsail on NanoPi Neo Air, my power relay (that shuts down whole printer with MCU) is connected to one of gpios. As this is not RaspberryPI there are some issues to use gpio type for this config.
But i can switch gpio using alternative WiringNP library, just calling gpio write 7 1.

Describe the solution you'd like

It would be good to add option to have possibility to execute shell command as power on/power off command. Similar as in linked discussion

[power PRINTER]
type:command
TurnON: gpio mode 7 output; gpio write 7 1
TurnOFF: gpio write 7 0

Describe alternatives you've considered

I've tried using shell macros extension for klipper, but issue is that it only works when MCU is already running which is not possible before powering MCU of printer.

Additional information

No response

@Jaj0 Jaj0 added the enhancement New feature or request label Jan 1, 2025
@Jaj0
Copy link
Author

Jaj0 commented Jan 1, 2025

#784

@Twinki14
Copy link

Twinki14 commented Jan 2, 2025

+1, I have a TP Link Tapo smart plug between my printer and power supply, but the plug is no longer natively compatible with Moonraker, this tool https://github.com/python-kasa/python-kasa let's me control it via a CLI - using Klippers shell command extensions I have some level of control on my MCU

The CLI/Library for controlling my smart plug could be wrapped in a HTTP server which I've already made an issue about here python-kasa/python-kasa#1403 but if Moonraker had the ability to just execute the CLI, there would be no need

@Jaj0
Copy link
Author

Jaj0 commented Jan 2, 2025

In the meantime ive created temporary solution in means of simple http server that takes http requests and calls cli commands:
https://github.com/Jaj0/moonraker-cli-switch-server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants