Tested on:RPi3; Raspbian Stretch
Prerequisites:Raspberry Pi with Raspbian Jessie and internet connection (see steps 1-7 in the Introduction)
18

Update: Autostart Chromium for full screen applications

HTML interfaces are neat for controlling a Raspberry Pi, but require loading a website in a browser like Chromium in full screen after
boot (kiosk mode). Since the last update, the description in the tutorial Chromium Autostart work no more. Instead, here’s an easy way for
enabling kiosk mode via rc.local.

Autostart Chromium with rc.local
Open the file with

and add before the line

the following

Now, Chromium starts automatically in kiosk mode after booting and opens a website, here localhost for a remote control.

Links
Tutorial CherryPy for HTML interfaces: http://www.knight-of-pi.org/cherrypy-an-elegant-python-webserver-for-raspberry-pi-remote-controls/
Chromium Autostart (deprecated): http://www.knight-of-pi.org/autostart-chromium-60-in-kiosk-mode-for-raspberry-pi-remote-controls/

Knight of Pi

Johannes Bergs aka Knight of Pi. Diploma in Bioinformatics, some Webdesign and Python coding then. Living in the beautiful city of Vienna.

18 Comments

  1. Hi, when i use this line (xinit …..&) on a 4k screen on a Pi4, it only fills one quarter of the screen.
    Is there a command that resizes the screen back to normal?
    I don’t want to use the 3840×2160 resolution as the screen update is quite slow on pi4. I want to run the 1920×1080 instead,

    • Hey Peter,
      i can’t replicate that because i do not have a Pi4 and a 4k screen. Chromium offers a flag –window-size “800,600”, you can try if that helps.

  2. Is there any way to get the page to refresh from the autostart file without having to point it to a script?

    • Installed chromium extension Super Auto Refresh Plus and set the auto start file to not be incognito and it worked like a charm.
      Edited this file: sudo nano /etc/xdg/lxsession/LXDE-pi/autostart

      @lxpanel –profile LXDE-pi
      @pcmanfm –desktop –profile LXDE-pi
      @xscreensaver -no-splash
      @point-rpi

      #BEGIN ADDED

      # Enable mixed http/https content, remember if invalid certs were allowed (ie self signed certs)
      @sed -i ‘s/”exited_cleanly”: false/”exited_cleanly”: true/’ ~/.config/chromium/$
      @/usr/bin/chromium-browser –start-maximized –kiosk –noerrdialogs –allow-running-insecure-content –remember-cert-error-decisions –disable-restore-session-state –disable-infobars http://web/addess/here
      @unclutter
      @xset s off
      @xset s noblank
      @xset -dpms
      # Refresh

      # END ADDED

  3. I have tried this and it doesn’t open the page I want, it always open the welcome to Chrome page and
    Also its shows a No–sandbox is not secure
    It doesn’t keep the settings I set in Chromium.
    Any Ideas
    Thanks

    • Hey Paul,

      if you’re only building a RPi device for displaying a website with no other web interaction, you can ignore the safety warning.
      In the command above, i open localhost to display a HTML remote control. If you want to show some website instead, you need to replace http://localhost:8080 with the website of your choice.

  4. Been playing with a lot of scripts to get something simple as this running..
    This just works like a charm, thanks a bunch :)

  5. ehmmmm,
    Works good, but when I enable Chromium autostart, it starts but I loose connection to X11VNC. I cannot connect to it. Any clues? Its something with xinit but at the moment I dont know what.

  6. Hi,

    Do you have any tips on disabling the screensaver when running this through rc.local?

    Thanks!

Comment

Time limit is exhausted. Please reload CAPTCHA.