Delayed response to Pwron pin

Post Reply
malcolm lear
Posts: 2
Joined: Wed Dec 11, 2019 8:15 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Delayed response to Pwron pin

Post by malcolm lear »

Hi,
I'm working on a XU4 project that requires dual functionality for the power button. This would require that the pwron pin to the XU4 only responds to a logic high that exceeds a fixed period on time, for example 1 second. This only needs implementing for power off. I could solve this in hardware, but would great if done at the OS level. Hope someone can help.
Cheers,
Malcolm

mad_ady
Posts: 9095
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 597 times
Been thanked: 584 times
Contact:

Re: Delayed response to Pwron pin

Post by mad_ady »

You can!
Disable the poweroff action from /etc/systemd/ something (I forgot where), and then use this multibutton program that listens to keypresses and can do various actions: https://github.com/mad-ady/multibutton
These users thanked the author mad_ady for the post:
odroid (Thu Dec 12, 2019 9:46 am)

malcolm lear
Posts: 2
Joined: Wed Dec 11, 2019 8:15 pm
languages_spoken: english
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Delayed response to Pwron pin

Post by malcolm lear »

Thanks for pointing me in the right direction. I've sorted the problem by editing \etc\systemd\login.conf and making active the HandlePowerKey=ignore
Switching on can still be achieved using the pwron pin but switching off is deactivated and can be done in software with system("poweroff")
Cheers,
Malcolm

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 3 guests