0

I can't find any additional information online, so I'll try to ask it directly. I would like to put the Raspberry Pi 4 (with Lineage OS) in a case and be able to turn it on and off using just one button. Powering down is easy, but waking up is not.

I'm also using an AMP HAT, which utilizes the I2C lines. The problem is, that the GPIO3, which would be capable of waking up the Pi from Halt, is also used for I2C (terrible design decision to put the wake pin on GPIO3 btw...).

My next idea was to use a switch with two separate connections. One would pull down a GPIO for shutdown and another for waking up. But again, GPIO3 is used for I2C, pressing the button would probably interfere with I2C. If RUN and GLOBAL_EN are grounded when the OS runs, it just tun off everything. So it can't be used in the same switch.

Is there any additional way of waking up the Pi without unplugging it?

6
  • " The problem is, that the GPIO3, which would be capable of waking up the Pi from Halt, is also used for I2C (terrible design decision to put the wake pin on GPIO3 btw...)." It is actually a good idea; what problems do you ACTUALLY have? NOTE this does NOT turn ANYTHING off - just shuts the OS down the SOC continues to run which is why restart works.
    – Milliways
    Commented Nov 10, 2023 at 12:09
  • GPIO3 is also I2C. So if you are using I2C in your project, GPIO3 is not available as GPIO anymore and thereby also not for waking up. At least not without possible interference.
    – Max Power
    Commented Nov 10, 2023 at 12:24
  • The solution for my problem would be Wake from Halt using GPIO different from 3.
    – Max Power
    Commented Nov 10, 2023 at 12:25
  • If you want something other than GPIO3 you are out of luck because this is coded into the video core.
    – Milliways
    Commented Nov 10, 2023 at 21:01
  • You can use GPIO3 for restart even if you are also using I²C. Have you ACTUALLY tried it?
    – Milliways
    Commented Nov 10, 2023 at 21:03

1 Answer 1

0

"if you are using I2C in your project, GPIO3 is not available as GPIO".

Well, yeah... there's a reason for that, and it's b/c GPIO3 has a pullup connected on the board - which as you know is necessary for I2C.

If you were running RPi OS (instead of Lineage OS), this would be an easy problem to solve; i.e. just use a different set of pins for I2C.

As it is, most of us here have no experience with Lineage OS, and we're not inclined to spend a lot of time researching it to learn enough to try to help you.

My suggestion is to install RPi OS, and learn how to overcome this issue natively. Then perhaps, with your knowledge of Lineage OS, you can apply what you've learned there.

5
  • How to overcome this issue natively? Wake up by GPIO3 is hardcoded in the bootloader. And I2C with Pin 5 is used by the Amp-HAT.
    – Max Power
    Commented Nov 10, 2023 at 16:39
  • @MaxPower: If GPIO3 is hardcoded in the bootloader, then AFAIK the "native" way won't help you. I suspect that you have fundamental diffs in your chosen OS that are incompatible with RPi OS... e.g. the device tree, and all of the overlays that are applied thereto.
    – Seamus
    Commented Nov 10, 2023 at 17:42
  • @Seamus can you actually explain how to achieve what the OP wants, assuming Raspberry Pi OS, because it's NOT possible. You say "use a different set of pins for I2C" ... so, that would entail hardware modification to the AMP HAT. Or did I miss something from the question or this answer? See, I want the same thing. I MUST use GPIO2/3 for I2C because my HAT uses those pins for I2C - but I also want to use a single button for "poweroff"/on (yes, I know it's not actually power off, hence the ") Commented Nov 11, 2023 at 1:20
  • @JaromandaX: If you say it's not possible, then perhaps it's not.
    – Seamus
    Commented Nov 11, 2023 at 3:02
  • @Seamus - that's not what I said - I was sort of hoping it was! Commented Nov 11, 2023 at 3:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.