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

Unread post by malcolm lear » Wed Dec 11, 2019 9:03 pm

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

User avatar
mad_ady
Posts: 7090
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 305 times
Been thanked: 209 times
Contact:

Re: Delayed response to Pwron pin

Unread post by mad_ady » Wed Dec 11, 2019 9:28 pm

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

Unread post by malcolm lear » Thu Dec 12, 2019 6:24 am

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: Baidu [Spider] and 1 guest