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/22 17:53] joy.cho [Auto shutdown Script] |
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 70%> | ||
- | Before using UPS2 on ODROID-C2, please check u-boot version. \\ | ||
- | If the version of yours is the one before Mar 18 2016, update boot loader as following. \\ | ||
- | On Ubuntu release version "ver1.2" or higher, the control routine for ups2 port will be applied. | ||
- | Click the following site to download boot loader | + | <WRAP left round important 50%> |
- | * [[http://dn.odroid.com/S905/BootLoader/ODROID-C2/c2_bootloader.tar.gz|Download]] | + | Before using UPS3 on ODROID-C2, please check u-boot version. \\ |
- | <code> | + | If the version of yours is the one before Mar 18 2016, update boot loader. \\ |
- | $ tar zxvf c2_bootloader.tar.gz | + | You can find the guide how to check and update U-Boot in the end part of this wiki page. \\ |
- | $ cd c2_bootloader | + | [ How to check and update U-Boot on ODROID-C2 ] |
- | $ ./sd_fusing.sh <device/path/of/your/card> | + | |
- | </code> | + | |
</WRAP> | </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.\\ | ||
Line 200: | 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" |