Ankündigung

Einklappen
Keine Ankündigung bisher.

openhab2 auf Pi mit knx verbinden - Anfänger

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    #46
    Zitat von udo1toni Beitrag anzeigen
    Du könntest mal Deine knxd Konfiguration zeigen, das wäre sicher hilfreich beim Finden der richtigen Konfiguration.
    meine knxd Konfiguration schaut folgendermaßen aus:

    Code:
    # configuration for knxd.service
    
    #KNXD_OPTS="-e 0.0.1 -E 0.0.2:8 -u /tmp/eib -b ip:"
    KNXD_OPTS="-t 1023 -e 0.0.1 -E 0.0.2:8 -u /tmp/eib -t 1023 -b usb:"
    #KNXD_OPTS="-t 1023 -e 192.168.178.239  -E 192.168.178.240:8 -u /tmp/eib -D -T -R -S -t 1023 -b usb:"
    # The default options are "-u /tmp/eib -b ip:"
    # which tell knxd to route between all of
    #  /tmp/eib (legacy socket (-u))
    #  multicast client (-b ip:).
    # knxd's own bus address is 0.0.1; it will assign 0.0.2?^`?0.0.9 to clients.
    # The knxd.socket file also tells knxd to listen to
    #  /run/eib (socket activation via systemd)
    #  TCP port 6720 (socket activation via systemd)
    # You *need* the -e option. Clients cannot connect without "-E".
    
    # You can read knxd's logs with
    # $ journalctl -u knxd --since "10 min ago"
    # (or whatever). See the manpage for details.
    # You need to be a member of the "adm" group.
    # Add "-f9 -t1023" to the beginning of the command line for extensive logging.
    
    # *** DO NOT use "-u" / "-u /run/knx" or "-i" / "-i 6720" here.
    # Systemd already does that on behalf of knxd, via 'knx.socket'.
    
    # *** DO NOT use both "-RS" and "-b ip:" (unless you specify a
    # different multicast address on one of them). You'd create a loop.
    
    # If you have KNX hardware on a serial port or USB, add the appropriate
    # "-b TYPE:?^`?" option. In this case, you probably want to set up a multicast
    # server, not a client (i.e. use "-D -T -R -S", not "-b ip:").
    # DO NOT use both.
    #
    # If your KNX hardware is a KNX/IP gateway that doesn't do multicast,
    # use "-b ipt:192.168.1.2" (or its DNS name) to talk to it.
    #
    # KNX MUST NOT have more than one path between any two devices. Thus,
    # you need to make sure that the KNX/IP gateway does not route multicast
    # before you use both "-S" and "-b ipt:".
    
    # The default bus address of knxd is 0.0.1. If that's in use in your KNX
    # network (or if you run more than one knxd on your network), set a
    # different address, for example "-e 7.0.99".
    
    # You should have a block of free addresses on your KNX bus which knxd can
    # assign to clients: "-E 7.0.100:28" will use 7.0.100 through 7.0.127.
    # If no such range is given, or if it's full, knxd uses its own address.
    # That mostly works, but separate addresses are much better.
    # different multicast address on one of them). You'd create a loop.
    
    # If you have KNX hardware on a serial port or USB, add the appropriate
    # "-b TYPE:?^`?" option. In this case, you probably want to set up a multicast
    # server, not a client (i.e. use "-D -T -R -S", not "-b ip:").
    # DO NOT use both.
    #
    # If your KNX hardware is a KNX/IP gateway that doesn't do multicast,
    # use "-b ipt:192.168.1.2" (or its DNS name) to talk to it.
    #
    # KNX MUST NOT have more than one path between any two devices. Thus,
    # you need to make sure that the KNX/IP gateway does not route multicast
    # before you use both "-S" and "-b ipt:".
    
    # The default bus address of knxd is 0.0.1. If that's in use in your KNX
    # network (or if you run more than one knxd on your network), set a
    # different address, for example "-e 7.0.99".
    
    # You should have a block of free addresses on your KNX bus which knxd can
    # assign to clients: "-E 7.0.100:28" will use 7.0.100 through 7.0.127.
    # If no such range is given, or if it's full, knxd uses its own address.
    # That mostly works, but separate addresses are much better.
    
    # Run `knxd --help` to get a complete list of available options and drivers.
    
    ## DO NOT use the following options:
    ## -i           -- /lib/systemd/system/knxd.socket does this for us
    ## -u /run/knx  -- likewise
    ## -d           -- /lib/systemd/system/knxd.service expects knxd to run in the foreground
    ## -p PIDFILE   -- please use systemctl to control knxd
    
    ###############################################################################
    # This file is ignored when NOT using systemd: edit /etc/default/knxd instead #
    ###############################################################################
    und die knx.cfg von openHAB so:

    Code:
    # KNX gateway IP address
    # (optional, if serialPort or connection type 'ROUTER' is specified)
    #ip=224.00.23.12
    ip=127.0.0.1
    
    # Local KNX Binding bus address.
    # Use it, when two or more openHAB Instances are connected to the same KNX bus.
    # (optional, defaults to 0.0.0)
    #busaddr=192.168.178.23
    #busaddr=1.1.34
    # Ignore local KNX Events, prevents internal events coming from
    # 'openHAB event bus' a second time to be sent back to the 'openHAB event bus'.
    # Note: To send back events second time is a Bug, but for backward compatibility, the behavior is not changed.
    # For new installations, its recommend to set "ignorelocalevents=true"
    # (optional, defaults to false)
    #ignorelocalevents=
    
    # KNX IP connection type. Could be either TUNNEL or ROUTER (optional, defaults to TUNNEL)
    # Note: If you cannot get the ROUTER mode working (even if it claims it is connected),
    # use TUNNEL mode instead with setting both the ip of the KNX gateway and the localIp.
    #type=ROUTER
    type=TUNNEL
    
    # KNX gateway port (optional, defaults to 3671)
    # Note: If you use eibd, setting to 6720
    port=3671
    
    # Local endpoint to specify the multicast interface, no port is used (optional)
    #localIp=192.168.178.23
    
    # Serial port of FT1.2 KNX interface (ignored, if ip is specified)
    # Valid values are e.g. COM1 for Windows and /dev/ttyS0 or /dev/ttyUSB0 for Linux
    #serialPort=/dev/ttyUSB0
    
    # Pause in milliseconds between two read requests on the KNX bus during
    # initialization (optional, defaults to 50)
    #pause=
    
    # Timeout in milliseconds to wait for a response from the KNX bus (optional,
    # defaults to 10000)
    #timeout
    
    # Number of read retries while initialization items from the KNX bus (optional,
    # defaults to 3)
    #readRetries
    
    # Seconds between connect retries when KNX link has been lost
    # 0 means never retry, it will only reconnect on next write or read request
    # Note: without periodic retries all events will be lost up to the next read/write

    Kommentar


      #47
      Ändere bitte die 2. Zeile in knxd.conf ab nach
      Code:
      KNXD_OPTS="-e 0.0.1 -E 0.0.2:8 -DTRS -b usb:"
      (stimmt es, dass Du ein usb-Interface einsetzt?)
      und in der knx.cfg bitte
      Code:
      ignorelocalevents=true
      type=ROUTER
      port=6720
      localIp=192.168.178.23
      oder wahlweise
      Code:
      ip=127.0.0.1  
      ignorelocalevents=true
      type=TUNNEL  
      port=6720
      localIp=192.168.178.23
      wobei 192.168.178.23 die IP des Rechners ist, auf dem openHAB läuft.

      Kommentar


        #48
        Ja ich hab eine USB Schnittstelle.

        ich hab jetzt beide Varianten ausprobiert aber leider ohne Erfolg

        Kommentar


          #49
          Vermutlich musst Du die usb-Hardware näher spezifizieren.

          Kommentar


            #50
            Ich weiß meine Hardware aber was davon soll ich wo eintragen?

            device: 1:4:1:0:0 (Gira Giersiepen GmbH & Co. KG:KNX-USB Data Interface)

            Kommentar


              #51
              Dann heißt die entsprechende Option in KNXD_OPTS vermutlich -b usb:1:4:1:0:0

              Kommentar


                #52
                Hab es ausprobiert leider auch wieder ohne Erfolg. Hab aber festgestellt dass ich vor lauter probieren nun drei conf hab. Vielleicht liegt es ja auch daran?

                /etc/default/knxd
                Code:
                START_KNXD=YES
                KNXD_OPTS="-e 0.0.1 -E 0.0.2:8 -DTRS -b usb:1:4:1:0:0"
                /etc/openhab2/services/knx.cfg
                Code:
                ip=127.0.0.1
                busaddr=1.1.17
                type=TUNNEL
                port=3671
                localIp=192.168.178.23
                knxd/systemd/knxd.conf
                Code:
                KNXD_OPTS="-e 0.0.1 -E 0.0.2:8 -DTRS -b usb:1:4:1:0:0"

                Kommentar


                  #53
                  Also mal zur Erklärung: Die Option -e 0.0.1 bedeutet, knxd benutzt für sich selbst gegenüber dem knx Bus die Busadresse 0.0.1.
                  Die Option -E 0.0.2:8 bedeutet, dass knxd Clients akzeptiert, die die Busadressen 0.0.2 bis 0.0.9 verwenden. Weshalb Du in der knx.cfg natürlich eine Busadresse aus diesem Bereich verwenden musst.
                  knxd verwenden als Standard Port nicht 3671, sondern 6720. Wenn Du das nicht explizit änderst (mit einem zusätzlichen Parameter für knxd), musst Du in der knx.cfg den port aus 6720 setzen.

                  Welche der Konfigurationsdateien knxd nun benutzt, kann ich Dir auch nicht sagen. Im Zweifel lösche die knxd.conf (oder verschiebe sie aus dem Verzeichnis an einen anderen Ort) und versuche, knxd zu starten (mittels sudo systemctl start knxd.service). Wenn es keine Fehlermeldung gibt, kannst Du mit systemctl status knxd.service erfahren, welche Parameter knxd verwendet. Wahlweise kannst Du Dir auch mit ps aux | grep knxd anschauen, was die Prozessliste anzeigt.
                  Wenn knxd läuft, kannst Du es mit sudo systemctl stop knxd.service wieder stoppen, einen Parameter verändern und erneut starten. Wenn der Status danach entsprechend anders aussieht, weißt Du, dass Du die richtige Datei bearbeitest.
                  Zuletzt geändert von udo1toni; 07.02.2018, 02:05.

                  Kommentar


                    #54
                    udo1toni, kleine Ergänzungen:
                    die Stardard Ports sind 3671/UDP und 6720/TCP. Es kommt somit darauf an, welches Transport-Protokoll der jeweilige Client impementiert.
                    Wenn ich mich nicht stark täusche, entspricht es einem Tipp von Smurf, für Clients eine Adresse ausserhalb des -E-Pools zu setzen, wenn sie dazu fähig sind - der -E-Pool wird für solche Clients genutzt, welche nicht im Stande sind von sich aus eine Adresse zu setzen.
                    Der eibd verwendet dafür jeweils einfach seine eigene Adresse, womit natürlich nur ein einziger Client unterstützt werden kann, was eine (untaugliche) Einschränkung darstellt. Trotzdem verbleiben wohl einige Anwender mit Schwierigkeiten bei der Anbindung von openHAB beim eibd.
                    EIB/KNX, VISU mit knxd + linknx + knxweb, Steuerbefehle via SMS und Email mit postfix + procmail

                    Kommentar


                      #55
                      So wie es aussieht kann ich in beiden confs. ändern was ich will weil knxd auf eine andere Datei zugreift

                      ps aux | grep knxd
                      Code:
                      knxd       886  0.1  0.4  15976  4504 ?        Ssl  18:58   0:00 /usr/bin/knxd -t 1023 -e 0.0.1 -E 0.0.2:8 -D -T -R -S -u /tmp/eib -t 1023 -b usb:
                      Aber eigentlich sollte es auch ohne Angabe der genauen USB-Bezeichnung funktionieren da ich knxd Version 0.14.22 hab.

                      Kommentar


                        #56
                        Zitat von Tru Beitrag anzeigen
                        udo1toni, kleine Ergänzungen:
                        Und hier noch die Bestätigung vom Master himself dafür, dass die openHAB Adresse ausserhalb des -E-Pools gesetzt sein muss:
                        https://knx-user-forum.de/forum/proj...74#post1193974

                        EIB/KNX, VISU mit knxd + linknx + knxweb, Steuerbefehle via SMS und Email mit postfix + procmail

                        Kommentar


                          #57
                          Wie schon erwähnt setze ich knxd nicht selbst ein. Aber damit kommt wieder etwas Licht ins Dunkel. Ich hab Teile der Doku ja schon das eine oder andere Mal gelesen, aber das hab ich bisher nicht rausgelesen. Und dann kommt leider ein weiteres Problem auf, nämlich, dass ignorelocalevents dann wohl nicht funktionieren kann, wenn knxd einfach die eigene Busadresse verwendet. Woran soll openHAB dann erkennen, dass ein Telegramm von openHAB selbst stammt?

                          Kommentar


                            #58
                            Zitat von udo1toni Beitrag anzeigen
                            Wie schon erwähnt setze ich knxd nicht selbst ein.
                            Und ich nicht openHAB, das gleicht sich also aus.
                            wenn knxd einfach die eigene Busadresse verwendet.
                            Wie kommst du denn darauf? Es ist eibd, das seine eigene Adresse verwendet, aber knxd ist ja eine Weiterentwicklung.


                            EIB/KNX, VISU mit knxd + linknx + knxweb, Steuerbefehle via SMS und Email mit postfix + procmail

                            Kommentar


                              #59
                              Ich dachte das gelesen zu haben.

                              Kommentar

                              Lädt...
                              X