projekte:hausautomatisierung:openhab:display

Dies ist eine alte Version des Dokuments!


OpenHab Display

  • Kopieren des Rasbian Lite Images auf SD Karte
  • Erstellen der Datei ssh im boot Verzeichnis
  • Erster Login mit USB Tastatur mit pi und raspberry
$ sudo -i
$ adduser thomas
$ addgroup thomas sudo
$ logout
  • Login via ssh und dem Benutzer thomas
$ sudo -i
$ deluser pi
      $ apt update
      $ apt upgrade
$ apt-get install vim
$ update-alternatives --set editor /usr/bin/vim.basic
$ dpkg-reconfigure tzdata
  • Root Shell farbig machen:
$ vi ~/.bashrc
>>> PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ '

Ebenfalls aliase und export einkommentieren. Mit User thomas anmelden und in .bashrc force_color_prompts=true einkommentieren.

  • Falls der Bildschirm um 180Grad gedreht ist, die Zeile lcd_rotate=2 an die Datei /boot/config.txt anfügen
  • X-Server installieren
$ apt-get install xserver-xorg-core xserver-xorg-video-fbdev xserver-xorg-input-libinput x11-xserver-utils slim
  • Remove the mouse cursor
      $ apt-get install unclutter
  • Chromium Browser
$ apt-get install chromium-browser libgtk-3-0
  • Add user and configure Auto Login
$ adduser --disabled-login openhab
$ vi /etc/slim.conf
	default_user openhab
	auto_login yes
$ vi /home/openhab/.xsession
#!bin/bash
/usr/bin/xscreensaver -no-splash &
/usr/bin/redshift -l49.1:12.6 -b 0.5 &
/usr/bin/xterm -e true
sleep 1
/usr/bin/chromium-browser --window-size=1910,1080 --noerrdialogs --disable --disable-translate --disable-infobars --disable-suggestions-service --disable-save-password-bubble --disable-internal-flash --disable-plugins-discovery --kiosk --touch-devices=6 --app=https:/pizza.binary.kitchen/basicui/app?sitemap=mainroom

use the following for the workshop display:

#!bin/bash
/usr/bin/xscreensaver -no-splash &
/usr/bin/redshift -l49.1:12.6 -b 0.5 &
/usr/bin/xterm -e true
sleep 1
/usr/bin/chromium-browser --window-size=800,480 --noerrdialogs --disable --disable-translate --disable-infobars --disable-suggestions-service --disable-save-password-bubble --disable-internal-flash --disable-plugins-discovery --kiosk --app=https:/pizza.binary.kitchen/basicui/app?sitemap=workshop
  • Blank Screen after timeout
$ apt-get install xscreensaver
  • Run as root:
$ export DISPLAY=:0
$ sudo -u openhab xscreensaver-demo
And configure the screensaver with
      * Mode: Blank Screen Only
      * Blank after: 1 Minute
      * Power Management Enabled
      * Standby After 1 minutes
      * Suspend after 1 minutes
      * Off After 1 minutes
$ sudo apt install xinput-calibrator
$ export DISPLAY=:0
$ sudo -u openhab xinput_calibrator
Paste the output to 
$ vi /etc/X11/Xsession.d/99-calibration.conf
  $ vi /home/openhab/check_network.sh
#!/bin/bash
 
HAB_STATUS=0
 
while true
do
        if curl -s --head https:/pizza.binary.kitchen/basicui/app?sitemap=mainroom | grep "200 OK" > /dev/null
        then
                if [ "$HAB_STATUS" -eq 0 ]
                then
                        echo "Site Changed from Down to Up"
                        HAB_STATUS=1
 
                        # Refresh Browser
                        export DISPLAY=":0"
                        WID=$(xdotool search --onlyvisible --class chromium|head -1)
                        xdotool key ctrl+F5
                fi
        else
                echo "Site Down"
                if [ "$HAB_STATUS" -eq 1]
                then
                        echo "Site Changed from Up to Down"
                        HAB_STATUS=0
                fi
        fi
 
        sleep 60
done
  $ vi /home/openhab/refresh_chrome.sh
#!/bin/sh
 
export DISPLAY=":0"
WID=$(xdotool search --onlyvisible --class chromium|head -1)
xdotool key ctrl+F5
  $ apt install xdotool
  $ chmod a+x /home/openhab/refresh_chrome.sh
  $ chmod a+x /home/openhab/check_network.sh
  $ crontab -e -u openhab
0 11 * * * /home/openhab/refresh_chrome.sh
@reboot /home/openhab/check_network.sh
  $ cd
  $ apt install git
  $ git clone https://github.com/ghollingworth/overlayfs
  $ cd overlayfs
  $ sudo overlayfs.sh
  $ reboot
 
  $ vi /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=DE

network={
 ssid="mqtt.binary-kitchen.de"
 psk="<Password for your wireless LAN>"
}
  • projekte/hausautomatisierung/openhab/display.1626556486.txt.gz
  • Zuletzt geändert: 2021/07/17 21:14
  • von noby