projekte:hausautomatisierung:openhab:display

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.

Link zu der Vergleichsansicht

Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung
Nächste Überarbeitung
Vorherige Überarbeitung
Letzte ÜberarbeitungBeide Seiten, nächste Überarbeitung
projekte:hausautomatisierung:openhab:display [2020/06/29 20:28] nobyprojekte:hausautomatisierung:openhab:display [2021/09/04 17:14] noby
Zeile 1: Zeile 1:
 +====== OpenHab Display ======
 +===== Basisinstallation =====
 +
     * Kopieren des Rasbian Lite Images auf SD Karte     * Kopieren des Rasbian Lite Images auf SD Karte
-    * Erster Login mit USB Tastatur mit "piund "raspberry"+    * Erstellen der Datei ''ssh'' im ''boot'' Verzeichnis 
 +    * Erster Login mit USB Tastatur mit ''pi'' und ''raspberry''
  
  $ sudo -i  $ sudo -i
- $ systemctl enable ssh 
- $ systemctl start ssh 
  $ adduser thomas  $ adduser thomas
  $ addgroup thomas sudo  $ addgroup thomas sudo
Zeile 13: Zeile 15:
  $ sudo -i  $ sudo -i
  $ deluser pi  $ deluser pi
 +        $ apt update
 +        $ apt upgrade
  $ apt-get install vim  $ apt-get install vim
  $ update-alternatives --set editor /usr/bin/vim.basic  $ update-alternatives --set editor /usr/bin/vim.basic
Zeile 21: Zeile 25:
  $ vi ~/.bashrc  $ vi ~/.bashrc
  >>> PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ '  >>> PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ '
-    Ebenfalls aliase und export einkommentieren +Ebenfalls aliase und export einkommentieren. 
-    Mit User thomas anmelden und in .bashrc force_ color_prompts=true einkommentieren+Mit User thomas anmelden und in ''.bashrc'' ''force_color_prompts=true'' einkommentieren.
  
-    * Falls der Bildschirm um 180Grad gedreht ist, die Zeile +    * Falls der Bildschirm um 180Grad gedreht ist, die Zeile ''lcd_rotate=2'' an die Datei ''/boot/config.txt'' anfügen 
- lcd_rotate=2 + 
-      An die Datei "/boot/config.txtanfügen+    * X-Server installieren
  
  $ apt-get install xserver-xorg-core xserver-xorg-video-fbdev xserver-xorg-input-libinput x11-xserver-utils slim  $ apt-get install xserver-xorg-core xserver-xorg-video-fbdev xserver-xorg-input-libinput x11-xserver-utils slim
Zeile 36: Zeile 40:
     * Chromium Browser     * Chromium Browser
  
- $ apt-get install chromium-browser libgtk-3-0+ $ apt-get install chromium libgtk-3-0 libgles2
  
     * Add user and configure Auto Login     * Add user and configure Auto Login
Zeile 45: Zeile 49:
  auto_login yes  auto_login yes
  $ vi /home/openhab/.xsession  $ vi /home/openhab/.xsession
- #!bin/bash +<code bash> 
-                /usr/bin/xscreensaver -no-splash & +#!bin/bash 
-                /usr/bin/redshift -l49.1:12.6 -b 0.5 & +/usr/bin/xscreensaver -no-splash & 
-                /usr/bin/xterm -e true +/usr/bin/redshift -l49.1:12.6 -b 0.5 & 
-                sleep 1 +/usr/bin/xterm -e true 
-                /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=http://pizza/basicui/app?sitemap=mainroom+sleep 1 
 +/usr/bin/chromium --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 
 +</code> 
 + 
 +Die Geräte ID kann mit folgenden Befehlen herausgefunden werden: 
 +<code> 
 +$ export DISPLAY=:
 +$ sudo -u openhab xinput list 
 +</code> 
 + 
 +use the following for the workshop display: 
 +<code> 
 +#!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 
 +</code>
  
     * Blank Screen after timeout     * Blank Screen after timeout
Zeile 77: Zeile 99:
  $ vi /etc/X11/Xsession.d/99-calibration.conf  $ vi /etc/X11/Xsession.d/99-calibration.conf
  
 +===== Scripts installieren =====
 +
 +    $ vi /home/openhab/check_network.sh
 +<code bash>
 +#!/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
 +</code>
 +
 +    $ vi /home/openhab/refresh_chrome.sh
 +<code bash>
 +#!/bin/sh
 +
 +export DISPLAY=":0"
 +WID=$(xdotool search --onlyvisible --class chromium|head -1)
 +xdotool key ctrl+F5
 +</code>
 +
 +    $ apt install xdotool
 +    $ chmod a+x /home/openhab/refresh_chrome.sh
 +    $ chmod a+x /home/openhab/check_network.sh
 +    $ crontab -e -u openhab
 +<code>
 +0 11 * * * /home/openhab/refresh_chrome.sh
 +@reboot /home/openhab/check_network.sh
 +</code>
 +
 +===== OverlayFS =====
 +    $ cd
 +    $ apt install git
 +    $ git clone https://github.com/ghollingworth/overlayfs
 +    $ cd overlayfs
 +    $ sudo overlayfs.sh
 +    $ reboot
 +    
 +ACHTUNG!!!! Nach jedem Kernel Update muss ''sudo overlayfs.sh'' erneut ausgeführt werden. Ansonsten bootet das System nicht mehr. Wenn dies doch geschieht, muss aus der ''cmdline.txt'' der Eintrag ''boot=overlay'' entfernt werden.
 +   
 +===== Wireless Config (Optional) =====
 +    $ vi /etc/wpa_supplicant/wpa_supplicant.conf
 +<code>
 +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>"
 +}
 +</code>
  • projekte/hausautomatisierung/openhab/display.txt
  • Zuletzt geändert: 2021/09/04 17:39
  • von noby