Skip to content

Commit

Permalink
[script] fix wake up script for 0.2.1-1
Browse files Browse the repository at this point in the history
Custom setups that don't have the bl_power for the touchscreen bl
were not able to wake up after sleep because of the assumption
that the bl_power file is there. This forces the pi to enable
display regardless if that file wasn't found.
  • Loading branch information
htruong committed Apr 1, 2018
1 parent d04b2fa commit 8785553
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions precompiled/opt/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,6 @@ chown pi:pi /tmp/.local
chown pi:pi /tmp/.config
chown pi:pi /tmp/openauto.ini

/sbin/shutdown --poweroff 15

exit 0
11 changes: 8 additions & 3 deletions precompiled/opt/wake_up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@

# we need to probe the value of the bl_power first
# to not wake up the screen if it's already up
BL_PWR=`cat /sys/class/backlight/rpi_backlight/bl_power`

if [ ${BL_PWR} -ne 0 ]; then
if [ -f /sys/class/backlight/rpi_backlight/bl_power ]; then
BL_PWR=`cat /sys/class/backlight/rpi_backlight/bl_power`

if [ ${BL_PWR} -ne 0 ]; then
vcgencmd display_power 1
echo 0 > /sys/class/backlight/rpi_backlight/bl_power
fi
else
vcgencmd display_power 1
echo 0 > /sys/class/backlight/rpi_backlight/bl_power
fi

0 comments on commit 8785553

Please sign in to comment.