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

[FEATURE] Multi function button #32

Open
EugeneSlabbert opened this issue Aug 15, 2021 · 9 comments
Open

[FEATURE] Multi function button #32

EugeneSlabbert opened this issue Aug 15, 2021 · 9 comments

Comments

@EugeneSlabbert
Copy link

First of all...great work, very convenient and easy to implement. Thank you.
I have a single (NO) button installed and set to shut down system when pressed and held for 2 sec. Is there any way to start up the Pi again with the same button? and secondly will it be possible to set the button to 500sm, 1000ms, and 2000ms to perform different tasks on hold time? for instance 500ms = Toggle pause, 1000ms = Cancel Print, and 2000ms = Shutdown system.

Cheers!!

@LuxuSam
Copy link
Owner

LuxuSam commented Aug 16, 2021

Hi,
Thank you very much :D

In #23 GPIO3 was added. I was told that you can use that GPIO to also wake up the raspberry pi, but did not test that myself. So theoretically, you could setup a button which is connected to GPIO3 and use a system command to shut down the pi and use the same button to turn it on again.

Regarding your feature request. I think it could be doable, but a single button with no feedback whatsoever makes this very hard as you would have to set up intervals which you have to hit exactly, if not the wrong activity could be executed 😅 . So generally it could be done, but I don't think this is very user friendly and that would defeat the purpose of easy to use buttons. If you're scared to be running out of Ground pins, you should be able to use multiple buttons on one Ground pin without a problem :)

Cheers,
Sam

@LuxuSam LuxuSam changed the title Multi function button [FEATURE] Multi function button Aug 17, 2021
@mtabo
Copy link

mtabo commented Aug 27, 2021

Hello,

Thanks for creating this plugin, it came very handy to turn on and off the printer with the PSU Control plugin via a command to the API.
I second the request, I would like to get rid of the limitation that does not let you use the same GPIO for another function, I would like to achieve that with a single button, touching it 500ms turns on and touching it 4000ms turns off.

Best Regards

@LuxuSam
Copy link
Owner

LuxuSam commented Aug 29, 2021

I'll think about how I could add it without breaking the current setup.

@cbrherms
Copy link

cbrherms commented Jan 4, 2022

I would like to third this, for the same reason as @mtabo - press to trigger an on action and hold for a few seconds to trigger an off action.

@jneilliii
Copy link

you guys could use the toggle command instead. Using a system action with the following command.

/home/pi/oprint/bin/octoprint plugins psucontrol:toggle

@cbrherms
Copy link

you guys could use the toggle command instead. Using a system action with the following command.

/home/pi/oprint/bin/octoprint plugins psucontrol:toggle

Yeah, that is what I do currently, but does mean that the actual hold time is the same for both an on and an off action.

@LuxuSam
Copy link
Owner

LuxuSam commented Mar 18, 2022

I have an idea on how to implement this feature properly.
I'll start with it as soon as I have time!

@coolcheat
Copy link

Newcomer here.

Love the plugin! would also love the ability to bind different activities depending on the hold duration.

Thanks!

@stripu
Copy link

stripu commented May 21, 2024

Hello! Any news on this? It would be a very helpful implementation for special situations.
Thank you for your work on this plugin!

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

No branches or pull requests

7 participants