Hi All,
During my recent adventure with the KNX Binding, I found the following:
With config:OpenHab 2.0.0-SNAPSHOT (Build #533) on Raspberry Pi 3 using KNX Binding 1.9.0.SNAPSHOT (1.9.0.201610130111)
Problem Description:
When the KNX configuration is changed from TUNNEL to ROUTER type in /etc/openhab2/services/knx.cfg
and the OpenHab service is restarted, an error is generated: “non-valid routing multicast”
How to replicate:
0) (optional) Enable at least ERROR log output level on the org.apache.felix.configadmin: log:set ERROR org.apache.felix.configadmin
(from the karaf console while OH2 is running with ssh openhab@localhost -p 8101 with password habopen)
-
Stop OpenHab 2 service (/etc/init.d/openhab2 stop)
-
Configure /etc/openhab2/services/knx.cfg with the following settings:
ip=<ip_address_of_KNX_gateway> (example: 172.16.13.200)
type=TUNNEL (optional, defaults to TUNNEL)
port=3671 (optional, defaults to 3671)
localIp=<ip_address_of_local endpoint> (example: 172.16.13.101)
- Start OpenHab 2 service (/etc/init.d/openhab2 start) and let it load up (give it 1 min)
- Stop OpenHab 2 service (/etc/init.d/openhab2 stop)
- Change the configuration of /etc/openhab2/services/knx.cfg with the following settings (only that):
type=ROUTER
- Start OpenHab 2 service (/etc/init.d/openhab2 start)
- Observe /var/log/openhab2/openhab2.log (or log:display |grep knx) for entry with info “non-valid routing multicast”
2016-10-14 13:46:11.612 [ERROR] [org.apache.felix.configadmin ] - [org.osgi.service.cm.ManagedService, id=302, bundle=194/mvn:org.openhab.binding/org.openhab.binding.knx/1.9.0-SNAPSHOT]: Unexpected problem updating configuration org.openhab.knx
tuwien.auto.calimero.exception.KNXIllegalArgumentException: non-valid routing multicast /172.16.13.200
at tuwien.auto.calimero.knxnetip.KNXnetIPRouting.<init>(KNXnetIPRouting.java:121)[194:org.openhab.binding.knx:1.9.0.201610130111]
at tuwien.auto.calimero.knxnetip.KNXnetIPRouting.<init>(KNXnetIPRouting.java:104)[194:org.openhab.binding.knx:1.9.0.201610130111]
at tuwien.auto.calimero.link.KNXNetworkLinkIP.<init>(KNXNetworkLinkIP.java:192)[194:org.openhab.binding.knx:1.9.0.201610130111]
at org.openhab.binding.knx.internal.connection.KNXConnection.connectByIp(KNXConnection.java:292)[194:org.openhab.binding.knx:1.9.0.201610130111]
at org.openhab.binding.knx.internal.connection.KNXConnection.connect(KNXConnection.java:179)[194:org.openhab.binding.knx:1.9.0.201610130111]
at org.openhab.binding.knx.internal.connection.KNXConnection.updated(KNXConnection.java:448)[194:org.openhab.binding.knx:1.9.0.201610130111]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189)[7:org.apache.felix.configadmin:1.8.8]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152)[7:org.apache.felix.configadmin:1.8.8]
at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)[7:org.apache.felix.configadmin:1.8.8]
at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1444)[7:org.apache.felix.configadmin:1.8.8]
at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1400)[7:org.apache.felix.configadmin:1.8.8]
at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:143)[7:org.apache.felix.configadmin:1.8.8]
at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:110)[7:org.apache.felix.configadmin:1.8.8]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_65]
Root-cause:
The configuration of the KNX Binding in Karaf retains the ip setting from the tunneling setup and tries to use it when re-configuration is done in Router mode.
Workarounds:
- Remember to set ip=224.0.23.12 (the default multicast IP Address for KNXnet/IP) when using type=ROUTER in order to overwrite the already stored ip setting (if changing from a previous Tunnel configuration)
or - Remove the already stored ip setting from the karaf console with:
config:edit org.openhab.knx
config:property-delete ip
or remove all settings from the existing, already stored KNX Binding config with config:delete org.openhab.knx
in Karaf console and restart OpenHab 2 to reload from scratch the /etc/openhab2/services/knx.cfg file
Maybe, upon startup, the OpenHab 2 service should clear out the existing org.openhab.knx config stored in the system and load clean the knx.cfg file to avoid this kind of problems?
BR,
Angelos