Hallo,
nach langer Abstinenz schaue ich mal wieder hier rein und versuche, die Geschichte zum Laufen zu bringen.
Das habe ich gemacht:
Hardware
Image-File
Download von https://sourceforge.net/projects/sma...4.zip/download
Expand Filesystem
df -h 15:19:42
Dateisystem Größe Benutzt Verf. Verw% Eingehängt auf
/dev/root 2,0G 1,7G 166M 92% /
devtmpfs 182M 0 182M 0% /dev
tmpfs 186M 0 186M 0% /dev/shm
tmpfs 186M 4,6M 182M 3% /run
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 186M 0 186M 0% /sys/fs/cgroup
/dev/mmcblk0p1 63M 22M 42M 34% /boot
sudo raspi-config
Filesytem erweitert.
Reboot
df -h 15:22:30
Dateisystem Größe Benutzt Verf. Verw% Eingehängt auf
/dev/root 3,5G 1,7G 1,7G 51% /
devtmpfs 182M 0 182M 0% /dev
tmpfs 186M 0 186M 0% /dev/shm
tmpfs 186M 4,5M 182M 3% /run
tmpfs 5,0M 8,0K 5,0M 1% /run/lock
tmpfs 186M 0 186M 0% /sys/fs/cgroup
/dev/mmcblk0p1 63M 22M 42M 34% /boot
Aktualisieren der Pakete
sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove
sudo apt-get autoclean
Device für knxd
Damit der knxd über ein Device auf den Bus lesen und schreiben kann, wird ein Link unter /dev/ttyKNX1 eingerichtet. In diesem Abschnitt hat nach dem Boot mit aufgesteckter ROT-Schnittstelle alles gepasst.
Zur Kontrolle habe ich die Parameter der ROT-Schnittstelle festgestellt:
sudo udevadm info -a /dev/ttyAMA0
In /etc/udev/rules.d/70-knxd.rules waren folgende Einstellungen zu finden, die passen:
cat /etc/udev/rules.d/70-knxd.rules
Es gibt folgenden Link unter /dev:
lrwxrwxrwx 1 root root 7 Apr 12 15:54 ttyKNX1 -> ttyAMA0
Ich hatte erwartet, dass der Link dem User knxd gehört. Immerhin gehört /dev/ttyAMA0 dem User knxd und der Gruppe dialout:
crw-rw---- 1 knxd dialout 204, 64 Apr 12 15:54 ttyAMA0
knxd konfigurieren
sudo vi /etc/knxd.conf
Nachdem die knx.conf aktualisiert wurde, habe ich den Dämon neu gestartet:
sudo /etc/init.d/knxd restart
knxd testen
Nun habe ich ein paar Tests durchgeführt:
knxtool groupswrite local: 1/0/6 1 # Deckenlampe Buero an
knxtool groupswrite local: 1/0/6 0 # Deckenlampe Buero aus
knxtool groupswrite local: 1/1/2 1 # Rollladen Buero runter
knxtool groupswrite local: 1/1/2 0 # Rollladen Buero rauf
knxtool on local: 1/0/6 # Deckenlampe Buero an
knxtool off local: 1/0/6 # Deckenlampe Buero aus
Funktioniert!
Startbild kommt unter http://raspberrypi/smartvisu/index.php?page=config
Smarthome Teil
Unter /usr/local/smarthome/items habe ich eine Konfiguration abgelegt:
cat Erdgeschoss.conf
Smarthome Konfiuration
sudo su - smarthome
cd /usr/local/smarthome/etc
vi plugin.conf
chmod 644 plugin.conf
touch logic.conf
cd /var/www/html
sudo ln -s ../smartvisu . # Fuer neuen und alten HTML-Pfad
Smarthome testen
telnet localhost 2323
Trying ::1...
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
Geht anscheinend nicht mehr. Im Vorgängerimage hat es noch funktioniert:
> update Erdgeschoss.Arbeit.ceiling = 0
> ls Erdgeschoss.Arbeit.ceiling
Items:
======
Erdgeschoss.Arbeit.ceiling = False
> update Erdgeschoss.Arbeit.ceiling = 1
> ls Erdgeschoss.Arbeit.ceiling
Items:
======
Erdgeschoss.Arbeit.ceiling = True
> update Erdgeschoss.Arbeit.ceiling = 0
Unter dem Port 2323 läuft nix:
netstat -nlt
Nun meine Fragen:
- Warum läuft der CLI nicht? Wie teste ich den Smarthome-Teil?
- Wie ist SmartVisu mit Smarthome verbunden? Also, wie hängt z.B. /var/www/smartvisu/pages/<irgendwas> mit /usr/local/smarthome/items/<irgendwas> zusammen? Gibt es ein schlaues Script, das die HTML-Seiten anhand der items erst Mal zusammenbaut?
Ich sehe hier schöne Diskussionen, die für mich mittendrin anfangen, so als wenn ich einen Film nicht von Anfang an mitbekommen habe und ich verstehe deshalb die Handlung nicht.
Gruß Holgi
nach langer Abstinenz schaue ich mal wieder hier rein und versuche, die Geschichte zum Laufen zu bringen.
Das habe ich gemacht:
Hardware
- Raspberry PI B (erste Version)
- ROT a RTC-OneWire-TPUART (EIB/KNX) extension for Raspberry Pi
Image-File
Download von https://sourceforge.net/projects/sma...4.zip/download
Expand Filesystem
df -h 15:19:42
Dateisystem Größe Benutzt Verf. Verw% Eingehängt auf
/dev/root 2,0G 1,7G 166M 92% /
devtmpfs 182M 0 182M 0% /dev
tmpfs 186M 0 186M 0% /dev/shm
tmpfs 186M 4,6M 182M 3% /run
tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs 186M 0 186M 0% /sys/fs/cgroup
/dev/mmcblk0p1 63M 22M 42M 34% /boot
sudo raspi-config
Filesytem erweitert.
Reboot
df -h 15:22:30
Dateisystem Größe Benutzt Verf. Verw% Eingehängt auf
/dev/root 3,5G 1,7G 1,7G 51% /
devtmpfs 182M 0 182M 0% /dev
tmpfs 186M 0 186M 0% /dev/shm
tmpfs 186M 4,5M 182M 3% /run
tmpfs 5,0M 8,0K 5,0M 1% /run/lock
tmpfs 186M 0 186M 0% /sys/fs/cgroup
/dev/mmcblk0p1 63M 22M 42M 34% /boot
Aktualisieren der Pakete
sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove
sudo apt-get autoclean
Device für knxd
Damit der knxd über ein Device auf den Bus lesen und schreiben kann, wird ein Link unter /dev/ttyKNX1 eingerichtet. In diesem Abschnitt hat nach dem Boot mit aufgesteckter ROT-Schnittstelle alles gepasst.
Zur Kontrolle habe ich die Parameter der ROT-Schnittstelle festgestellt:
sudo udevadm info -a /dev/ttyAMA0
Code:
Udevadm info starts with the device specified by the devpath and then walks up the chain of parent devices. It prints for every device found, all possible attributes in the udev rules key format. A rule to match, can be composed by the attributes of the device and the attributes from one single parent device. looking at device '/devices/platform/soc/20201000.uart/tty/ttyAMA0': KERNEL=="ttyAMA0" SUBSYSTEM=="tty" DRIVER=="" ATTR{irq}=="81" ATTR{line}=="0" ATTR{port}=="0x0" ATTR{type}=="32" ATTR{flags}=="0x10000000" ATTR{iomem_base}=="0x20201000" ATTR{custom_divisor}=="0" ATTR{iomem_reg_shift}=="0" ATTR{uartclk}=="0" ATTR{xmit_fifo_size}=="16" ATTR{close_delay}=="50" ATTR{closing_wait}=="3000" ATTR{io_type}=="2" looking at parent device '/devices/platform/soc/20201000.uart': KERNELS=="20201000.uart" SUBSYSTEMS=="amba" DRIVERS=="uart-pl011" ATTRS{id}=="00241011" ATTRS{irq0}=="81" ATTRS{driver_override}=="" looking at parent device '/devices/platform/soc': KERNELS=="soc" SUBSYSTEMS=="platform" DRIVERS=="" ATTRS{driver_override}=="(null)" looking at parent device '/devices/platform': KERNELS=="platform" SUBSYSTEMS=="" DRIVERS==""
cat /etc/udev/rules.d/70-knxd.rules
Code:
# The following rule does nothing unless you replace the 'something' with the actual USB path of your TPUART interface. # Run "udevadm info --attribute-walk /sys/bus/usb/drivers/cdc_acm/*/tty/ttyACM0", look at the third block (the one with 'ATTRS{manufacturer}=="busware.de"'). # ACTION=="add", SUBSYSTEM=="tty", ATTRS{id}=="00241011", KERNELS=="20201000.uart", SYMLINK+="ttyKNX1", OWNER="knxd"
lrwxrwxrwx 1 root root 7 Apr 12 15:54 ttyKNX1 -> ttyAMA0
Ich hatte erwartet, dass der Link dem User knxd gehört. Immerhin gehört /dev/ttyAMA0 dem User knxd und der Gruppe dialout:
crw-rw---- 1 knxd dialout 204, 64 Apr 12 15:54 ttyAMA0
knxd konfigurieren
sudo vi /etc/knxd.conf
Code:
# You could also use the new ini file for configuration. Comment out everything except the following line # # configuration for knxd.service START_KNXD=YES KNXD_OPTS="-e 1.1.254 -E 1.1.255:2 -DTRS -t 0xffc -f 9 -b tpuarts:/dev/ttyKNX1"
sudo /etc/init.d/knxd restart
knxd testen
Nun habe ich ein paar Tests durchgeführt:
knxtool groupswrite local: 1/0/6 1 # Deckenlampe Buero an
knxtool groupswrite local: 1/0/6 0 # Deckenlampe Buero aus
knxtool groupswrite local: 1/1/2 1 # Rollladen Buero runter
knxtool groupswrite local: 1/1/2 0 # Rollladen Buero rauf
knxtool on local: 1/0/6 # Deckenlampe Buero an
knxtool off local: 1/0/6 # Deckenlampe Buero aus
Funktioniert!
Startbild kommt unter http://raspberrypi/smartvisu/index.php?page=config
Smarthome Teil
Unter /usr/local/smarthome/items habe ich eine Konfiguration abgelegt:
cat Erdgeschoss.conf
Code:
[Erdgeschoss] [[Wohnzimmer]] name = Wohnzimmer sv_page = room sv_img = scene_livingroom.png [[Kueche]] name = Kueche sv_page = room sv_img = scene_cooking.png [[Diele]] name = Diele sv_page = room sv_img = scene_dinner.png [[Toilette]] name = Toilette sv_page = room sv_img = scene_toilet_alternat.png [[Bad]] name = Bad sv_page = room sv_img = scene_bath.png [[Schlafzimmer]] name = Schlafzimmer sv_page = room sv_img = scene_sleeping.png [[Hauswirtschaftsraum]] name = Hauswirtschaftsraum sv_page = room sv_img = scene_laundry_room.png [[Windfang]] name = Windfang sv_page = room sv_img = scene_corridor.png [[Arbeit]] name = Arbeitszimmer sv_page = room sv_img = scene_office.png [[[light]]] [[[ceiling]]] name = Deckenlicht type = bool visu = yes knx_dpt = 1 knx_send = 1/0/6 knx_listen = 1/6/6 knx_init = 1/6/6 sv_widget = {{ basic.switch('item', 'item', icon1~'light_ceiling_light.png', icon0~'light_ceiling_light.png') }} Deckenlicht #sv_widget = {{ basic.switch('S1', 'Arbeit.Deckenlicht', icon1~'light_ceiling_light.png', icon0~'light_ceiling_light.png') }} Deckenlicht
sudo su - smarthome
cd /usr/local/smarthome/etc
vi plugin.conf
Code:
# plugin.conf # Der BackendServer stellt eine Übersicht zur Laufzeit dar und liefert Informationen ähnlich wie das CLI Plugin # Der Zugriff erfolgt über http://<IP oder Name des SmartHomeNG Servers bzw. ip>:<port> # port wird als Attribut weiter unten definiert # das Passwort ist zunächst im Klartext anzugeben. In neueren Versionen wird es eine Funktion im Backend geben, # die aus einem gegebenen Passwort einen Hash erzeugt. Wenn user oder password fehlen gibt es keine Abfrage [BackendServer] class_name = BackendServer class_path = plugins.backend #ip = xxx.xxx.xxx.xxx port = 8383 updates_allowed = True threads = 8 user = admin password = XXXX language = de [knx] class_name = KNX class_path = plugins.knx host = 127.0.0.1 port = 6720 # send_time = 600 # update date/time every 600 seconds, default none # time_ga = 1/1/1 # default none # date_ga = 1/1/2 # default none # Bereitstellung eines Websockets zur Kommunikation zwischen SmartVISU und SmartHomeNG [visu] class_name = WebSocket class_path = plugins.visu_websocket # ip = 0.0.0.0 # port = 2424 # tls = no wsproto = 4 acl = rw # Autogenerierung von Webseiten für SmartVISU [smartvisu] class_name = SmartVisu class_path = plugins.visu_smartvisu # "neue" Linux Versionen (z.B. Debian Jessie 8.x, Ubuntu > 14.x) smartvisu_dir = /var/www/html/smartVISU # nur "alte" Linux-Variationen #smartvisu_dir = /var/www/smartVISU # generate_pages = True # handle_widgets = True # overwrite_templates = Yes # visu_style = blk # Command Line Interface # wichtig für Funktionsprüfungen solange keine Visu zur Verfügung steht [cli] class_name = CLI class_path = plugins.cli ip = 127.0.0.1 port = 2323 update = True # alter SQL-Treiber #[sql] # class_name = SQL # class_path = plugins.sqlite #SQL-Treiber, unterstützt auch die SmartVISU 2.8/2.9 # dazu muß im websocket plugin zwingend die Protokollversion 4 eingetragen sein [sql] class_name = SQL class_path = plugins.sqlite_visu2_8 # Onewire Plugin #[ow] # class_name = OneWire # class_path = plugins.onewire
touch logic.conf
cd /var/www/html
sudo ln -s ../smartvisu . # Fuer neuen und alten HTML-Pfad
Smarthome testen
telnet localhost 2323
Trying ::1...
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
Geht anscheinend nicht mehr. Im Vorgängerimage hat es noch funktioniert:
> update Erdgeschoss.Arbeit.ceiling = 0
> ls Erdgeschoss.Arbeit.ceiling
Items:
======
Erdgeschoss.Arbeit.ceiling = False
> update Erdgeschoss.Arbeit.ceiling = 1
> ls Erdgeschoss.Arbeit.ceiling
Items:
======
Erdgeschoss.Arbeit.ceiling = True
> update Erdgeschoss.Arbeit.ceiling = 0
Unter dem Port 2323 läuft nix:
netstat -nlt
Code:
Aktive Internetverbindungen (Nur Server) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:2424 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:44921 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:48794 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:6011 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:58173 0.0.0.0:* LISTEN tcp 0 0 192.168.178.51:8383 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:2049 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:55885 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN tcp6 0 0 :::80 :::* LISTEN tcp6 0 0 :::22 :::* LISTEN tcp6 0 0 :::50167 :::* LISTEN tcp6 0 0 :::47259 :::* LISTEN tcp6 0 0 :::445 :::* LISTEN tcp6 0 0 :::51069 :::* LISTEN tcp6 0 0 :::6720 :::* LISTEN tcp6 0 0 :::2049 :::* LISTEN tcp6 0 0 :::43877 :::* LISTEN tcp6 0 0 :::139 :::* LISTEN tcp6 0 0 :::111 :::* LISTEN
- Warum läuft der CLI nicht? Wie teste ich den Smarthome-Teil?
- Wie ist SmartVisu mit Smarthome verbunden? Also, wie hängt z.B. /var/www/smartvisu/pages/<irgendwas> mit /usr/local/smarthome/items/<irgendwas> zusammen? Gibt es ein schlaues Script, das die HTML-Seiten anhand der items erst Mal zusammenbaut?
Ich sehe hier schöne Diskussionen, die für mich mittendrin anfangen, so als wenn ich einen Film nicht von Anfang an mitbekommen habe und ich verstehe deshalb die Handlung nicht.
Gruß Holgi
Kommentar