我在通过 USB
建立与 KNX
的连接时遇到一些问题。运行演示项目甚至我的项目都没有问题。
我已在 openHAB
上配置了我的房间,但无法建立连接,即使调试日志告诉我其他信息也是如此。
我的配置如下所示:
# KNX gateway IP address
# (optional, if serialPort or connection type 'ROUTER' is specified)
#knx:ip=
# 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.
knx:type=ROUTER
# KNX gateway port (optional, defaults to 3671)
# Note: If you use eibd, setting to 6720
#knx:port=
# Local endpoint to specify the multicast interface, no port is used (optional)
#knx:localIp=
# 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
#knx:serialPort=
调试日志告诉我以下内容:
10:01:06.867 [INFO ] [runtime.busevents :22 ] - Light_GF_Office received command ON
10:01:06.871 [INFO ] [tuwien.auto.calimero :51 ] - [qtp29372484-54] link 224.0.23.12:3671: send message to 0/0/6, wait for confirmation
10:01:06.871 [DEBUG] [.b.knx.internal.bus.KNXBinding:163 ] - Received groupWrite Event.
10:01:06.871 [INFO ] [tuwien.auto.calimero :51 ] - [KNXnet/IP receiver] link 224.0.23.12:3671: indication from 0.0.0
10:01:06.871 [INFO ] [runtime.busevents :22 ] - Light_GF_Office received command ON
10:01:06.871 [DEBUG] [.b.knx.internal.bus.KNXBinding:138 ] - Wrote value 'ON' to datapoint 'command DP 0/0/6 Light_GF_Office, DPT main 0 id 1.001, low priority'
因此与 KNX
总线的通信一定存在错误。如何配置 openhab.cfg
以通过我的 USB
端口进行通信。
最佳答案
您可能需要明确定义 KNX 接口(interface)所连接的 USB 端口的名称,如下所示:
knx:serialPort=/dev/ttyUSB0
您可以通过 grep 内核日志来找出这是哪个端口:
dmesg | grep ttyUSB
您还应该注释掉 ROUTER
定义,因为 USB 接口(interface)是与总线的直接连接。
关于ubuntu - 配置 openHAB 以使用 KNX 通过 USB 运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29385753/