Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
en:odroid-ups2 [2016/03/21 16:49] ruppi [ODROID-C1] |
en:odroid-ups2 [2016/04/21 13:18] joy.cho [ODROID-C1/C2] |
||
---|---|---|---|
Line 125: | Line 125: | ||
The BAT_OK and AC_OK signals are used in the below simple shell script which runs in the background via crontab. | The BAT_OK and AC_OK signals are used in the below simple shell script which runs in the background via crontab. | ||
+ | |||
+ | <WRAP left round important 50%> | ||
+ | Before using UPS3 on ODROID-C2, please check u-boot version. \\ | ||
+ | If the version of yours is the one before Mar 18 2016, update boot loader. \\ | ||
+ | You can find the guide how to check and update U-Boot in the end part of this wiki page. \\ | ||
+ | [ How to check and update U-Boot on ODROID-C2 ] | ||
+ | </WRAP> | ||
==== Auto shutdown Script ==== | ==== Auto shutdown Script ==== | ||
This script checks the status of power and battery.\\ | This script checks the status of power and battery.\\ | ||
Save the following code as ups2.sh in home directory.\\ | Save the following code as ups2.sh in home directory.\\ | ||
- | Note that this script can be used with U3 as well as C1 without modification.\\ | + | Note that this script can be used with U3 as well as C1/C2 without modification.\\ |
<code> | <code> | ||
#!/bin/sh | #!/bin/sh | ||
Line 186: | Line 193: | ||
if [ $retval -eq 0 ] | if [ $retval -eq 0 ] | ||
then | then | ||
- | echo "battery is low than 3.7V" | + | echo "battery is lower than 3.7V" |
- | if test $MODEL = "ODROID-C2" | + | /sbin/shutdown -P 1 |
- | then | + | |
- | /sbin/poweroff | + | |
- | else | + | |
- | /sbin/shutdown -P 1 | + | |
- | fi | + | |
else | else | ||
echo "battery is good" | echo "battery is good" |