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

POWERTOGGLE only Powering off #1924

Closed
fhb opened this issue Jun 7, 2021 · 10 comments
Closed

POWERTOGGLE only Powering off #1924

fhb opened this issue Jun 7, 2021 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@fhb
Copy link

fhb commented Jun 7, 2021

Describe the bug
The !POWERTOGGLE action only turns off my Prusa mini plugged into a TP-Link power plug. !POWERON custom action and automatic power on, when octodash leaves sleep state do work.

To Reproduce
Steps to reproduce the behavior:

  1. Touch click the [!POWERTOGGLE] custom action
  2. Octodash goes to sleep
  3. Touch click on the arrow in Octodash to open custom actions
  4. Touch click the [!POWERTOGGLE] custom action
  5. Nothing happens

Expected behavior
The TP-LINK power plug should power on

Screenshots
IMG_3898
IMG_3899

General Information:

  • Raspberry PI 4
  • OS Info: Raspbian Buster Lite, please also indicate if you used OctoPi]
  • OctoDash Version 2.20
  • OctoPrint Version 1.6.1
@fhb fhb added the bug Something isn't working label Jun 7, 2021
@jneilliii
Copy link
Contributor

This is actually intended because my TPLink Plugin doesn't have a toggle state the same way that PSU Control plugin does. I use a separate button for the on/off commands. If you want the toggle option, you can switch to using PSU Control with the TPLink sub-plugin for it.

@fhb
Copy link
Author

fhb commented Jun 7, 2021

Okay, thank you! It's still unexpected behaviour I think. It's probably a good idea to mention this in the custom actions documentation. I will stick to distinct on/off actions, I actually find it hard to think of a situation where "!POWERON" is necessary thanks to the automation.

@fhb fhb closed this as completed Jun 7, 2021
@7R0J4Ner
Copy link

I also have this Problem but with a simple Relay, not a Smartplug.

It would be very nice to have just 1 Button to Controll the Power...

Is there a Workaround?

@jneilliii
Copy link
Contributor

@7R0J4Ner POWERTOGGLE should be supported by the PSUControl plugin with a simple relay.

@7R0J4Ner
Copy link

Well, unfortunately, it does not work. I just tried it again.
Exactly the same error as described by @fhb above.

I have connected the relay to GPIO4 and configured it in PSU Controll with the GPIO plugin.
The commands [!POWERON] + [!POWEROFF] work without problems.
But the command [!POWERTOGGLE] only switches the relay off, but not on anymore.
With [!POWERON] after [!POWERTOGGLE] the relay can be switched on again.

@jneilliii
Copy link
Contributor

@kantlivelong ?

@7R0J4Ner
Copy link

First of all, thank you guys!

Here are the Logs.
octoprint-logs.zip

What i did:
07.42.30 - [!POWERTOGGLE] to turn on Printer -Did work
07.42.52 - [!POWERTOGGLE] to turn off Printer -Did not work
07.43.09 - [!POWERTOGGLE] again to turn off Printer -Did not work
07.43.24 - [!POWERTOGGLE] again to turn off Printer -Did not work
07.43.38 - [!POWERON] to turn on Printer -Did work
07.43.57 - [!POWEROFF] to turn off Printer -Did work
07.44.17 - Tap on Sleepscreen to turn on Printer -Did work
07.44.43 - [!POWERTOGGLE] to turn off Printer -Did work

All this was done from the Octodash display via Custom Actions.

The status indicator of the relay works correctly in the interface, i.e. the flash turns green when the printer is on and gray when off.

PSU Controll Setup:
grafik

RPI-GPIO Setup:
grafik

Again, Thank you!
If you need anything else, let me know.

@kantlivelong
Copy link

@7R0J4Ner The logs indicate that that PSUControl is receiving the toggle/on/off requests and as you mentioned the UI is updating accordingly. This leaves me to believe you have an issue with your wiring or components. Many users end up purchasing 5V relays not realizing the Pi is 3.3V logic. Some 5V relays will still work but it seems to be a toss in the air. I'd suggest posting your issue on the OctoPrint forum with details about config, components, and wiring.

@7R0J4Ner
Copy link

I know the problem with the relays and have therefore tried several.
I am actually pretty sure that it is not the hardware.
The relay responds without problems when I control it via the commands [!POWERON] & [!POWEROFF].
Also it is addressed with the 1st use of the command [!POWERTOGGLE], only all further executions of [!POWERTOGGLE] have no more effect.

Is it possible to send the command [!POWERTOGGLE] via the Octoprint terminal or ssh?
Simply using [!POWERTOGGLE] in the Octoprint Terminal did not work.

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

5 participants