Raspberry 2 b kiosk mode

Download Raspbian.

https://www.raspberrypi.org/downloads/

Unzip.

In windows use Win32DiskImager.exe to write iso image to sd card.

Boot up:

setup you raspi-config – https://www.raspberrypi.org/documentation/configuration/raspi-config.md

Open ssh , set to boot console and update.

Default login: pi / raspberry
Next we need to install these:
  • matchbox
  • chromium
  • x11-xserver-utils
  • ttf-mscorefonts-installer
  • xwit
  • sqlite3
  • libnss3
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install matchbox chromium x11-xserver-utils ttf-mscorefonts-installer xwit sqlite3 libnss3
sudo reboot

Edit screen resolution

(FullHD lcd tv example – HDMI conneciton):

sudo pico /boot/config.txt

hdmi_group=1
hdmi_mode=16
overscan_left=0
overscan_right=0
overscan_top=0
overscan_bottom=0
disable_overscan=0

start_x=0

Save (ctrl +x and y)

sudo pico reboot

Launching Chromium

sudo pico /etc/rc.local

add:

if [ -f /boot/xinitrc ]; then
	ln -fs /boot/xinitrc /home/pi/.xinitrc;
	su - pi -c 'startx' &
fi

Save (ctrl +x and y)

sudo pico /boot/xinitrc

#!/bin/sh
while true; do

	# Clean up previously running apps, gracefully at first then harshly
	killall -TERM chromium 2>/dev/null;
	killall -TERM matchbox-window-manager 2>/dev/null;
	sleep 2;
	killall -9 chromium 2>/dev/null;
	killall -9 matchbox-window-manager 2>/dev/null;

	# Clean out existing profile information
	rm -rf /home/pi/.cache;
	rm -rf /home/pi/.config;
	rm -rf /home/pi/.pki;

	# Generate the bare minimum to keep Chromium happy!
	mkdir -p /home/pi/.config/chromium/Default
	sqlite3 /home/pi/.config/chromium/Default/Web\ Data "CREATE TABLE meta(key LONGVARCHAR NOT NULL UNIQUE PRIMARY KEY, value LONGVARCHAR); INSERT INTO meta VALUES('version','46'); CREATE TABLE keywords (foo INTEGER);";

	# Disable DPMS / Screen blanking
	xset -dpms
	xset s off

	# Reset the framebuffer's colour-depth
	fbset -depth $( cat /sys/module/*fb*/parameters/fbdepth );

	# Hide the cursor (move it to the bottom-right, comment out if you want mouse interaction)
	xwit -root -warp $( cat /sys/module/*fb*/parameters/fbwidth ) $( cat /sys/module/*fb*/parameters/fbheight )

	# Start the window manager (remove "-use_cursor no" if you actually want mouse interaction)
	matchbox-window-manager -use_titlebar no -use_cursor no &

	# Start the browser (See http://peter.sh/experiments/chromium-command-line-switches/)
	chromium  -disable-translate -app="http://URL.of.your/choice.html"

done;

Save (ctrl +x and y)

Silent Boot

sudo pico /boot/cmdline.txt

Now, we only want to edit the console=tty1 part. We’ll change it to tty2. We also need to add a couple of more parameters to prevent messages from filling the screen.

loglevel=3 logo.nologo vt.global_cursor_default=0

My configuration looks like this after:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty2 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait loglevel=3 logo.nologo vt.global_cursor_default=0

Save (ctrl +x and y) and reboot. Now you can just use ALT+F2 to switch to tty2 which the boot messages are written to. Use ALT+F1 to switch back.