8

I'm trying to build a Webkit Kiosk on a Raspberry Pi.

I found a good start at: https://github.com/pschultz/kiosk-browser

The things I want to do:

1) Start the kiosk without logging in (with inittab?)

Peter Schultz pointed out adding the following line:

1:2345:respawn:/usr/bin/startx -e /usr/bin/browser http://10.0.0.5/zfs/monitor tty1 /dev/tty1 2>&1

But he did not explain the steps to make this work (for noobs).

What I did is add his code to a personal git repository and cloned this repo to /usr/bin/kiosk and sudo apt-get install libwebkit-dev and sudo make.

The line to add to inittab will be:

1:2345:respawn:/usr/bin/startx -e /usr/bin/kiosk/browser http://my-kiosk-domain.com tty1 /dev/tty1 2>&1

If I do this, I generate a loop or some kind...

Mike
  • 1,883
  • 3
  • 23
  • 17
  • 1
    You might want to ask that here: – pasawaya Jun 28 '12 at 19:59
  • For people asking, due to strong demand, a fork of Instant WebKiosk for Raspberry Pi is now born. **Raspberry digital signage**: https://sourceforge.net/projects/raspberrysign –  Jun 13 '13 at 05:53
  • 1
    Came across https://github.com/futurice/chilipie-kiosk if you still in need – lony Dec 06 '18 at 17:59

6 Answers6

7

If you want to automatically load a browser full screen in kiosk mode every time you turn on the rpi you can add one of these two lines to the file /etc/xdg/lxsession/LXDE/autostart

@chromium --kiosk --incognito www.google.it
@midori -i 120 -e Fullscreen -a www.google.it -p

The first is for chromium and the latter is for midori, the rpi default lightweight browser.

Hint : Since we will use the rpi as a kiosk we want to prevent the screen from going black and disable the screensaver. Edit the autostart file:

sudo pico /etc/xdg/lxsession/LXDE/autostart

find the following line and comment it using a # (it should be located at the bottom)

#@xscreensaver -no-splash

and append the following lines

@xset s off 
@xset -dpms 
@xset s noblank 

Save, reboot.

More info on http://pikiosk.tumblr.com/post/38721623944/setup-raspberry-ssh-overclock-sta

Advanced
  • 1,457
  • 2
  • 13
  • 12
  • Hi I have a hackberry a10 device with cortex a8 and I could install Debian wheezy but I haven't been able to install chromium I always get errors about dependance etc. do you know a way to install it? I'm newbie In linux. Thanks a lot!! – VAAA Apr 13 '13 at 00:18
4

The upvoted answer suggest to run LXDE for it. You could also do it without such a heaver desktop enviorment. You could just start midori or chromium in an X session:

xinit /usr/bin/midori -e Fullscreen -a http://www.examples.com/
xinit chromium --kiosk http://www.examples.com/

Sometimes Fullscreen mode of midori is not working as expected and midori is not using whole screen. In these cases you could map it inside a very simple window manager like MatchBox to get real fullscreen. Due to xinit you have to wrap everything in a shell script.

#!/bin/sh
matchbox-window-manager &
midori -e Fullscreen -a http://dev.mobilitylab.org/TransitScreen/screen/index/11

Autostart could be done simply be using /etc/rc.local.

More information concerning screensaver issues and an automated restart could be found here: https://github.com/MobilityLab/TransitScreen/wiki/Raspberry-Pi#running-without-a-desktop

Chromium has a dependency problem on some debian derivate for arm architecture. For Cubian you find the bug report here. I am not sure if you could install chromium on latest Raspbian without problem.

But I really could recommend midori. It's very fast and support for modern web technologies is very good. As Chromium it is using webkit as rendering engine. If you miss some html5 / css3 features consider an update of libwebkitgtk (for example by using package of debian testing).

jelhan
  • 6,149
  • 1
  • 19
  • 35
  • but running that from rc local won't run X and chromium/midori as root? Maybe we want to add a limited user and `su -c "browser-script" luser` to it – ZJR Oct 26 '22 at 23:32
2

It's possible you haven't set the DISPLAY environment variable.

Try:

export DISPLAY=:0
/usr/bin/startx /usr/bin/browser

Or, browser can also take a display argument (so you don't need the environment variable):

/usr/bin/startx /usr/bin/browser :0

This works for me on Raspbian from a standard terminal shell (I'm logged in over SSH).

Nick
  • 858
  • 8
  • 9
1

Updated for the current version of Raspbian (with Pixel desktop) install with noop 2.0.

I found you need to edit in two different places to get it to work.

  1. /etc/xdg/lxsession/LXDE/autostart
  2. /home/pi/.config/lxsession/LXDE-pi/autostart

So my configure file is:

# @xscreensaver -no-splash

@xset s off 
@xset -dpms 
@xset s noblank 

@chromium-browser --kiosk --incognito http://localhost

And that's it.

Joel Chu
  • 828
  • 1
  • 9
  • 25
0

You should probably start with checking if /usr/bin/kiosk/browser is working at all. You should start normal X session (graphical environment) on your RaspberryPi, launch terminal, try running this command:

/usr/bin/kiosk/browser http://my-kiosk-domain.com

and see what it prints on the terminal. Is this working? Do you see any error messages?

Krzysztof Adamski
  • 2,039
  • 11
  • 14
0

I'm trying to build a Webkit Kiosk on a Raspberry Pi.

I think Instant WebKiosk for Raspberry Pi could be useful for you. See: http://www.binaryemotions.com/raspberry-digital-signage/

Community
  • 1
  • 1
Marco
  • 1
  • On SO, when providing a link to an external site, it is often best to give at least a high level summary of what the contents are in case the external link changes or is deleted. Future SO visitors will still have *something* to work with. – Fluffeh Sep 28 '12 at 11:00
  • Thx, specs looks nice but is no Webkit but Firefox based Kiosk. – Mike Jan 07 '13 at 00:08