From 53caa112be2a1dce87a16f07aa598dce1fe143d3 Mon Sep 17 00:00:00 2001 From: Patrick Grimm Date: Fri, 6 Oct 2017 14:12:48 +0200 Subject: [PATCH 1/3] knxd: Fix config file location and init script. Signed-off-by: Patrick Grimm --- net/knxd/Makefile | 6 +++--- net/knxd/files/knxd.init | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net/knxd/Makefile b/net/knxd/Makefile index 76711f3f9..78a45e4d9 100644 --- a/net/knxd/Makefile +++ b/net/knxd/Makefile @@ -12,7 +12,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=knxd PKG_VERSION:=0.14.18 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/knxd/knxd.git @@ -47,7 +47,7 @@ EIB KNX Daemon endef define Package/knxd/conffiles -/etc/config/knxd.ini +/etc/knxd.ini endef TARGET_CXXFLAGS+= -std=c++0x @@ -72,7 +72,7 @@ define Package/knxd/install $(INSTALL_BIN) ./files/knxd.init $(1)/etc/init.d/knxd $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_DATA) ./files/knxd.ini $(1)/etc/config/knxd.ini + $(INSTALL_DATA) ./files/knxd.ini $(1)/etc/knxd.ini endef $(eval $(call BuildPackage,knxd)) diff --git a/net/knxd/files/knxd.init b/net/knxd/files/knxd.init index d3f847555..0af797269 100644 --- a/net/knxd/files/knxd.init +++ b/net/knxd/files/knxd.init @@ -54,7 +54,7 @@ start_service() { append_parm args listen_local "listen-local" "/var/run/knxd" config_get url args url procd_open_instance - procd_set_param command $PROG $params $url + procd_set_param command $PROG "/etc/knxd.ini" procd_set_param respawn procd_close_instance } From ade26942acf2bdb5cb4920216b8a159358c0331d Mon Sep 17 00:00:00 2001 From: Patrick Grimm Date: Fri, 6 Oct 2017 14:51:22 +0200 Subject: [PATCH 2/3] knxd: Add uci config and knxd_args to ini convert Signed-off-by: Patrick Grimm --- net/knxd/Makefile | 2 ++ net/knxd/files/knxd.config | 43 ++++++++++++++++++++++++++++++++++++++ net/knxd/files/knxd.init | 11 +++++++--- 3 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 net/knxd/files/knxd.config diff --git a/net/knxd/Makefile b/net/knxd/Makefile index 78a45e4d9..b77860dc2 100644 --- a/net/knxd/Makefile +++ b/net/knxd/Makefile @@ -48,6 +48,7 @@ endef define Package/knxd/conffiles /etc/knxd.ini +/etc/config/knxd endef TARGET_CXXFLAGS+= -std=c++0x @@ -73,6 +74,7 @@ define Package/knxd/install $(INSTALL_DIR) $(1)/etc/config $(INSTALL_DATA) ./files/knxd.ini $(1)/etc/knxd.ini + $(INSTALL_DATA) ./files/knxd.config $(1)/etc/config/knxd endef $(eval $(call BuildPackage,knxd)) diff --git a/net/knxd/files/knxd.config b/net/knxd/files/knxd.config new file mode 100644 index 000000000..81dacaabd --- /dev/null +++ b/net/knxd/files/knxd.config @@ -0,0 +1,43 @@ +config daemon args + # driver:[arg] a Layer-2 driver to use (knxd supports more than one) + #option layer2 "" + # enable caching of group communication networkstate + option GroupCache 0 + # FILE start the programm as daemon. Output will be written to FILE if given + option daemon "/var/log/knxd.log" + #enable the EIBnet/IP server to answer discovery and description requests (SEARCH, DESCRIPTION) + option Discovery 1 + # EIBADDR set our EIB address to EIBADDR (default 0.0.1) + option eibaddr "0.0.2" + # LEVEL set error level + option error 0 + # PORT listen at TCP port PORT (default 6720) + option listen_tcp "6720" + # wait for L_Data_ind while sending (for all EMI based backends) + option no_emisend_queuing 0 + # SERVERNAME name of the EIBnet/IP server (default is 'knxd') + option Name "KNX2" + # do not assume KNXnet/IP Tunneling bus interface can handle parallel cEMI requests + option no_tunnel_client_queuing 0 + # the next Layer2 interface may not enter monitor mode + option no_monitor 0 + # enable EIBnet/IP Routing in the EIBnet/IP server + option Routing 1 + # [ip[:port]] starts an EIBnet/IP multicast server + option Server '224.0.23.12' + # MASK set trace flags (bitmask) + option trace 0 + # tpuarts backend should generate L2 acks for all group telegrams + option tpuarts_ack_all_group 0 + # tpuarts backend should generate L2 acks for all individual telegrams + option tpuarts_ack_all_individual 0 + # tpuarts backend should should use a full interface reset (for Disch TPUART interfaces) + option tpuarts_disch_reset 0 + # enable EIBnet/IP Tunneling in the EIBnet/IP server + option Tunnelling 1 + # FILE listen at Unix domain socket FILE (default /tmp/eib) + option listen_local "/var/run/knxd" + # example with tpuarts interface + # option url 'tpuarts:/dev/ttyAMA0' + # example with IP interface in tunnel mode + option url 'usb:' diff --git a/net/knxd/files/knxd.init b/net/knxd/files/knxd.init index 0af797269..6d00e13bd 100644 --- a/net/knxd/files/knxd.init +++ b/net/knxd/files/knxd.init @@ -37,7 +37,6 @@ start_service() { append_parm args layer2 "layer2" append_bool args GroupCache "GroupCache" 0 append_parm args daemon "daemon" "/var/log/knxd.log" - append_bool args Discovery "Discovery" 1 append_parm args error "error" # "5" append_parm args listen_tcp "listen-tcp" "6720" append_parm args Interface "Interface" # "eth0" @@ -50,11 +49,17 @@ start_service() { append_bool args tpuarts_ack_all_individual "tpuarts-ack-all-individual" 0 append_bool args tpuarts_disch_reset "tpuarts-disch-reset" 0 append_bool args Tunnelling "Tunnelling" 1 - append_bool args Server "Server" 1 + append_bool args Discovery "Discovery" 1 + append_parm args Server "Server" "224.0.23.12" append_parm args listen_local "listen-local" "/var/run/knxd" config_get url args url + if [ "$url" == "usb:" ] ; then + url="usb:""$(findknxusb | tail -n1 | sed -e 's/device: \([0-9]:[0-9]:[0-9]\):[0-9].*/\1/')" + fi + echo "/usr/lib/knxd_args $params $url" + /usr/lib/knxd_args $params $url > /tmp/etc/knxd.ini procd_open_instance - procd_set_param command $PROG "/etc/knxd.ini" + procd_set_param command $PROG "/tmp/etc/knxd.ini" procd_set_param respawn procd_close_instance } From 596e2288844f0a89e9604327a8316ffa25135a95 Mon Sep 17 00:00:00 2001 From: Patrick Grimm Date: Fri, 6 Oct 2017 15:58:24 +0200 Subject: [PATCH 3/3] =?UTF-8?q?knxd:=20Fix=20typo=20in=20sh=20vars=20?= =?UTF-8?q?=E2=80=9Esend-delay=E2=80=9C=20and=20=E2=80=9Eclient-addrs?= =?UTF-8?q?=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick Grimm --- net/knxd/files/knxd.init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/knxd/files/knxd.init b/net/knxd/files/knxd.init index 6d00e13bd..92a08a12a 100644 --- a/net/knxd/files/knxd.init +++ b/net/knxd/files/knxd.init @@ -33,14 +33,14 @@ start_service() { local options url config_load knxd append_parm args eibaddr "eibaddr" "0.0.1" - append_parm args client-addrs "client-addrs" "0.0.2:10" + append_parm args client_addrs "client-addrs" "0.0.2:10" append_parm args layer2 "layer2" append_bool args GroupCache "GroupCache" 0 append_parm args daemon "daemon" "/var/log/knxd.log" append_parm args error "error" # "5" append_parm args listen_tcp "listen-tcp" "6720" append_parm args Interface "Interface" # "eth0" - append_parm args send-delay "send-delay" # "50" + append_parm args send_delay "send-delay" # "50" append_parm args Name "Name" "OpenWrt" append_bool args no_monitor "no-monitor" 0 append_bool args Routing "Routing" 0