PSU control sensing issue

Hi,

Am running octoprint on Orange Pi Zero 2, using system command method ON command is "gpio write 2 0" OFF command is "gpio write 2 1" all works fine as long as I use internal sensing for sensing method. Once I switch to System command sensing and set "gpio read 2", PSU thinks thank printer is always on, no matter what I write to GPIO 2 (via SSH session). When typed in SSH "gpio read 2" works absolutely fine.

Also when set sensing system command to "0" or to "1" instead of "gpio read 2" PSU reacts correctly.
Any Ideas what am I doing wrong?

thanks!

Why are you trying to use system commands to control the GPIO, and not the built-in GPIO control? Did you have an issue with that?

I am running octoprint on OrangePi Zero 2, there is no Arabian OS for this model so my kernel is below 5.5

GPIO will still work in the plugin for kernels older than 5.5, you just won't have any pull up/down resistor support. Easy to add a pull resistor in yourself (and better IMO)

Thanks for an advice so I use wPi pin 2 whit is GPIO 73, tried setting PSU Switching Method
to GPIO and put 73, but it's not working. Please advise what am I doing wrong.

Do I get it right that resister is only needed for it to be stable, but testing can be done without the resistor? Also what value resistor is recommended to use, and is it better to connect it to 3V or to Ground?

root@Climber7:~# gpio readall
 +------+-----+----------+------+---+  Zero 2  +---+------+----------+-----+------+
 | GPIO | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | GPIO |
 +------+-----+----------+------+---+----++----+---+------+----------+-----+------+
 |   73 |   2 |      PC9 |  OUT | 0 |  7 || 8  | 0 | ALT2 | TXD.5    | 3   | 226  |

thanks!

Would need logs.

Also, set to internal sensing and flip it on then rerun gpio readall to see if V changes.

Just solved (more or less) this issue on my setup.
The problem is that "gpio read 2" doesn't return 0 or 1 as result of function call. It is just echoes status and returns 0 as execution result.
Simple shell script will help you:


#!/bin/sh
return $(gpio read 2)

Than you need to make it executable and write full path to it as system command in plugin config.