Configuration en mode kiosk du navigateur Chrome

Configuration en mode kiosk du navigateur Chrome.

Raspeberry Pi : Modèle 4B 4 Go
Webcam : Logitech, Inc. Webcam C270
Distribution : Raspberry Pi OS (previously called Raspbian) : Raspberry Pi OS (32-bit) Lite 2020-08-20

I/ Configuration de base.

1/ Connexion.

Attention par défaut le clavier est en « qwerty »

login : pi
password : raspberry
...
pi@raspberrypi:~ $

2/ Configuration.


pi@raspberrypi:~ $ sudo raspi-config


Configuration de la localisation
Configuration du clavier
Configuration du pays
Configuration du réseau sans-fil
Activation de ssh.
Changer le mot de passe de l'utilisateur par défaut 'pi'.

3/ Configuration sans-fil.

Lien : https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md

pi@raspberrypi:~ $ sudo iwlist wlan0 scan
...
ESSID:"ressf01"
...

Ouvrir :

/etc/wpa_supplicant/wpa_supplicant.conf

chercher :

network={
ssid="testing"
psk="testingPassword"
}

Remplacer par :

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=FR
network={
ssid="ressf01"
psk="Mot2Passe"
}

4/ Reconfiguration.


pi@raspberrypi:~ $ sudo wpa_cli -i wlan0 reconfigure

5/ Vérification.


pi@raspberrypi:~ $ ifconfig wlan0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.17 netmask 255.255.255.0 broadcast 192.168.1.255
...

6/ Mise-à-jour du système d’exploitation.


pi@raspberrypi:~ $ sudo apt-get update && sudo apt-get upgrade

7/ Installation d’outils.


pi@raspberrypi:~ $ sudo apt-get install vim mc htop screen

II/ Configuration du mode kiosk.

Lien :https://www.sylvaindurand.org/launch-chromium-in-kiosk-mode

1/ Installation du serveur X.


pi@raspberrypi:~ $ sudo apt-get install xserver-xorg-video-all xserver-xorg-input-all xserver-xorg-core xinit x11-xserver-utils

2/ Configuration du lancement de X au démarrage.

Créer :

~/.bash_profile

Ajouter :

if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
startx
fi

3/ Configuration du lancement de X depuis l’interface de configuration.


pi@raspberrypi:~ $ sudo raspi-config


3 Boot Options
B1 Desktop / CLI
B2 Console Autologin Text console, automatically logged in as 'pi' user

4/ Installation de navigateur web Chromium.


pi@raspberrypi:~ $ sudo apt-get install chromium-browser

5/ Installation de l’outil ‘unclutter’.

Lien : https://doc.ubuntu-fr.org/unclutter

pi@raspberrypi:~ $ sudo apt-get install unclutter

6/ Script de lancement du navigateur.

Liens :
https://pimylifeup.com/raspberry-pi-kiosk
https://arcanesciencelab.wordpress.com/2020/04/11/disable-chromium-update-dialog-on-raspbian-buster/
Créer :

~/.xinitrc

Ajouter :

#!/bin/sh
xset -dpms
xset s off
xset s noblank
unclutter &
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' /home/pi/.config/chromium/Default/Preferences
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' /home/pi/.config/chromium/Default/Preferences
chromium-browser https://meet.jit.si/hackardennes_rimbaud --window-size=1920,1080 --start-fullscreen --kiosk --incognito --noerrdialogs --disable-translate --no-first-run --fast --fast-start --disable-infobars --disable-features=TranslateUI --disk-cache-dir=/dev/null --password-store=basic --use-fake-ui-for-media-stream --test-type --check-for-update-interval=31536000

7/ Redémarrage.


pi@raspberrypi:~ $ sudo reboot

III/ Configuration de USB Audio device.

Lien : https://www.raspberrypi-spy.co.uk/2019/06/using-a-usb-audio-device-with-the-raspberry-pi/

1/ Brancher le USB Audio device.

2/ Vérification.


pi@raspberrypi:~$ lsusb
...
Bus 001 Device 007: ID 1b3f:2008 Generalplus Technology Inc.
...


pi@raspberrypi:~$ dmesg
...
[ 140.315162] usb 1-1.2: USB disconnect, device number 4
[ 153.664981] usb 1-1.1: new full-speed USB device number 7 using xhci_hcd
[ 153.809914] usb 1-1.1: New USB device found, idVendor=1b3f, idProduct=2008, bcdDevice= 1.00
[ 153.809935] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 153.809952] usb 1-1.1: Product: USB Audio Device
[ 153.809968] usb 1-1.1: Manufacturer: GeneralPlus
[ 153.872996] input: GeneralPlus USB Audio Device as /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.1/1-1.1:1.3/0003:1B3F:2008.0005/input/input6
[ 153.935388] hid-generic 0003:1B3F:2008.0005: input,hidraw0: USB HID v2.01 Device [GeneralPlus USB Audio Device] on usb-0000:01:00.0-1.1/input3
...


pi@raspberrypi:~$ aplay -l
**** Liste des P�riph�riques Mat�riels PLAYBACK ****
...
carte 1: Device [USB Audio Device], p�riph�rique 0: USB Audio [USB Audio]
Sous-p�riph�riques: 1/1
Sous-p�riph�rique #0: subdevice #0
...

3/ Configuration de Alsa.

Ouvrir :

/usr/share/alsa/alsa.conf

Chercher :

defaults.ctl.card 0
defaults.pcm.card 0

Remplacer par :

defaults.ctl.card 1
defaults.pcm.card 1

4/ Augmenter le volume de ‘Speaker’ et ‘Mic’.


pi@raspberrypi:~$ alsamixer

5/ Test.


pi@raspberrypi:~$ speaker-test -c2


pi@raspberrypi:~$ speaker-test -c2 -t sine -f 500


pi@raspberrypi:~$ wget https://www.kozco.com/tech/piano2.wav
pi@raspberrypi:~$ aplay piano2.wav

6/ Redémarrage.


pi@raspberrypi:~ $ sudo reboot

Comments are closed, but trackbacks and pingbacks are open.