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
en:vu8c_backlightcontrol [2017/05/01 10:19]
codewalker
en:vu8c_backlightcontrol [2017/06/09 15:39] (current)
codewalker
Line 135: Line 135:
 </​code>​ </​code>​
 ===== [ Android ] ===== ===== [ Android ] =====
- +[[en:vu_backlight_with_android|How to control ​backlight ​of the ODROID-VU5/7/7+/8C]]
- +
-==== 1. Download script ==== +
- +
-First, set the root filesystem writable using remount command. +
-<​code>​ +
-# su +
-# mount -o rw,​remount ​ / +
-</​code>​ +
- +
-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 make its permission executable +
-<​code>​ +
-# su +
-# chmod 755 /​system/​bin/​vu8c_backlight_c2_android.sh +
-</​code>​ +
- +
-  * ODROID-C2 +
-<file sh vu8c_backlight_c2_android.sh>​ +
-#!/bin/sh +
- +
-path="/​sys/​class/​gpio"​ +
- +
-echo 214 > $path/​export +
- +
-echo out > $path/​gpio214/​direction +
-echo 0 > $path/​gpio214/​value +
- +
-chown system:system $path/​gpio214/​value +
- +
-cur_stat="​On"​ +
- +
-while [ 1 ]; do +
- +
-sleep 1 +
- +
-screen_info=`dumpsys power grep "​Display Power"​` +
- +
-if [[ $screen_info == *"​OFF"​* && $cur_stat == "​On"​ ]]; then +
- echo "​monitor goes to Off" +
-backlight ​off first +
- echo 1 > $path/​gpio214/​value +
- cur_stat="​Off"​ +
-elif [[ $screen_info == *"​ON"​* && $cur_stat == "​Off"​ ]]; then +
- echo "​monitor turns back On" +
- # backlight on later +
- echo 0 > $path/​gpio214/​value +
- cur_stat="​On"​ +
-fi +
-done +
-</​file>​ +
-  * ODROID-C1/C1+ +
-<file sh vu8c_backlight_c1_android.sh>​ +
-#!/bin/sh +
- +
-path="/​sys/​class/​gpio"​ +
- +
-echo 97 > $path/​export +
- +
-echo out > $path/​gpio97/​direction +
-echo 0 > $path/​gpio97/​value +
- +
-chown system:​system $path/​gpio97/​value +
- +
-cur_stat="​On"​ +
- +
-while [ 1 ]; do +
- +
-sleep 1 +
- +
-screen_info=`dumpsys power | grep "​mScreenOn"​` +
- +
-if [[ $screen_info == *"​false"​* && $cur_stat == "​On" ​]]; then +
- echo "​monitor goes to Off" +
- echo 1 > $path/​gpio97/​value +
- cur_stat="​Off"​ +
-elif [[ $screen_info == *"​true"​* && $cur_stat == "​Off"​ ]]; then +
- echo "​monitor turns back On" +
- echo 0 > $path/​gpio97/​value +
- cur_stat="​On"​ +
-fi +
-done +
-</​file>​ +
-==== 2. Configure system init to run script on boot ==== +
-Now, you need to register the service to run this script automatically on boot time.\\ +
- +
-Add the following lines in the end of **/​system/​init.odroid.board.rc**.\\ +
-Don't forget the root filesystem should be writable as aforementioned. +
- +
-- in case of C2 +
-<​code>​ +
-# su +
-# vi /​system/​init.odroid.board.rc +
-..... +
-..... +
-service vu8c_backlight /​system/​bin/​vu8c_backlight_c2_android.sh +
-    class main +
-    user root +
-    group root +
-    oneshot +
-</​code>​ +
- +
-- in case of C1 +
-<​code>​ +
-# su +
-# vi /​system/​init.odroid.board.rc +
-..... +
-..... +
-service vu8c_backlight /​system/​bin/​vu8c_backlight_c1_android.sh +
-    class main                                 +
-    user root                                  +
-    group root                                 +
-    oneshot ​       +
-</​code>​ +
-And then, reboot the system. +
-<​code>​ +
-# reboot +
-</​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