Seite 1 von 1

activate LCD interface on openwb 1.9

Verfasst: Do Sep 21, 2023 8:57 am
von courage2000
1. Disable the mouse cursor on the external touch LCD

Code: Alles auswählen

sudo sed -i 's/#xserver-command=X/xserver-command=X -nocursor/g' /etc/lightdm/lightdm.conf
2. Prepare rPi kiosk mode.

Install chromium-browser and screensaver

Code: Alles auswählen

sudo apt install -y chromium-browser xscreensaver
sudo reboot
2.1 Enable display power management

Edit the autostart file

Code: Alles auswählen

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
Add this to the end of the file:

Code: Alles auswählen

@xset dpms
2.1 We need to configure xscreensaver

We need to configure xscreensaver in otder to close the LCD after a minute, not only blanking (LCD is still running), in order to preserve the life of the LCD.

Option 1
The easyest way to doit is to replace the entire content of the file ~/.xscreensaver

Code: Alles auswählen

sudo nano ~/.xscreensaver
Delete all the content and paste the content of this file (attached).
xscreensaver.txt
(8.57 KiB) 68-mal heruntergeladen

Code: Alles auswählen

sudo reboot
Option 2 - via VNC or HDMI diplay.

IF you use VNC, you will have a resolution problem with setting Xscrensaver
Add this to your /boot/config.txt at the end

Code: Alles auswählen

sudo nano /boot/config.txt
Save with Ctrl+x

Code: Alles auswählen

#vnc resolution high for Xscreensaver setup
framebuffer_width=1900
framebuffer_height=1080
** Don't forget to comment/remove those lines after you set up the xscreensaver and reboot.[/colour]

In the linux GUI, go to Start Button - Preferences - Xscreensaver.
Make the same settings as in the attached below pictures.

1.jpg
2.jpg
In Open WB settings, you can activate the LCD and display sleep.

Code: Alles auswählen

http://openwb.local/openWB/web/settings/misc.php
3. Open the chromium browser with a page at the startup

Create chromium_start.sh in /home/pi/

Code: Alles auswählen

sudo nano /home/pi/chromium_start.sh
Paste this code:

Code: Alles auswählen

#!/bin/bash
#sleep 50 seconds, to wait for openWB to start

sleep 50
chromium-browser --noerrdialogs --incognito --disable-pinch --overscroll-history-navigation=0 --kiosk http://localhost/openWB/web/display.php
Make the script executable

Code: Alles auswählen

sudo chmod +x /home/pi/chromium_start.sh
4. Activate load on boot for this script

Code: Alles auswählen

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
add this line:

Code: Alles auswählen

@/home/pi/chromium_start.sh
Ctrl+x to save

5. Reboot

Code: Alles auswählen

sudo reboot
====

If you want/need to enable disable kiosk mode:

Disable Kiosk mode

Code: Alles auswählen

sudo sed -i 's/@\/home\/pi\/chromium_start.sh/#@\/home\/pi\/chromium_start.sh/g' /etc/xdg/lxsession/LXDE-pi/autostart
sudo reboot
Enable kiosk mode

Code: Alles auswählen

sudo sed -i 's/#@\/home\/pi\/chromium_start.sh/@\/home\/pi\/chromium_start.sh/g' /etc/xdg/lxsession/LXDE-pi/autostart
sudo reboot