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

Button at the top of OctoPi interface stopped working #180

Closed
Arakon opened this issue Apr 16, 2021 · 39 comments
Closed

Button at the top of OctoPi interface stopped working #180

Arakon opened this issue Apr 16, 2021 · 39 comments

Comments

@Arakon
Copy link

Arakon commented Apr 16, 2021

I'm using a Mendel 90 with this wiring setup (minus the lights): https://hydraraptor.blogspot.com/2014/06/lights-camera-action.html
I'm using a Raspberry 3b, with the power on wire connected to physical pin 22/GPIO25.

After updating to PSUControl 1.0.0, the plugin stopped working for me.
After experimenting a bit, I found that GPIO25 will switch the printer on once I set it to 25 and Save, and off when I select "Invert" and save.
However, the lightning bolt button at the top of the OctoPi interface has no function at all anymore for me, only way to turn the printer on or off is to go into settings and toggle the "Invert" setting on or off.

image

@deadSoldier9
Copy link

Same for me, thank your for opening a ticket. was on bcm14 (TX UART) and thought this was the problem. Switched to BCM4(GPIO) and tried with many settings. Switching with invert button does work but not on the mentioned button on top of Octoprint GUI

@krawcu183
Copy link

I have the same issue. Relay is connected to pin 16 on RPi3b. Before update in the settings I had selected GPIO Pin 16, after update I had to change it to 23.
Lake other mentioned, the only way to switch printer is to check/uncheck invert.
Button in upper part of the main screen as well as option in the app in the phone doesn't work.
Printer do not switch off with Idle Timeout.

@oerkel47
Copy link

oerkel47 commented Apr 16, 2021

Got pretty much the same problem.

Log says this after clicking button:

octoprint | 2021-04-16 11:10:16,915 - octoprint.plugins.psucontrol - INFO - Switching PSU On
octoprint | 2021-04-16 11:10:16,915 - octoprint.plugins.psucontrol - ERROR - Invalid value type, should be bool.

@DerDingsCS
Copy link

DerDingsCS commented Apr 16, 2021

I think I managed to solve this issue.
Setup PSU Control to use PSU Control RPi.GPIO (Switching Method)
grafik
then setup PSU Control RPi.GPIO
grafik

I also switched from pin 12 to GPIO 18.

@DerDingsCS
Copy link

DerDingsCS commented Apr 16, 2021

Additional information to the post before.
It is not working
2021-04-16 13:40:08,090 - octoprint.plugins.psucontrol - INFO - Switching PSU On
2021-04-16 13:40:08,093 - octoprint.plugins.psucontrol_rpigpio - ERROR - The GPIO channel has not been set up as an OUTPUT
2021-04-16 13:40:10,438 - octoprint.plugins.psucontrol - INFO - Switching PSU Off
2021-04-16 13:40:10,440 - octoprint.plugins.psucontrol_rpigpio - ERROR - The GPIO channel has not been set up as an OUTPUT

I think I managed to solve this issue.
Setup PSU Control to use PSU Control RPi.GPIO (Switching Method)
grafik
then setup PSU Control RPi.GPIO
grafik

I also switched from pin 12 to GPIO 18.

@Arakon
Copy link
Author

Arakon commented Apr 16, 2021

Sadly, this method just allows the button to turn green, but it doesn't actually affect my printer in any way.

@kantlivelong
Copy link
Owner

I can't reproduce. Please provide the following info:

Version of OctoPrint-PSUControl

Operating System running OctoPrint

Printer model & used firmware incl. version

Link to octoprint.log with octoprnt.plugins.psucontrol set to DEBUG

Browser console logs ( See https://www.wickedlysmart.com/hfjsconsole/ )

@DerDingsCS
Copy link

I send all needed data as soon as possible, but it will take a while.
Do you run any other plugin using gpio.
I'm using Enclosure Plugin (4.13.1) and when I setup the same GPIO as output there, the toggle button works. But it seems that both plugins try to set the state. It goes on and off then.

@kantlivelong
Copy link
Owner

I do use other plugins that use RPi.GPIO including my own. Plugin works with the newer builtin GPIO and a sub plugin that maintains RPi.GPIO.

Once I get some logs I should be able to see something or have something to work from.

@franknepomuceno
Copy link

This latest version doesn't work for me either. The previous version worked like a charm. I wished this was tested more thoroughly.

@kantlivelong
Copy link
Owner

This latest version doesn't work for me either. The previous version worked like a charm. I wished this was tested more thoroughly.

Got any logs to provide or would you rather it's never fixed?

@z00mantwo
Copy link

It's happening to me too. When I press the button logs show:

2021-04-16 13:54:38,960 - octoprint.plugins.psucontrol - INFO - Switching PSU On
2021-04-16 13:54:38,961 - octoprint.plugins.psucontrol - ERROR - Invalid value type, should be bool.

I also get the following when trying the plugin

2021-04-16 13:57:16,727 - octoprint.plugins.psucontrol - INFO - Switching PSU On
2021-04-16 13:57:16,727 - octoprint.plugins.psucontrol_rpigpio - ERROR - The GPIO channel has not been set up as an OUTPUT

My power is on pin 18 (GPIO24) with a pi 4b.

@kantlivelong
Copy link
Owner

kantlivelong commented Apr 16, 2021

It's happening to me too. When I press the button logs show:

2021-04-16 13:54:38,960 - octoprint.plugins.psucontrol - INFO - Switching PSU On
2021-04-16 13:54:38,961 - octoprint.plugins.psucontrol - ERROR - Invalid value type, should be bool.

I also get the following when trying the plugin

2021-04-16 13:57:16,727 - octoprint.plugins.psucontrol - INFO - Switching PSU On
2021-04-16 13:57:16,727 - octoprint.plugins.psucontrol_rpigpio - ERROR - The GPIO channel has not been set up as an OUTPUT

My power is on pin 18 (GPIO24) with a pi 4b.

Version of OctoPrint-PSUControl

Operating System running OctoPrint

Printer model & used firmware incl. version

Link to octoprint.log with octoprnt.plugins.psucontrol set to DEBUG

Browser console logs ( See https://www.wickedlysmart.com/hfjsconsole/ )

@z00mantwo
Copy link

If I "invert" the pin I get

2021-04-16 14:02:38,731 - octoprint.plugins.psucontrol - INFO - Switching PSU Off
2021-04-16 14:02:38,731 - octoprint.plugins.psucontrol_rpigpio - ERROR - The GPIO channel has not been set up as an OUTPUT

@z00mantwo
Copy link

by playing with it a lot and not using plug. The PSU is now on and button is green.

When I press the button to turn off I get:

2021-04-16 14:04:40,740 - octoprint.plugins.psucontrol - INFO - Switching PSU Off
2021-04-16 14:04:40,740 - octoprint.plugins.psucontrol - ERROR - Invalid value type, should be bool.

and the PSU stays on.

@franknepomuceno
Copy link

This latest version doesn't work for me either. The previous version worked like a charm. I wished this was tested more thoroughly.

Got any logs to provide or would you rather it's never fixed?

Sorry @kantlivelong, my comment was uncalled for. I'll post my logs soon.

@Arakon
Copy link
Author

Arakon commented Apr 16, 2021

Version of OctoPrint-PSUControl

1.0.0

Operating System running OctoPrint

OctoPi on Raspberry Pi 3b
2021-04-16 15_22_54-Start

OctoPrint 1.5.3 - Python 2.7.13 - OctoPi 0.16.0

Printer model & used firmware incl. version

Shouldn't matter as the printer is not even connected or powered at this point, but: Mendel 90 running Marlin 2.0.7

Link to octoprint.log with octoprnt.plugins.psucontrol set to DEBUG

octoprint.log

Browser console logs ( See https://www.wickedlysmart.com/hfjsconsole/ )

Browserlog.txt

@z00mantwo
Copy link

I was able to fix things by editing /boot/config.txt and adding the following at the end:

gpio=24=op,dh

This forces the GPIO24 to be an output. PSU control button now works.

@z00mantwo
Copy link

Note above fix was with using the plugin. Does not work without plugin and change to /boot/config.txt

@z00mantwo
Copy link

Also a full pi reboot was required for /boot/config.txt change to take affect.

@kantlivelong
Copy link
Owner

@kantlivelong
Copy link
Owner

I was able to fix things by editing /boot/config.txt and adding the following at the end:

gpio=24=op,dh

This forces the GPIO24 to be an output. PSU control button now works.

You shouldn't need to do this. Revert the change and give the build linked above a try.

@Arakon
Copy link
Author

Arakon commented Apr 16, 2021

Seems to not have worked with the new version.
Updated log (also tried using the GPIO Plugin in this log):
octoprint(1).log

Also, on a side note, when installing the GPIO Plugin, Octoprint wants to refresh, but for the plugin to show up properly and work, it actually needs to restart octoprint completely.

@kantlivelong
Copy link
Owner

Seems to not have worked with the new version.

My bad, goofed on the push. Retry if you can :)

@kantlivelong kantlivelong pinned this issue Apr 16, 2021
@Zw1d
Copy link

Zw1d commented Apr 16, 2021

Raspberry Pi 4
Stopped working after update. Changed to System Command instead of GPIO (pin#3 in my case):
gpio -g write 3 1
gpio -g write 3 0

@Arakon
Copy link
Author

Arakon commented Apr 16, 2021

Seems to not have worked with the new version.

My bad, goofed on the push. Retry if you can :)

That did the trick. However, the printer now turns on automatically as soon as Octoprint starts up, while the button assumes it is turned off. So you have to press the button once to make it believe it's on, and then again to turn it off.
After that, it seems to be working as it should. Attaching updated log.

octoprint(2).log

@kantlivelong
Copy link
Owner

However, the printer now turns on automatically as soon as Octoprint starts up, while the button assumes it is turned off.

This should fix that. Hopefully that's all but 🤷

https://github.com/kantlivelong/OctoPrint-PSUControl/archive/refs/heads/issue_180_fix.zip

@Arakon
Copy link
Author

Arakon commented Apr 16, 2021

Yup, seems to work as intended now.

@kantlivelong
Copy link
Owner

Once I get a few other confirmations I'll push this out as 1.0.1.

@oerkel47
Copy link

Can confirm the button works now. "Invert sensing" option appears fixed too, since it doesn't change the output gpio state anymore.

Sensing on same Pin doesn't work for me, but I am sure thats not related to this issue here.

@kantlivelong
Copy link
Owner

Sensing on same Pin doesn't work for me, but I am sure thats not related to this issue here.

Kind of expected since the pin shouldn't be setup as both an output and an input. Really better off using Internal mode. If anything that can be enhanced.

@oerkel47
Copy link

It worked with the old method though. If you read an output, it should return the last written value. Not sure how thats implemented in Python-Periphery. If thats a different command to the one used for sensing, could you implement it?

@kantlivelong
Copy link
Owner

It worked with the old method though. If you read an output, it should return the last written value. Not sure how thats implemented in Python-Periphery. If thats a different command to the one used for sensing, could you implement it?

Opened #182 . For now use Internal for sensing.

@z00mantwo
Copy link

Okay. I took out my /boot/config.txt fix. Rebooted the pi then installed your 180 fix and everything is working now.

Thank you very much!

@oerkel47
Copy link

Opened #182 . For now use Internal for sensing.

Will do. Thanks for opening and thank you for the quick fix of this.

kantlivelong added a commit that referenced this issue Apr 16, 2021
Set initial GPIO output valued based on invertonoffGPIOPin #180
@deadSoldier9
Copy link

The fix did the trick, switched to internal sensing and it works now.

@Prizmagnetic
Copy link

Prizmagnetic commented Apr 16, 2021

I'm on PSU control 1.0.0
using pin BCM 23

I was able to get the pin to toggle when I disabled the Filament Sensors Revolutions plugin (only other thing using the GPIO)
PSU button still doesn't seem to work.

I guess I test the patch next...
[Edit] fix works, even with the filament sensor plugin

@bjhiltbrand
Copy link

I can confirm also that the fix in the zip file above works as expected.

@kantlivelong
Copy link
Owner

Version 1.0.1 has been released which addresses this.

@kantlivelong kantlivelong unpinned this issue Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests