Saturday, July 9, 2016

Raspberry pi booting on a fullscreen web page (kiosk mode)

Start chromium at boot, while disabling screen savers

This is useful when you want a web application to be run straight out of booting process on a raspberry pi.

To start chromium in kiosk mode, without menus and cursor, use ''piconfig'' to boot into graphics mode and the ''pi'' user, then set the content of ''/home/pi/.config/lxsession/LXDE-pi/autostart'' to this:
@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash
@xset s 0 0
@xset s noblank
@xset s noexpose
@xset dpms 0 0 0
xwit -root -warp $( cat /sys/module/*fb*/parameters/fbwidth ) $( cat /sys/module/*fb*/parameters/fbheight )
chromium-browser --app= --kiosk

You may use ''apt-get install unclutter'' instead of ''xwit'' above, to hide the cursor. Note: on NOOBS, ''.xinitrc'' does not seem to have any sort of effect, weirdly.

Hide booting process

When you want it to look more pro, you can redirect the boot process information to a secondary console, by changing ''tty1'' to ''tty2'' in ''/boot/cmdline''. You still can see it by pressing Control-Alt-F2 (then F7 to switch back to the grpahical terminal).

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty2 root=/dev/mmcblk0p7 rootfstype=ext4 elevator=deadline rootwait

Set the raspberry as an accesspoint

Finally, to set your raspberry pi as a wifi access point:

Lighttpd web server cgi-scripts

When you want lighttpd to be able to run a sudo cgi script, add this line with ''visudo'':
www-data ALL=(ALL) NOPASSWD: /var/www/cgi-bin/*