KNXD
Allgemeines
Der KNX-Daemon stellt eine einfache Moeglichkeit dar, den KNX (TP) ueber PEI10(FT1.2), TPUART, IP (UDP), ... zu verbinden und mit den mitgelieferten Tools den KNX-Bus zu "bearbeiten".
Die Installationanleitung findet man hier.
Beim Kompilieren ist mit der configure-Option --enable-management ein Fehler aufgetreten.
--enable-busmonitor enable bus monitoring --enable-management enable management connections --enable-ft12 enable FT1.2 backend --enable-dummy enable do-nothing backend --enable-tpuart enable TPUART driver backends --enable-eibnetip enable simple multicast EIBnet/IP backend --enable-eibnetserver enable full-featured EIBnet/IP routing --enable-eibnetiptunnel enable EIBnet/IP tunneling backend --enable-usb enable USB backend --enable-eibnetipserver enable EIBnet/IP server frontend
Und --disable-systemd war auch notwendig. configure: error: Unable to find a suitable libsystemd library
Daemon Start
Ab Version 0.14 unterstützt knxd die Verwendung einer Konfigurationsdatei anstelle der langen Argumentliste.
Das Programm `knxd_args` (im Installationspfad src/server) erzeugt beim Aufruf mit den Kommandozeilenargumenten von knxd eine Konfigurationsdatei. Man kann diese Datei an KNXD mit `knxd <Dateiname>` uebergeben. (Tatsaechlich geschieht dies im Hintergrund, wenn Sie knxd auf die „alte“ Weise aufrufen.)
Wenn Sie knxd über systemd starten, können Sie mit der Zeile `KNXD_OPTS=/etc/knxd.ini` in `/etc/knxd.conf` auf Ihre Konfigurationsdatei verweisen.
Das Format der Konfigurationsdatei ist in `doc/inifile.rst` beschrieben.
knxd --usage
Usage: knxd [-DNRT?] [-A name=value] [-b driver:[arg]] [-B filter] [-c[SIZE]]
[-d[FILE]] [-e EIBADDR] [-E ADDRSTART] [-f LEVEL] [-i[PORT]]
[-I intf] [-n SERVERNAME] [-p FILE] [-S[ip[:port]]] [-t MASK]
[-u[FILE]] [--allow-forced-broadcast] [--arg=name=value]
[--layer2=driver:[arg]] [--filter=filter] [--GroupCache[=SIZE]]
[--daemon[=FILE]] [--Discovery] [--eibaddr=EIBADDR]
[--client-addrs=ADDRSTART] [--error=LEVEL] [--listen-tcp[=PORT]]
[--Interface=intf] [--multi-port] [--no-emi-send-queuing]
[--no-timestamp] [--no-tunnel-client-queuing] [--Name=SERVERNAME]
[--no-monitor] [--pid-file=FILE] [--Routing]
[--send-delay[=DELAY]] [--single-port] [--Server[=ip[:port]]]
[--tpuarts-ack-all-group] [--tpuarts-ack-all-individual]
[--tpuarts-disch-reset] [--trace=MASK] [--Tunnelling]
[--listen-local[=FILE]] [--help] [--usage] URL
Ich will hier nicht die ganze Seite uebersetzen, sondern nur so fuer mich aufbereiten, dass es schneller geht.
Die empfohlene Struktur ist folgende. Jede Sektion ist optional.
knxd [global-section][address-section][cache-section][multicast-server-section][local-listener-section][interface-sections] URL Sektion 1 Sektion 2 Sektion 3 Sektion 4 Sektion 5 Sektion 6
Ich habe hier bewusst die Reihenfolge alphabetisch belassen und die Zuordnung der Tabelle hinzugefuegt.
Grundstruktur aus knxd --help
| Optionsliste | |||||
|---|---|---|---|---|---|
| Sek- tion |
POSIX Notation |
Long | Bedeutung | Hinweise | |
| 4 | --allow-forced-broadcast | Treat routing counter 7 as per KNX spec (dangerous) | |||
| -A | --arg=name=value | an additional configuration item for the next filter or driver | |||
| 6 | -b | --layer2=driver:[arg] | a Layer-2 driver to use (knxd supports more than one) | ||
| -B | --filter=filter | a Layer-2 filter to use in front of the next driver | |||
| 3 | -c | --GroupCache[=SIZE] | enable caching of group communication network state | ||
| 1 | -d | --daemon[=FILE] | start the programm as daemon. Output will be written to FILE if given | ||
| 4 | -D | --Discovery | enable the EIBnet/IP server to answer discovery and description requests (SEARCH, DESCRIPTION) | ||
| 2 | -e | --eibaddr=EIBADDR | set our EIB address to EIBADDR (default 0.0.1) | ||
| 2 | -E | --client-addrs=ADDRSTART | assign addresses ADDRSTART through ADDRSTART+n to clients | ||
| 1 | -f | --error=LEVEL | set error level (default 3: warnings) | ||
| 5 | -i | --listen-tcp[=PORT] | listen at TCP port PORT (default 6720) | ||
| -I, | --Interface=intf | Interface to use | |||
| --multi-port | Use two ports for multicast. This lets you run multiple KNX processes. | ||||
| 6 | --no-emi-send-queuing | wait for ACK after transmitting packets. Obsolete, please use --send-delay=500 | |||
| --no-timestamp | don't print timestamps when logging | ||||
| 6 | --no-tunnel-client-queuing | wait 30msec between transmitting packets. Obsolete, please use --send-delay=30 | |||
| 4 | -n | --Name=SERVERNAME | name of the EIBnet/IP server (default is 'knxd') | ||
| 6 | -N | --no-monitor | the next Driver interface may not enter monitor mode | ||
| 1 | -p | --pid-file=FILE | write the PID of the process to FILE | ||
| 4 | -R | --Routing | enable EIBnet/IP Routing in the EIBnet/IP server | ||
| --send-delay[=DELAY] | wait after sending a packet | ||||
| --single-port | Use one common port for multicast. This is an ETS4/ETS5 bug workaround. | ||||
| 4 | -S | --Server[=ip[:port]] | starts an EIBnet/IP multicast server | ||
| 6 | --tpuarts-ack-all-grou | tpuarts backend should generate L2 acks for all group telegrams | |||
| 6 | --tpuarts-ack-all-individual | tpuarts backend should generate L2 acks for all individual telegrams | |||
| 6 | --tpuarts-disch-reset | tpuarts backend should should use a full interface reset (for Disch TPUART interfaces) | |||
| 1 | -t | --trace=MASK | set trace flags (bitmask) | ||
| 4 | -T | --Tunnelling | enable EIBnet/IP Tunneling in the EIBnet/IP server | ||
| 5 | -u | --listen-local[=FILE] | listen at Unix domain socket FILE (default /run/knx) | ||
| -? | --help | Give this help list | |||
| --usage | Give a short usage message | ||||
Supported interface drivers are:
ft12 connects over a serial line without any driver with the FT1.2 Protocol to a BCU 2
ip connects with the EIBnet/IP Routing protocol using the multicast address (supposedly to an EIBnet/IP gateway, or another knxd). The gateway must be configured to route the necessary addresses
ipt connects with the EIBnet/IP Tunneling protocol over an EIBnet/IP gateway. The gateway must be configured to route the necessary addresses
iptn is an old alias for ipt with a nat=true parameter. It connected with the EIBnet/IP Tunneling protocol over an EIBnet/IP gateway using NAT mode. You can't use this alias in the configuration file.
bcu1s connects using the PEI16 Protocol over a BCU to the bus (using an experimental user mode driver). It is no longer supported.
tpuarts connects to KNX using a TPUART (using a serial interface)
usb connects over a KNX USB interface (Famous HID-mode KNX interface)
ncn5120 connects to KNX using an NCN5120 with 38400 baud and 8-bit mode.
dummy is a no-op driver, used for testing only
tpuarttcp and ncn5120tcp use the same driver as their non-TCP counterparts, but connect to a remote host (where, presumably, socat or a similar program connects them to a serial port).
Note that -i, -u and -S also act as interfaces. More specifically, they cause knxd to dynamically create a new interface each time a client connects to them. (-R -S also creates a "real" interface, for multicasting.) Thus, -t and -f flags can also be used.
Beispiele
Auf meinem FHEM-Server laeuft knxd mit
/usr/local/bin/knxd -e 1.1.249 -E 1.1.250:4 -D -T -S -f 1 -c -B single --send-delay=50 -b ipt:192.168.178.13
Auf meinem Testrechner mit
knxd -f 9 -e 0.0.1 -E 0.0.2:8 -R -S -b ft12:/dev/ttyS0
knxd -f 9 -e 1.1.240 -E 1.1.241:8 -R -S -b ft12:/dev/ttyS0 I00000131: [ 1:main] 0.14.74: knxd -f 9 -e 1.1.240 -E 1.1.241:8 -R -S -b ft12:/dev/ttyS0 I00000129: [ 1:main] Connected: cfg:A.ft12. I00000129: [ 1:main] Connected: cfg:server. W00000125: [ 1:main] Consider using a config file. W00000126: [ 1:main] knxd should not run as root N00000127: [16:router.pace_] The 'pace' filter without a queue acts globally. E00000057: [13:A.ft12] reset timed out F00000105: [ 8:A.ft12] Link down, terminating N00000128: [ 1:main] Shutting down.