Setting up a Raspberry 3+ to automatically display a website at startup.

I will use a Raspberry Pi 3+ with a touch screen to display the most important data of my Home Assistant installation. This guide will work for most other sites as well.

The following hardware is used:

Prerequisites:

  • Basic Linux knowledge
    • How to connect to your Raspberry via SSH
    • How to update your System

How to attach the screen to the Raspberry:

Since it is not the original screen I will attach a picture on how to connect the wires to the Raspberry pi +, if the colors don’t match just make sure you connect SDA or SCL to its counterpart on the board.

Installing the OS

  1. Install Noobs or Raspberry Pi OS on your Raspberry Pi 3+. Noobs is the easiest if you are new to Raspberry Pi.
    1. Download the Pi Imager for Windows
    2. Download Noobs latest
    3. Flash the SDCard with the Pi Imager
    4. Open the SDCard and create a ssh (empty) file in the root directory (to enable SSH)
    5. Put the SDCard into your Raspberry, boot it.
    6. Follow the instructions on screen.
  2. Or just follow the instructions here: https://www.raspberrypi.org/downloads/ but don’t forget to add the ssh file into your root directory.

Autostart your Browser

Edit the file autostart with “nano /etc/xdg/lxsession/LXDE-pi/autostart” and add the line, on never version you need to use this folder, otherwise, it will destroy your desktop GUI.

nano /etc/xdg/lxsession/LXDE-pi/autostart
@chromium-browser --incognito --start-fullscreen --app=http://YourURL

Turning the screen

Before finishing your setup you might need to turn the screen rotation.

This is done in the file boot/config.txt open it with sudo nano /boot/config.txt and add the following line at the end of the file.

In my case, it was lcd_rotate = 2 if you have another orientation look it up in this table. For the Pi +3 and this screen make sure you use lcd_rotate and not display_rotate.

lcd_rotateresult
0no rotation
1rotate 90 degrees clockwise
2rotate 180 degrees clockwise
3rotate 270 degrees clockwise

Installing an onscreen keyboard:

For emergency reasons, you want to have a virtual keyboard for your touchscreen. In case you have no keyboard at hand, this could be very handy.

sudo apt install matchbox-keyboard

To open the keyboard from the full-screen website just tap and hold any point and leave the full-screen mode. You will find your virtual keyboard under Menu -> Accessories-> Keyboard.

Leave a Reply

Powered by WordPress.com.

Up ↑

%d bloggers like this: