There is no more that topic in that forum. Well, i saved this scripts to my computer. May be it will useful for somebody.
First, make a file ignition.sh, consist of these strings:
#!/system/bin/sh
Set up GPIO 4 and set to input
echo "17" > /sys/class/gpio/export
echo "in" > /sys/class/gpio/gpio17/direction
#Main code
while :
do
#check status of ignition pin
is=cat /sys/class/gpio/gpio17/value
Check if GPIO status is same as display
if [ "$is" != "$(dumpsys power | grep -c "Display Power: state=ON")" ]
then
echo "diff"
if [ x"$is" = x"0" ]
then
input keyevent 223
fi
if [ x"$is" = x"1" ]
then
input keyevent 224
fi
fi
sleep 3
done
And, you should put this file to /data/data, and set permissions 777 to it.
Next, make a file "start_ignition", consist of
#!/system/bin/sh
BEGIN INIT INFO
Exec: boot
Type: permanent
END INIT INFO
/system/bin/sh /data/data/ignition.sh </dev/null >/dev/null 2>&1
And you should put it to /data/init.d/
You must connect GPIO4 to + 3.3V, when need to run, and to ground, when you need to shutdown.
p.s. sorry for my english
p.p.s. - I used this on Asus TinkerBoard with TinkerOS Android, it works, but need to change GPIO numbers.
p.p.p.s:
Original text from that forum was:
/////////
You can find my script here.
http://adgj.se/ignition.sh
I have put it under /data/data/
Then under /data/init.d/ I have put this to start up the script
http://adgj.se/start_ignition
Hardware wise i have a relay that short circuits GPIO 4 with ground when not active.
//////