And basically all you do is open a terminal, run the script, power on the VoCore, wait for it to say "Online for 0 seconds" and walk away. After the battery dies, the screen will say "OFFLINE! Recorded X seconds of activity!"
Notes/Observations:
- The script is only approximate, there are 2 variables that affect accuracy
- Batteries last longer in the "3.2V ~ 3.5V" pin. When battery dies, the green LED twinkles like a dead star
- When battery is in the "3.5V ~ 6.0V" pin, it goes into a reboot cycle when battery is low.
- This script needs to be run in the terminal on your local Linux machine, NOT the VoCore.
- The script writes to count.txt - so make one in the same directory.
- Batteries last longer when the CPU has a heat sync (I used the one that came with my BananaPi)
- The script does not work in Windows / Mac.
Requirements:
- iw
- grep
- dialog
- write access for count.txt
Before you run count.sh / If you need to reset the count:
- Code: Select all
echo -n "0" > count.txt
Making count.sh executable:
- Code: Select all
chmod +x count.sh
count.sh
- Code: Select all
#!/bin/bash
STATUS=`iw dev wlp13s0 scan | grep VoCore`
COUNT=`cat count.txt`
if [[ -z $STATUS ]] ; then
dialog --infobox "OFFLINE! Recorded $COUNT seconds of activity!" 3 50
else
echo -n `expr $(cat count.txt) + 1` > count.txt
dialog --infobox "Online for $COUNT seconds" 3 30
fi
sleep 1
sh count.sh