We're no longer updating This wiki!!

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
en:vu8c_backlightcontrol [2017/01/13 13:44]
joy.cho [2. Configure Init to run script on boot]
en:vu8c_backlightcontrol [2017/03/20 09:46]
codewalker [1. Download script]
Line 1: Line 1:
 ====== VU8C Backlight On/Off Control by Monitor Status ====== ====== VU8C Backlight On/Off Control by Monitor Status ======
 This wiki page describes the way how to control vu8c backlight on/off when monitor status is triggered by controlling the related GPIO ports.\\ This wiki page describes the way how to control vu8c backlight on/off when monitor status is triggered by controlling the related GPIO ports.\\
-So far, Ubuntu is available with the following scheme and we're investigating it on Android platform now.+
  
  
Line 147: Line 147:
 ===== [ Android ] ===== ===== [ Android ] =====
  
-On Android, we are investigating how to control and run auto control scheme. \\ 
-As soon as it's done, we will make the instruction guide here. 
- 
-(UNDER CONSTRUCTION!!!) 
  
 ==== 1. Download script ==== ==== 1. Download script ====
Line 162: Line 158:
 Make or download the following shell script of the board model that you're using (C1 or C2)\\ Make or download the following shell script of the board model that you're using (C1 or C2)\\
 and copy it in **/​system/​bin/​**.\\ and copy it in **/​system/​bin/​**.\\
-And set its permission.+And make its permission ​executable
 <​code>​ <​code>​
 # su # su
Line 182: Line 178:
 echo 0 > $path/​gpio214/​value echo 0 > $path/​gpio214/​value
  
-chown system system $path/​gpio234/​value +chown system:system $path/​gpio234/​value 
-chown system system $path/​gpio214/​value+chown system:system $path/​gpio214/​value
  
 cur_stat="​On"​ cur_stat="​On"​
Line 222: Line 218:
 echo 0 > $path/​gpio108/​value echo 0 > $path/​gpio108/​value
  
-chown system system $path/​gpio97/​value +chown system:system $path/​gpio97/​value 
-chown system system $path/​gpio108/​value+chown system:system $path/​gpio108/​value
  
 cur_stat="​On"​ cur_stat="​On"​
Line 231: Line 227:
 sleep 1 sleep 1
  
-screen_info=`dumpsys power | grep "Display Power"`+screen_info=`dumpsys power | grep "mScreenOn"`
  
-if [[ $screen_info == *"OFF"* && $cur_stat == "​On"​ ]]; then+if [[ $screen_info == *"false"* && $cur_stat == "​On"​ ]]; then
  echo "​monitor goes to Off"  echo "​monitor goes to Off"
  echo 1 > $path/​gpio97/​value  echo 1 > $path/​gpio97/​value
  echo 1 > $path/​gpio108/​value  echo 1 > $path/​gpio108/​value
  cur_stat="​Off"​  cur_stat="​Off"​
-elif [[ $screen_info == *"ON"* && $cur_stat == "​Off"​ ]]; then+elif [[ $screen_info == *"true"* && $cur_stat == "​Off"​ ]]; then
  echo "​monitor turns back On"  echo "​monitor turns back On"
  echo 0 > $path/​gpio108/​value  echo 0 > $path/​gpio108/​value
Line 246: Line 242:
 done done
 </​file>​ </​file>​
- +==== 2. Configure ​system init to run script on boot ====
-==== 2. Configure ​Init to run script on boot ====+
 Now, you need to register the service to run this script automatically on boot time.\\ Now, you need to register the service to run this script automatically on boot time.\\
  
Line 255: Line 250:
 - in case of C2 - in case of C2
 <​code>​ <​code>​
 +# su
 # vi /​system/​init.odroid.board.rc # vi /​system/​init.odroid.board.rc
 ..... .....
 ..... .....
 service vu8c_backlight /​system/​bin/​vu8c_backlight_c2_android.sh service vu8c_backlight /​system/​bin/​vu8c_backlight_c2_android.sh
-    class main                                 +    class main 
-    user root                                 ​ +    user root 
-    group root                                 +    group root 
-    oneshot ​      ​+    oneshot
 </​code>​ </​code>​
  
 - in case of C1 - in case of C1
-<​code>​>+<​code>​ 
 +# su
 # vi /​system/​init.odroid.board.rc # vi /​system/​init.odroid.board.rc
 ..... .....
Line 275: Line 272:
     group root                                ​     group root                                ​
     oneshot ​           oneshot ​      
 +</​code>​
 +And then, reboot the system.
 +<​code>​
 +# reboot
 </​code>​ </​code>​
en/vu8c_backlightcontrol.txt · Last modified: 2017/06/09 15:39 by codewalker
CC Attribution-Share Alike 3.0 Unported
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0