Hello,
i want to power the module by an external power supply to have a portable solution.
I have a microcontroller ready that watches battery volts and has a button that should be used to power up and shut down the device.

On pressing it wakes up from sleep and wakes the step up converter that supplies power to the NanoPi Duo2 which does its job nicely.
To shut down i need to press the button on the pi, which is not available on any pin and then need to watch for the red LED: if it's off i can shut off the converter so my battery power is conserved.

For cosmetic reasons (and simplicity of use) i only want to use the one button i already have and connect the pi button and LED as logic signals to my battery controller, which then can signal the pi to shutdown and wait for "the LED" to turn off, cutting power to the pi.
How can i get a GPIO'd shutdown and "system active" signal?
I am an electronics engineer, but linux is a far away island for me... I am using the standard 4.14 ubuntu for it.

I have tried stuff with services and scripts to use the gpio, but those shut off the LED signal too early (my Signal is off for like 5 seconds before the onboard LED cuts off, i can't get it to stay on for longer) and need a shell script that checks gpio in a loop to issue the shutdown command. I believe the constant looping script adds CPU load and increases power consumption...
All while looking at the nanopi's onboard button and LED which are exactly what i need...

No, desoldering the parts is no option... ;)

Regards
Jens