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

BTT Pi 1.2 OS image 3.0.0 -> GPIO reset (LOW) after shutdown? #200

Open
OriginaldCrypt opened this issue Jan 24, 2025 · 1 comment
Open

Comments

@OriginaldCrypt
Copy link

OriginaldCrypt commented Jan 24, 2025

Hi,

I have a 3d printer with BTT Pi 1.2 and recently updated from 2.3.4 to 3.0.0. I use a GPIO (PI14, GPIO270, pin 33) for remote shutdown with BTT Relay v1.2 (PI14 connected to the shutdown pin at the relay). I use a Klipper shutdown configuration with PI14(LOW) = normal operation, PI14(HIGH) = shutdown. If I turn PI14 to HIGH, the relay properly shuts down the machine. However, if I shutdown the BTT Pi 1.2 via the 'shutdown' command in klipper, the relay is activated (PI14 set HIGH by the klipper configuration) but then the audible switch in the relay demonstrates that the relay is deactivated (PI14 set LOW?).

I can easily force this by creating two Klipper commands, one sets the GPIO LOW and the second one sets the GPIO HIGH. With the command:

SET_PIN PIN=power_detect VALUE=1

the system shuts down after some seconds; if I run two commands within the shutdown delay:

SET_PIN PIN=power_detect VALUE=1
<wait for 1 second>
SET_PIN PIN=power_detect VALUE=0

the audible noise of the relay is heard twice and the shutdown is cancelled.

This behaviour was not the same in v2.3.4 OS image. Is it possible that GPIO are reset (PI14 set LOW) during shutdown?

BR

EDIT: it looks like I missed information, although it was by purpose, it could be important to understand this situation. I already know that BTT relay shutdown is triggered with logical LOW state in the input and normal operation with logical HIGH. I change the logic of the input becauuse the GPIO in the BTTPi can't be set to HIGH (normal operation) during bootup, like in a MCU with klipper.

@OriginaldCrypt
Copy link
Author

OriginaldCrypt commented Mar 1, 2025

One alternative is to configure GPIO default HIGH level at boot, such as RPi I believe can do by configuring boot files (overlays?). Is this possible with BTT OS? Or is there any GPIO set HIGH by default at boot?

EDIT: no it's not. GPIOs in BTT Pi seems to work at 3.3v level (HIGH signal). That's also why I used an optocoupler for the LOW/HIGH logic inversion of the signal. The optocoupler can work at 3.3v in the input, and I switch 5v signal at the output. Still wondering how to deal with GPIO status not reset at shutdown or force HIGH state during boot with the BTT Pi

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

1 participant