knxd: Add uci config and knxd_args to ini convert
authorPatrick Grimm <patrick@lunatiki.de>
Fri, 6 Oct 2017 12:51:22 +0000 (14:51 +0200)
committerPatrick Grimm <patrick@lunatiki.de>
Fri, 6 Oct 2017 12:51:22 +0000 (14:51 +0200)
Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
net/knxd/Makefile
net/knxd/files/knxd.config [new file with mode: 0644]
net/knxd/files/knxd.init

index 78a45e4d9eab20f8b88922c53d639bdd69805376..b77860dc2f2af79c441e1e481b6847681fc082d0 100644 (file)
@@ -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 (file)
index 0000000..81dacaa
--- /dev/null
@@ -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:'
index 0af797269eec43e7092e7313793a055f9c6eebf2..6d00e13bd745eb411d1fd2f64d6de07dd7ebe21f 100644 (file)
@@ -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
 }