0

I have Ubuntu Mate installed on RPi3 with official 7" screen.

I was changing screen brightness through Mate's GUI where I dragged the bar too much towards the dark side... Resulting BLACK LCD!!!

How can I revert this? I can remove the microSD and mount it, but not sure where settings are stores (directory /sys is empty when I mount through Windows).

Any ideas?

  • 1
    "directory /sys is empty when I mount through Windows" -> Yes, it's just a mount point for a kernel interface. The file nodes inside while the system is running are abstractions; they aren't stored anywhere (note usually the size is 0). – goldilocks Dec 29 '16 at 9:09
2

You could simply insert the SD card back in your RPi and try to get a signal over SSH or normal HDMI. After that you can activate the backlight with

echo 0 > /sys/class/backlight/rpi_backlight/bl_power

I don't know if this also works with ubuntu mate, but it worked with raspbian.

  • 2
    As a note for people unfamiliar with sysfs, this will only work while the system is up and running. – goldilocks Dec 29 '16 at 9:07
  • This is why I mentioned that when I mount my SD card on other device it is displaying /sys as an empty folder. – HelpNeeder Dec 29 '16 at 16:46
0

This is how I check brightness level AFTER login, which is not perfect... But my device does perform auto login functionality. To make this work I must edit /etc/sudoers.d file like so:

user ALL=(root) NOPASSWD: /home/user/Desktop/scripts/brightness.sh

And following scripts into my Startup applicaitons:

#!/bin/bash

if [ $EUID -ne 0 ]; then
    printf 'Script requires root...\n\r'
else
    path='/sys/class/backlight/rpi_backlight/'
    min=10
    max=$(< ${path}'max_brightness')
    value=$(< ${path}'brightness')

    if [ $# -ne 0 ]; then # setting value
        input=$1

        if [ $input -eq $input ] 2>/dev/null; then
            # checking for min
            if [ $input -lt $min ]; then
                input=$min
            fi

            # checking for max
            if [ $input -gt $max ]; then
                input=$max
            fi

            printf "\n\rChanging brightness to: ${input}\n\r\n\r"       
            ( echo $input | sudo tee ${path}brightness ) > /dev/null
        else
            printf '\n\rIncorrect input...\n\r\n\r'
        fi
    else # repairing black screen
        if [ $value -lt  $min ]; then
            printf '\n\rValue is too low... Increasing brightness to: '

            ( echo $max | sudo tee ${path}brightness ) > /dev/null

        else
            printf 'Brightness ok...\n\r'
        fi
    fi
fi

exit 0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.