Auto open browser on boot


16 posts
by 16vmonkey » Wed Jun 13, 2012 12:57 pm
Hi all,

I've been tasked a small project... A sales office wants to use a Pi as a information dashboard up on the wall which involves it just displaying a webpage hosted locally.

I need the Pi to automatically boot, open a browser full screen (F11 stylee) and point to a page.

I would be very grateful for any input!

Mike.
Posts: 4
Joined: Wed Jun 13, 2012 12:54 pm
by bredman » Wed Jun 13, 2012 1:09 pm
To launch a command automatically on login, put the command into a file named
.bashrc
in the user directory (for example /home/pi)

For example, the file could contain
chromium-browser --kiosk www.google.com
to launch Chromium in full-screen pointed to www.google.com
Posts: 1413
Joined: Tue Jan 17, 2012 2:38 pm
by 16vmonkey » Wed Jun 13, 2012 1:47 pm
fantastic, worked a treat :)

Thank you!
Posts: 4
Joined: Wed Jun 13, 2012 12:54 pm
by 16vmonkey » Wed Jun 13, 2012 1:55 pm
PM received thanks Bredman, it wont let me reply as I assume i'm a new user. Will keep you posted.
Posts: 4
Joined: Wed Jun 13, 2012 12:54 pm
by cyanarnofsky » Fri Nov 02, 2012 7:04 pm
exactly what I need as well!, possible to disable mouse courser from the system completely? I can use all keyboard commands and this would remove it from showing up onscreen when restarted. Thanks for any help!
Posts: 68
Joined: Tue Jul 31, 2012 11:33 pm
by Super-Nathan » Wed Nov 07, 2012 2:40 am
Frankly your best bet would be to install openbox and have openbox open the bowser for you. this would give you a fullscreen webbrowser with NOTHING else. no statusbar, no time, no startmenu, nothing but the browser.

Code: Select all
sudo aptitude install openbox obconf obmenu


and then make a openbox config file with

Code: Select all
mkdir -p ~/.config/openbox && cp /etc/xdg/openbox/* ~/.config/openbox


Then edit the autostart to openthe browser at boot

Code: Select all
nano ~/.config/openbox/autostart


remove all the code and past this in:

Code: Select all
# Autostart script
#will sleep to make sure everything else loads
sleep 5s && midori  --inactivity-reset=120 -e Fullscreen --app=/PATH/TO/HOMEPAGE/FILE.html


that will make it run with fewer options auto resetting after 2 minutes inactivity
echo "Something Useful" > /dev/null
User avatar
Posts: 67
Joined: Sun Jun 17, 2012 6:56 am
Location: South Korea
by Super-Nathan » Wed Nov 07, 2012 2:42 am
bredman wrote:To launch a command automatically on login, put the command into a file named
.bashrc
in the user directory (for example /home/pi)

For example, the file could contain
chromium-browser --kiosk http://www.google.com
to launch Chromium in full-screen pointed to http://www.google.com



Chromium is MUCH to slow to browse comfortably on the pi,especially with lxde overhead which you do not need. you WILL see speed increases with openbox/midori!
echo "Something Useful" > /dev/null
User avatar
Posts: 67
Joined: Sun Jun 17, 2012 6:56 am
Location: South Korea
by coolblue2000 » Wed Jan 09, 2013 3:46 pm
To launch a command automatically on login, put the command into a file named
.bashrc
in the user directory (for example /home/pi)

For example, the file could contain
chromium-browser --kiosk www.google.com
to launch Chromium in full-screen pointed to www.google.com


I have done this but it does not recognise chromium-browser.... I changed it to simply chromium instead but I get the error (chromium:2100): Gtk-WARNING **: cannot open display:

If I set the pi to boot in to the GUI on startup then it gets to the GUI without opening chromium but if I try to open the terminal suddenly the pi starts chromium in kiosk mode.......

What am I doing wrong?
Posts: 30
Joined: Tue Jan 08, 2013 9:48 am
by sdjf » Mon Jan 14, 2013 4:45 am
Try putting the following line just before the one invoking your browser.

export DISPLAY=:1

The line you had which created an error is probably the right command. I am not sure whether 1 is the right display number, but I have the above line in my .bashrc on a host box I VNC into, so I can start GUI apps from command line when I want to.

Since it is coming back with :2100 in your error message, you might try display number :0

Also, I would be concerned about starting the app from your .bashrc and not ending the line with an ampersand so that .bashrc can finish any other things you might place there in addition, after calling the browser. Otherwise, .bashrc will not close until you close chromium.
FORUM TIP: To view just one person's posting history, sign in, click on their user name, then click on "Search User's Posts." || This Pi owner is running Arch on 512MB Model B.
Posts: 1304
Joined: Fri Mar 16, 2012 5:20 am
Location: California
by coolblue2000 » Mon Jan 14, 2013 12:45 pm
I have tried export DISPLAY=:1 and export DISPLAY=:0

Both give me the error "Cannot open display:1" or "Cannot open display:0"
Posts: 30
Joined: Tue Jan 08, 2013 9:48 am
by sdjf » Mon Jan 14, 2013 4:45 pm
coolblue2000 wrote:I have tried export DISPLAY=:1 and export DISPLAY=:0

Both give me the error "Cannot open display:1" or "Cannot open display:0"


I hope somebody can solve that, I get the same thing when I try to open a VNC server on my Pi, so do not know the answer at this point.
FORUM TIP: To view just one person's posting history, sign in, click on their user name, then click on "Search User's Posts." || This Pi owner is running Arch on 512MB Model B.
Posts: 1304
Joined: Fri Mar 16, 2012 5:20 am
Location: California
by coolblue2000 » Fri Jan 18, 2013 12:31 pm
Ok, I have got it working. It seems you can't start chromium from bash as it there is no gui so fails.

I got chromium to start on boot by adding "@chromium --kiosk www.bbc.co.uk" to the "autostart" file in /etc/xdg/lxsession/LXDE/


One problem though.....

On my home pi this works fine (not going through a proxy at home), however on the one at work chromium complains that it can not connect to the proxy server.

The proxy is setup on the pi and if I start Chromium from the desktop it works fine, also if I start chromium from terminal using "Chromium --kiosk www.bbc.co.uk" it also works fine.

Why is it complaining about the proxy server when it is started from the autostart file? And is there a way to specify the proxy in the "@chromium --kiosk www.bbc.co.uk" line?

Also if I autostart with the following line @chromium www.bbc.co.uk

ie not in kiosk mode so I have access to the menus, the same thing happens, but if I click refresh it works fine.... So it looks like a timing issue possibly?

If I use @chromium --proxy-auto-detect www.bbc.co.uk I no longer get the proxy server error, however I get a webpage not available error instead. If I refresh it works fine.....

Do I need to somehow pause the execution of chromium for a few seconds in order for the desktop to catch up? If so how do I do this in the autostart file?
Posts: 30
Joined: Tue Jan 08, 2013 9:48 am
by Cloudcentric » Fri Jan 18, 2013 12:57 pm
I know everything about nothing"
Posts: 982
Joined: Fri Sep 14, 2012 9:13 am
by stevenh » Thu Jan 31, 2013 11:19 am
Super-Nathan wrote:Frankly your best bet would be to install openbox and have openbox open the bowser for you. this would give you a fullscreen webbrowser with NOTHING else. no statusbar, no time, no startmenu, nothing but the browser.

Code: Select all
sudo aptitude install openbox obconf obmenu


and then make a openbox config file with

Code: Select all
mkdir -p ~/.config/openbox && cp /etc/xdg/openbox/* ~/.config/openbox


Then edit the autostart to openthe browser at boot

Code: Select all
nano ~/.config/openbox/autostart


remove all the code and past this in:

Code: Select all
# Autostart script
#will sleep to make sure everything else loads
sleep 5s && midori  --inactivity-reset=120 -e Fullscreen --app=/PATH/TO/HOMEPAGE/FILE.html


that will make it run with fewer options auto resetting after 2 minutes inactivity



I am working on a similar project.
I tried this, but it doesn't launch at startup.
and If I say "startx" after logging in, it starts the default GUI
can I skip login and just directly into the browser?
Tx.
Steve
Posts: 4
Joined: Thu Jan 31, 2013 11:08 am
by adhall » Fri Sep 06, 2013 8:42 pm
Hello, I am in charge of making the switch in how we do digital signage at our University, and was experiencing problems with Midori crashing. We are switching to "Chromium" to see if that will work better, but I was wondering if there was anyone that could advise me on the code to do this. I need Chromium to start on boot and open a specific webpage in Full Screen. I will list the code that seemed to be working on Midori until it crashed below. Thanks.

This is in a file that I created and made executable.

• #!/bin/bash
• midori –e Fullscreen –a http://display.northcentral.edu/screen/?mac=`ifconfig | grep HWaddr | tr –s “ “ | cut –d “ “ –f 5`
Posts: 1
Joined: Fri Sep 06, 2013 8:34 pm
by gingbeard » Wed Sep 11, 2013 2:38 pm
Sorry to kick up an old thread...

We're using the instructions here - https://github.com/MobilityLab/TransitS ... spberry-Pi to set-up a "web screen" that loads a webpage on boot, and nothing else.

The page in question has a username/password access system. Is there a way to get Midori to auto-enter these details and enter?
Posts: 8
Joined: Tue Apr 10, 2012 8:07 am