Disable Raspbian to get black screen after 10 minutes

So when i was setup a Raspberry Pi on a TV to show a webpage i find that Raspbian haved some kind of timeout that was making the TV to go dark after 10 minutes.

After a while searching i find that there is differents way to fix this in differnt versions but i run Raspbian Buster in the beginning of february 2020 and i tested a lot of things before i got it to not be black screen after 10 minutes.

To fix this you need to edit the file named /etc/xdg/lxsession/LXDE-pi/autostart with your chose of text editor and i change it to look like:

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xset s noblank
@xset -dpms s off

The two first lines is default lines to get the desktop to start but the last two is to disable the black screen that shows up after 10 minutes.

In the default file there is a line about xscreensaver that i removed.

Reboot the Raspberry Pi and wait and now i should not be black screen anymore.

Raspberry Pi – Show website in fullscreen on TV

A client was like to show some images on a TV and i try to find a good solution with Raspberry Pi and after tested some i selected to go with setup a Raspberry Pi with Raspbian open up a Chromium webbrowser in fullscreen mode on startup.

This sounds easy but there was a couple of things i find out on the way to get a stable and working version of this project.

The webpage i built my self and not going to include in this post i only whant to write down what i find around Raspbian and the setup to get all stable.

Here is the different steps to setup Raspbian right:

1. Wifi setup

I used a Raspberry Pi 3 B+ with built in wifi but to get it up on the wifi without any keyboard i configure the wifi setup on the SD-Card.

Read my old post about this here.

2. Enable SSH

Read my old post about this here.

3. Clean up Raspbian

The non-lite version of Raspbian comes with quite a few things that are not needed for a Kiosk-style display which bloat the install.

They can be removed, after which an autoremove will take care of any dangling dependencies:

sudo apt-get remove --purge wolfram-engine scratch nuscratch sonic-pi idle3 smartsim java-common minecraft-pi python-minecraftpi python3-minecraftpi libreoffice python3-thonny geany claws-mail bluej greenfoot

sudo apt-get autoremove

4. Ensure everything is up-to-date

Run this commands to make sure your raspbian is up-to-date:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

5. Install Chrome and unclutter

We need chromium-browser as well as unclutter (to hide the cursor).

sudo apt-get install unclutter chromium-browser

6. Automatically start Chrome and disable black screen shows up after 10 minutes

Change the file ~/.config/lxsession/LXDE-pi/autostart to look like:.

@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xset s noblank
@xset -dpms s off

@sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' ~/.config/chromium-browser Default/Preferences
@chromium-browser --noerrdialogs --kiosk http://www.google.com --incognito --disable-translate

The first 2 lines is to get the desktop to start.

The 3th and 4th line is to disable black screen after 10 minutes

The 5th line is to ensures chromium thinks it shut down cleaning, even if it didn’t to prevent tab restore warnings.

The 6th line is to start the chromium webbrowser and to set wish URL Chromium should show.

7. How to disable “Translate page”-dialog

I write in the beginning of this post that i dont going to get in to the page i was showing but there is a tip i like to give, i was getting a “Translate page”-dialog everytime i rebooted the Raspberry Pi.

The only way i find that worked for me was to add a meta tag in the html code to disable it:

<meta name="google" content="notranslate">

Now we are done

Now you have a working Raspberry Pi that on startup shows a website in chromium full screen (kiosk mode).

Reboot the raspberry pi and let it run.

 

How to activate SSH on Rasbian for Raspberry Pi from first boot?

I have a Raspberry Pi Zero Wireless that i have got to connect to my wifi direct on first bott (see this post) and then i liked to get the SSH activated from the first boot also.

After some searching i find out that you can put a file named ssh without any file extension in the boot partition.

Raspbian then going to activate SSH on the first boot so no need to put in any keyboard and monitor to activate it.

The content of the file doesn´t matter, it could contain either text or nothing at all.

How to get a Raspberry Pi Zero Wireless to connect to wifi automaticly on first boot

Raspberry Pi Zero Wireless is a very nice Internet of Things computer but its only has mini-hdmi and micro-usb connectors wish make it not so easy to connect to configure to get it up on wifi but after som research i find out that it is possible to configure it to connect to wifi from the first boot of Rasbian.

Rasbian has built in that it copy wifi details from /boot/wpa_supplicant.conf into /etc/wpa_supplicant/wpa_supplicant.conf to automatically configure wireless network access.

If a wpa_supplicant.conf file is placed into the /boot/ directory, this will be moved to the /etc/wpa_supplicant/ directory the next time the system is booted, overwriting the network settings; this allows a Wifi configuration to be preloaded onto a card from a Windows or other machine that can only see the boot partition.

Since the /boot partition is accessible by any computer with an SD card reader, wifi configuration is now much simpler.

A skeleton wpa_supplicant.conf file can be as little as:

network={
ssid=”YOUR_SSID”
psk=”YOUR_PASSWORD”
key_mgmt=WPA-PSK
}

If you use WPA2-Personal settings with AES you can set the config file to have this text:

network={
ssid=”Your SSID Here”
psk=”YourPresharedKeyHere”
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
}

I can also recommend to read my post of how to activate the SSH on first boot, click here.