Raspberry PI kiosk mode with Chromium.

1. Install chromium, x11-xserver-utils and unclutter

sudo apt-get update && apt-get upgrade -y
sudo apt-get install chromium x11-xserver-utils unclutter

2. We need to prevent screen from going blank and disable screen saver.
– edit /etc/xdg/lxsession/LXDE/autostart and comment # screen saver line and add those lines:

@xset s off
@xset -dpms
@xset s noblank
@chromium --kiosk --incognito http://some.web.

Done.

Advertisements

51 Comments on “Raspberry PI kiosk mode with Chromium.”

  1. […] To make this work, we need the Pi to work in Kiosk mode. Luckily I found this from  https://lokir.wordpress.com/ […]

  2. Drakandar says:

    Thanks & works like a charm!
    Reblogged this at my own blog 🙂

  3. Dylan says:

    What distro are you using as a base for this?

  4. Andrei says:

    I would like to know if there is any chance to make the browser restart to his main url after 5 minutes by example.
    Do you have any ideas how to implement this?

  5. any hint about how to get html5 video playing in chromium?

  6. rob says:

    This works very well – thank you. Is there any way of forcing regular page refreshes?

  7. Jim says:

    here is how you can edit the file and save it.

    sudo nano /etc/xdg/lxsession/LXDE/autostart

  8. There is no need to start LXDE. Configure the X session of any user to start the required applications and run it at boot.

    Edit /home/myuser/.xinitrc

    unclutter -idle 15 -root &
    xset -dpms &
    xset s off &
    exec chromium -incognito -kiosk “http://your.web.site”

    Edit /etc/rc.local

    #!/bin/sh -e
    #
    # rc.local
    #
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will “exit 0” on success or any other
    # value on error.
    #
    # In order to enable or disable this script just change the execution
    # bits.
    #
    # By default this script does nothing.
    su – myuser -c “startx” &
    exit 0

    Reboot. You will have some more RPi memory left

    • your method doesn’t work for me.
      It’s impossible to run ‘su’ from rc.local

      • lokir says:

        use my original method with basic X and than you can run terminal and su.

      • Davide Bologna says:

        could you run rc.local from a root shell and post the error ?
        also check if the user “myuser” and its .xinitrc permission (644 myuser:myuser)

        anyway i found chromium may not be able to detect the screen resolution leaving black border on the screen. it needs a window manager to resize correctly itself.
        anyway you could run a bare wm instead of a full desktop environment: i used openbox. also tinywm is interesting

  9. 2 Davide Bologna : After reboot : “No password entry for user “-” ”
    Sorry , I’m not a guru in linux so how I can change permission to “myuser” ? (I changed permission to .xinitrc : “sudo chmod 644 .xinitrc” )

    2 lokir : I tried your method but after reboot X doesn’t start.

    Thank you in advance for help.

    • so how I understand this : the script is loaded before user is logged.

      • 2 lokir : resolved. thanks !

      • Davide Bologna says:

        Correct. I think either the “myuser” does not exist: are you able to login using the myuser account ? If so then run as root: useradd -m myuser
        Don’t forget to set the myuser password.
        This is useful to run services with least privileges: if security is not a concern then run X as root using only the startx command

  10. […] Now that we’ve got a few utilities installed and, more importantly, the Chromium browser, let’s make some configuration tweaks: (source) […]

  11. Paul D Smith says:

    Thanks for the very helpful thread. But does anyone know how to “kick” the browser to reload? I will need reload very rarely (and don’t want a timed reload to keep clearing and reloading the screen) but if the page being displayed is updated (I’ll be told this by word-of-mouth), I’d like to be able to “nudge” Chromium to load the new page without having to completely reboot the R-Pi.

  12. Sorry, the meta-tag was stripped:

    • Ok.. but how you refresh the content after so many minutes of inactivity?

      • jeffchaves says:

        Use crontab or make a script and run when you need it.

      • jeffchaves says:

        Here is an example of script you can run on crontab. Add this to a file make it executable and add it to crontab with the time you need it to execute. xdotool is needed.

        export DISPLAY=:”0.0″
        XAUTHORITY=/home/pi/.Xauthority
        xdotool getactivewindow
        xdotool key F5

  13. What do you mean? Change it to 300 and you have a browser refresh every 5 minutes. 😉

    • where should i add the meta for restarting the browser?
      In html of the website is not an option…
      Can i add some code in /etc/xdg/lxsession/LXDE/autostart in order to refresh?

      • Mario Peischl says:

        Unfortunately, i don’t know. I’m not a “coding guy”. 😉 I put that tag in the head section of the html file and it works like a charm.

  14. Alan says:

    I have looked at a number of solutions to display a web page in full screen mode for unattended operation. They all work OK however I need to be able to save a login and password for the default page. Chromium will do it but it still requires a mouse click to confirm on reboot and I want it to run unattended once setup.?

  15. Mark says:

    I have been able to set this up with no difficulty. Autostart kicks in and my nagios server dsiplays what I want. Is it possible to have this setup auto-cycle in kiosk mode between 2 webpages to change say every 30 seconds?

    • Stephan Roux says:

      Hey Mark.. did you manage to figure out how to do the 30 second refresh to a different page? Have a few splunk dashboards that I want to step through.

      • Dylan Smith says:

        The easiest way to do that is with meta tags in your two (or however many) web pages. Put the tag within the section, change the 30 to however many seconds you want the current page to show for, and the url is the location of the next page:

        More here: https://en.wikipedia.org/wiki/Meta_refresh

  16. […] the steps in lokir’s blog, using the appropriate URL […]

  17. Rasmus Iversen says:

    I’m a totally beginner with linux, but I almost succeeded with this tutorial. Thanks for posting! My problem is that the website, I want to access demands a password (http://www.tiikoni.com/tis/view/?id=a3a8cbd).
    How do easily create an autologin, so I don’t have to type the password every time.

    /Rasmus

  18. Dave says:

    I am having an issue where when chromium loads, DNS resolution does not work at first, I end up having to manually refresh the browser then it works. Is there a way to wait till all of the network settings have been configured on boot before launching the browser?

  19. Alan says:

    I run it with midori, is a bit quicker to run as a result:
    @midori -p -e Fullscreen -a ADDRESS
    -p is private browsing

  20. Hello! Thank you for your post! But if I want to start Chromium with “–kiosk”, then it complaints with: “Failed to load NSS libraries. Gtk-WARNING **: cannot open display”. Any suggestions?

    • Mamsey says:

      A link to your nss libraries should do the trick:

      ln -s /usr/lib/arm-linux-gnueabihf/nss/ /usr/lib/nss

  21. raspi-diapo says:

    I created a script for automatise the installation here »»» https://sourceforge.net/projects/raspi-diapo/

  22. OM says:

    Hi I wan to to open two tabs and switch between tabs in 15 seconds. Any Idea?

  23. […] Raspberry PI kiosk mode with Chromium […]

  24. Ethirajadasan says:

    Hello,

    While in kiosk mode, I do not want the user to open another browser for browsing the web. Basically disable Ctrl + N key combination. How to do that? Can someone help?

    Thanks,
    Ethirajadasan


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s