Ubuntu 18.04.6 LTS
Ubuntu 18.04.6 LTS Khadas official images
I try to make robot on khadas platform. On my robot I have master power button. This button connect and disconnect USB C PD line to battery. Also I use Juice v12 Board for safety power off and emergency power. I need to switch on khadas when master button is on and I have power on USB C PD line. Also i need correctly switch off khadas (like shutdown in terminal) when master button is off and I have not power on USB C PD line.
Khadas is setup WON option. Some device in robot send WON command to khadas every minute. Khadas switch on by WON command.
I wrote script in python. this script look at
/sys/class/power_supply/bq25700-charger/online and write to terminal
How can I make my system more correct? I will to switch on and off by USB C PD. I need switch off regularly like