Turn off the LCD screeen at night

Post Reply
crazyquark
Posts: 336
Joined: Thu Jan 15, 2015 4:22 pm
languages_spoken: english, french, romanian
ODROIDs: C1,C1+,C2,HC1,XU4
Has thanked: 3 times
Been thanked: 16 times
Contact:

Turn off the LCD screeen at night

Post by crazyquark »

I wrote 2 small scripts to turn off the LCD at night because well, light pollution sucks.

I instrument it using crontab as such:

Code: Select all

0 8 * * * /path/to/lcd_on.sh
0 22 * * * /path/to/lcd_off.sh
The ON script is:

Code: Select all

#!/bin/bash
echo 0 > /sys/class/backlight/*/bl_power
And the OFF script is:

Code: Select all

#!/bin/bash
echo 1 > /sys/class/backlight/*/bl_power
You can combine the 2 in one script and pass 0 or 1 as a param but I was too lazy.

User avatar
rooted
Posts: 7974
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 724 times
Been thanked: 243 times
Contact:

Re: Turn off the LCD screeen at night

Post by rooted »

That's a pretty cool idea.

crazyquark
Posts: 336
Joined: Thu Jan 15, 2015 4:22 pm
languages_spoken: english, french, romanian
ODROIDs: C1,C1+,C2,HC1,XU4
Has thanked: 3 times
Been thanked: 16 times
Contact:

Re: Turn off the LCD screeen at night

Post by crazyquark »

Thanks!

User avatar
odroid
Site Admin
Posts: 35266
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean, Japanese
ODROIDs: ODROID
Has thanked: 1074 times
Been thanked: 821 times
Contact:

Re: Turn off the LCD screeen at night

Post by odroid »

My family would love this idea too.
Can I add your idea to our wiki page for other users?

blong
Posts: 4
Joined: Wed Jan 24, 2018 9:29 pm
languages_spoken: french english
ODROIDs: Odroid XU4
Cloudshell 2
Location: France
Has thanked: 0
Been thanked: 0
Contact:

Re: Turn off the LCD screeen at night

Post by blong »

Hi,
thanks for your code and, as you suggested, it should give something like :
(into one "CS2_LCD" script)

Code: Select all

#!/bin/bash
# usage : "CS2_LCD on" sets LCD backlight on
on_off=1
if [ "$1" != "" -a "$1" == "on" ]; then
on_off=0
fi
echo $on_off > /sys/class/backlight/fb_ili9340/bl_power

crazyquark
Posts: 336
Joined: Thu Jan 15, 2015 4:22 pm
languages_spoken: english, french, romanian
ODROIDs: C1,C1+,C2,HC1,XU4
Has thanked: 3 times
Been thanked: 16 times
Contact:

Re: Turn off the LCD screeen at night

Post by crazyquark »

odroid wrote:My family would love this idea too.
Can I add your idea to our wiki page for other users?
Yes, of course

User avatar
neal
Posts: 233
Joined: Fri Apr 14, 2017 10:02 am
languages_spoken: Korean, English
Has thanked: 8 times
Been thanked: 17 times
Contact:

Re: Turn off the LCD screeen at night

Post by neal »

Added it at wiki page
https://wiki.odroid.com/accessory/add-o ... he_example

Thanks a lot @crazyquark

crazyquark
Posts: 336
Joined: Thu Jan 15, 2015 4:22 pm
languages_spoken: english, french, romanian
ODROIDs: C1,C1+,C2,HC1,XU4
Has thanked: 3 times
Been thanked: 16 times
Contact:

Re: Turn off the LCD screeen at night

Post by crazyquark »

You're welcome :)

crazyquark
Posts: 336
Joined: Thu Jan 15, 2015 4:22 pm
languages_spoken: english, french, romanian
ODROIDs: C1,C1+,C2,HC1,XU4
Has thanked: 3 times
Been thanked: 16 times
Contact:

Re: Turn off the LCD screeen at night

Post by crazyquark »

For the record, I also turn off the blue LED at restart with:
cron:

Code: Select all

@reboot /path/to/blue_led_off.sh

Code: Select all

#!/bin/bash
echo none > /sys/class/leds/blue\:heartbeat/trigger
As you can see I have a general hate of LEDs in the night :). Wish I could also turn off the ethernet status LED. On a Pi it was possible to do that by sending some USB packages, maybe a similar approach can be found for the odroid-xu4.
My hamster hates blinking lights :P.

mad_ady
Posts: 8458
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 577 times
Been thanked: 461 times
Contact:

Re: Turn off the LCD screeen at night

Post by mad_ady »

Black insulator tape strips :)

crazyquark
Posts: 336
Joined: Thu Jan 15, 2015 4:22 pm
languages_spoken: english, french, romanian
ODROIDs: C1,C1+,C2,HC1,XU4
Has thanked: 3 times
Been thanked: 16 times
Contact:

Re: Turn off the LCD screeen at night

Post by crazyquark »

Yes, definitely an option :).

Post Reply

Return to “CloudShell”

Who is online

Users browsing this forum: No registered users and 6 guests