13 March 2017

RPI Blank/Black Screen

While trying out the latest Raspbian with PIXEL on Raspberry Pi using the Window Manager I noticed that the screen would only go blank/black and never went into standby mode. Now I don't know if this has to do with my cabling setup but I am using an HDMI from the RPi with a converter to DVI into the monitor. After searching for a while I came across a few different suggestions. The following is what I feel is the simplest and most reliable mix of my findings.

The simplest and cleanest way to get the monitor in and out of standby is by using the commands below.

$ vcgencmd display_power 0
$ vcgencmd display_power 1

xscreensaver has a watch option for checking when it blanks, locks, or unblanks the screen.

#!/usr/bin/perl

my $blanked = 0;
open (IN, "xscreensaver-command -watch |");
while () {
    if (m/^(BLANK|LOCK)/) {
        if (!$blanked) {
            system "vcgencmd display_power 0";
            $blanked = 1;
        }
    } elsif (m/^UNBLANK/) {
        system "vcgencmd display_power 1";
        $blanked = 0;
    }
}

Now I'm sure there is a way to get this working at startup, but I'm not that skilled, and as this was just to tryout and temporarily play with that's as far as bothered with.

Enjoy!

wpa_supplicant.conf

Reference info for wpa_supplicant.conf:

I got tired of looking through pages of documents to find the information I mostly use for setting up wpa_supplicant.conf on my Raspberry Pi devices. So, I'm putting it here.

If you are looking for a way to setup DHCP or Static settings for your networks follow the example under ### Other Options ###.

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

#
# home network; allow all valid ciphers
network={
    ssid="home"
    scan_ssid=1
    key_mgmt=WPA-PSK
    psk="very secret passphrase"
    priority=5
}

# This will connect to any open wifi connection
# if no other connection is available.
network={
    key_mgmt=NONE
    priority=-1
}

### Other Options ###
network={
    ssid="SCHOOLS NETWORK NAME"
    psk="SCHOOLS PASSWORD"
    id_str="school"
}

network={
    ssid="HOME NETWORK NAME"
    psk="HOME PASSWORD"
    id_str="home"
}

The following is part of the ### Other Options ### setup. Edit /etc/network/interfaces with iface school inet static and iface home inet dhcp in it so it looks something like this:

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface school inet static
address 192.0.2.7
gateway 192.0.2.254
netmask 255.255.255.0

iface home inet dhcp
Related Posts Plugin for WordPress, Blogger...