Auto open website on Raspberry Pi startup
I would like to credit Brian Haines with the provided information below.
You can view the original content on his site following
https://brianhaines.com/2019/01/08/auto-open-website-on-raspberry-pi-startup/
Thanks for letting me keep a copy Brian!
Visit him at https://brianhaines.com/
There are a number of resources on the Web for this, but most are outdated or take the process further than I wanted. To be clear, I don’t want to disable the Pi’s desktop or block the user from using Chrome. I just want the Pi to default to opening Chrome, full screen, to a specified Website URL.
Starting with a Raspberry Pi loaded with Raspbian as is the recommended configuration. You must be connected to the network/internet and I usually turn on SSH and VNC so I can control the device remotely. (You can enable these by clicking Menu > Preferences > Raspberry Pi Configuration > Interfaces)
Now that that is established here is what you need to do to get Chromium to open full screen to a Website of your choice. Open Terminal and type the following.
cd .config
That brings you into the hidden .config directory in the pi users home directory.
sudo mkdir -p lxsession/LXDE-pi
Sudo might not be needed here but this command creates the lxsession and LXDE-pi directories. Many of the currently available resources online assume this already exists, but it does not by default.
sudo nano lxsession/LXDE-pi/autostart
This command opens the nano text editor with a file named autostart that we will save after typing or pasting the following content.
@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
#@xscreensaver -no-splashpoint-rpi
@chromium-browser --start-fullscreen --start-maximized
https://google.com/
Change the Website URL to whatever you like.
If you don’t already know click Ctrl+X to exit the editor. You will be asked to save. Type Y and then just accept the autostart file name by clicking enter.
There is no powersave or sleep mode. Screen blanking turns the screen black after 10 min… nothing else.
To disable:
Use nano or your favorite editor:
Code: Select all
nano /home/pi/.config/lxsession/LXDE-pi/autostart
Add the following 3 lines to autostart:
Code: Select all
@xset s noblank
@xset s off
@xset -dpms
Save and exit (CTRL x Y)
-OR-
Install xscreensaver and set mode to [no blanking]
Code: Select all
sudo apt update
sudo apt install xscreensaver