Kiosk basado en Raspberry Pi - adsaman/IoT GitHub Wiki

Enlaces

Configuración

Instalamos Raspbian Jessie Lite en una SD:

sudo dd if=2016-09-23-raspbian-jessie-lite.img of=/dev/mmcblk0 bs=4M

Y seguimos los siguientes pasos:

Configuración de la red

Con el cambio a Jessie hay que utilizar dhcpcd para configurar las interfaces de red. La configuración por defecto utiliza DHCP en todas las interfaces. Solo necesitamos editar /etc/wpa_supplicant/wpa_supplicant.conf:


country=ES
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="SSID"
    psk="PASSWORD"
}

Instalación de paquetes

Instalamos dependencias:

sudo apt-get update
sudo apt-get install x11-xserver-utils xinit matchbox git unclutter chromium-browser

Modificaciones a /boot/config.txt

Deshabilitamos:

pi@raspberrypi:~ $ tail /boot/config.txt
#dtoverlay=lirc-rpi

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
#dtparam=audio=on

# Disable BT
dtoverlay=pi3-disable-bt

# Removes the warning overlay
avoid_warnings=1

Si deshabilitamos el BT también podemos deshabilitar los servicios asociados:

sudo systemctl disable bluetooth hciuart

Pasar /tmp a tmpfs

pi@raspberrypi:~ $ cat /etc/fstab 
proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults          0       2
/dev/mmcblk0p2  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that
tmpfs           /tmp            tmpfs   defaults,noatime,size=100m    0 0

Modo kiosko

Añadimos un usuario para el auto-login:

sudo adduser kiosk --disabled-password

Habilitamos el autologin:

root@raspberrypi:/etc/systemd/system/[email protected]# cat autologin.conf 
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin kiosk --noclear %I $TERM
root@raspberrypi:/etc/systemd/system/[email protected]# sudo systemctl daemon-reload

Clonamos el repo:

kiosk@raspberrypi:~ $ git clone https://github.com/adsaman/IoT.git

Modificamos el fichero .profile:

kiosk@raspberrypi:~ $ tail .profile
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

xinit $HOME/IoT/kiosk/kiosk.sh

Habilitar splash screen

root@raspberrypi:/usr/share/plymouth/themes# ln -s /home/kiosk/IoT/kiosk/plymouth-pnteide-theme/ pnteide
root@raspberrypi:/usr/share/plymouth/themes# plymouth-set-default-theme -R pnteide
root@raspberrypi:/usr/share/plymouth/themes# cat /boot/cmdline.txt
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles

Deshabilitar SSH

sudo systemctl disable ssh

Habilitar espera por red al arrancar

pi@raspberrypi:~ $ cat /etc/systemd/system/dhcpcd.service.d/wait.conf 
[Service]
ExecStart=
ExecStart=/sbin/dhcpcd -q -w