KNX: works with interrupts

OH 2.2 (release build), Windows machine 64 bit
binding: knx v1.x
Network: all devices from Ubiquiti (USG, Switch, Access Points)

Dear all

a week I had to do a network upgrade which included assigning new IP adresses to all devices. With regards to OH I identified several places where to adjust the IP, in particular

  • in the knx.cfg
  • in ETS for the IP router (Enertex), everything is set to “route”
  • in Paper UI, System, network config

My problem now is that OH does not get all events/data from KNX. For example, the following chart displays outdoor temperatures, to be received every 2nd minute. As you can see in the chart: before the network upgrade it was working properly, after the upgrade I’m getting only in rare cases the events/data.

Also when checking the events.log I can see that there appear events, then it stops for a certain period (sometimes minutes, sometimes hours), then events are coming in again.

Do you have any idea what is still not yet updated correctly after the network upgrade?

Thanks & regards
John

I just restarted OH and did a KNX bus reset: after that it worked as expected for 3 minutes (at most).

After that one item after the other reports this:

23-Mai-2018 20:09:18.144 [WARN ] [ing.knx.internal.bus.KNXBindingDatapointReaderTask] - Autorefresh: Cannot read value for item 'Lueftung_Fan_Level' from KNX bus: timeout waiting for group read response: timeout
23-Mai-2018 20:09:18.144 [WARN ] [ing.knx.internal.bus.KNXBindingDatapointReaderTask] - Autorefresh: Give up, could not read address '11/0/5' after '3' retries.
23-Mai-2018 20:12:00.517 [WARN ] [ing.knx.internal.bus.KNXBindingDatapointReaderTask] - Autorefresh: Cannot read value for item 'WS_Windsensor_Messwert' from KNX bus: timeout waiting for group read response: timeout
23-Mai-2018 20:12:00.517 [WARN ] [ing.knx.internal.bus.KNXBindingDatapointReaderTask] - Autorefresh: Remaining retries for address '5/4/1' = '2'
23-Mai-2018 20:12:10.567 [WARN ] [ing.knx.internal.bus.KNXBindingDatapointReaderTask] - Autorefresh: Cannot read value for item 'WS_Windsensor_Messwert' from KNX bus: timeout waiting for group read response: timeout
23-Mai-2018 20:12:10.567 [WARN ] [ing.knx.internal.bus.KNXBindingDatapointReaderTask] - Autorefresh: Remaining retries for address '5/4/1' = '1'
23-Mai-2018 20:12:20.618 [WARN ] [ing.knx.internal.bus.KNXBindingDatapointReaderTask] - Autorefresh: Cannot read value for item 'WS_Windsensor_Messwert' from KNX bus: timeout waiting for group read response: timeout
23-Mai-2018 20:12:20.618 [WARN ] [ing.knx.internal.bus.KNXBindingDatapointReaderTask] - Autorefresh: Remaining retries for address '5/4/1' = '0'
23-Mai-2018 20:12:30.670 [WARN ] [ing.knx.internal.bus.KNXBindingDatapointReaderTask] - Autorefresh: Cannot read value for item 'Fassade1_Sonnenauto_Hellig_Kurz_Status' from KNX bus: timeout waiting for group read response: timeout
23-Mai-2018 20:12:30.670 [WARN ] [ing.knx.internal.bus.KNXBindingDatapointReaderTask] - Autorefresh: Remaining retries for address '6/0/48' = '2'
23-Mai-2018 20:12:40.721 [WARN ] [ing.knx.internal.bus.KNXBindingDatapointReaderTask] - Autorefresh: Cannot read value for item 'WS_Luftdrucksensor_Barometrisch_Max' from KNX bus: timeout waiting for group read response: timeout
23-Mai-2018 20:12:40.721 [WARN ] [ing.knx.internal.bus.KNXBindingDatapointReaderTask] - Autorefresh: Remaining retries for address '5/5/7' = '2'
23-Mai-2018 20:12:50.772 [WARN ] [ing.knx.internal.bus.KNXBindingDatapointReaderTask] - Autorefresh: Cannot read value for item 'WS_Luftdrucksensor_Barometrisch_Min' from KNX bus: timeout waiting for group read response: timeout
23-Mai-2018 20:12:50.773 [WARN ] [ing.knx.internal.bus.KNXBindingDatapointReaderTask] - Autorefresh: Remaining retries for address '5/5/5' = '2'
23-Mai-2018 20:13:00.824 [WARN ] [ing.knx.internal.bus.KNXBindingDatapointReaderTask] - Autorefresh: Cannot read value for item 'WS_Luftdrucksensor_Barometrisch' from KNX bus: timeout waiting for group read response: timeout
23-Mai-2018 20:13:00.824 [WARN ] [ing.knx.internal.bus.KNXBindingDatapointReaderTask] - Autorefresh: Remaining retries for address '5/5/2' = '2'
23-Mai-2018 20:13:10.875 [WARN ] [ing.knx.internal.bus.KNXBindingDatapointReaderTask] - Autorefresh: Cannot read value for item 'WS_TempSensor_Messwert_Aktuell' from KNX bus: timeout waiting for group read response: timeout
23-Mai-2018 20:13:10.876 [WARN ] [ing.knx.internal.bus.KNXBindingDatapointReaderTask] - Autorefresh: Remaining retries for address '5/2/2' = '2'
23-Mai

If using a knx router, you shouldn’t have changed any ip address other than the localIp in knx.cfg (in question of knx binding, naturally)
Is the knx binding in ROUTER mode? Then the knx router ip should be 224.00.23.12.

Hi @Udo_Hartmann

thanks a lot for your reply. My knx.cfg looks like that (which is in line with your recommendations).

In ETS the routing multicast adress is set to 224.0.23.12

# KNX gateway IP address 
# (optional, if serialPort or connection type 'ROUTER' is specified)
# ip=192.168.1.111
ip=224.0.23.12

# 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=15.15.011

# 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=true

# 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=TUNNEL
type=ROUTER

# 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.1.111

# 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=

# 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=3

# 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
#       request
# (optional, default is 0)
autoReconnectPeriod=30

### Auto refresh feature
# Number of entries permissible in the item refresher queue. 
# (optional, defaults to 10000)
#maxRefreshQueueEntries=

# Number of parallel threads for refreshing items. (optional, defaults to 5)
numberOfThreads=5

# Seconds to wait for an orderly shutdown of the auto refresher's 
# ScheduledExecutorService. (optional, defaults to 5)
#scheduledExecutorServiceShutdownTimeoutString=

# Use NAT (Network Address Translation)
#  (optional; defaults to false)
# useNAT=true

Any further ideas?

Thanks & regards
John

try TUNNEL mode…
i had a few issues with my knx binding my solution was numerofthreads=2 and pause=100

Observation:

  • I can send commands from OH to KNX
  • but OH does not receive any updates from KNX

Any ideas what could block OH from receiving commands from KNX?

(maybe?) The filter table on your KNX Gateway (GIRA KNX Router in my case)

I am using a dummy application in ETS and I link the Group Addresses to that dummy app so that the filter table is populated with these GAs.

I have the Gateway configured to filter the telegrams, so if I don’t do this association between the dummy app and the GAs, I can’t read stuff (i.e. status) from the KNX bus. The filter table acts like a “firewall”.

If you use Tunnel mode, you don’t need to worry about the filter table

edit: on the other hand… you wrote that you have set your Gateway to route everything… and that you get updates for the first minutes…
I don’t know what could be wrong in this case…

Maybe a stupid question: but what is the benefit of ROUTER compared to TUNNEL?

If it doesn’t matter at all, I’ll switch to TUNNEL (or at least give it a try).

quick answer: (imho) For OH2 KNX1, Routing is generally better and it does not occupy a tunnel interface (gateways support up to 4 usually).

Try Tunneling for now to see if the issue goes away. Then try to troubleshoot Routing (if you fell like it).

There is some info here also: HowTo: GIRA KNX/IP Router

Much more on google of course :slight_smile:

This is the point that I still don’t understand. Why is it “bad” to occupy a tunnel? Why is “routing” better?

Done and TUNNEL is working. While changing to Tunnel I had some observations that maybe helps to troubleshoot Routing.

After the first attempt (20:51:13.881) it was even worse than with Routing and I saw a lot logfile entries (see below).
After the second attempt it worked - the only change I did was to activate this entry in the knx.cfg:

# 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=15.15.011

To be honest: I really don’t understand why this entry made TUNNEL suddenly working.

25-Mai-2018 20:51:13.881 [WARN ] [tuwien.auto.calimero                              ] - KNXnet/IP Tunneling 192.168.1.66:3671: response timeout waiting for confirmation
tuwien.auto.calimero.exception.KNXTimeoutException: no confirmation reply received for L-Data.req from 15.15.11 to 0/0/6, low priority hop count 6 repeat tpdu 00 00
	at tuwien.auto.calimero.knxnetip.ClientConnection.doExtraBlockingModes(ClientConnection.java:236) [229:org.openhab.binding.knx:1.11.0]
	at tuwien.auto.calimero.knxnetip.ConnectionBase.send(ConnectionBase.java:269) [229:org.openhab.binding.knx:1.11.0]
	at tuwien.auto.calimero.knxnetip.KNXnetIPTunnel.send(KNXnetIPTunnel.java:149) [229:org.openhab.binding.knx:1.11.0]
	at tuwien.auto.calimero.link.KNXNetworkLinkIP.onSend(KNXNetworkLinkIP.java:263) [229:org.openhab.binding.knx:1.11.0]
	at tuwien.auto.calimero.link.AbstractLink.send(AbstractLink.java:304) [229:org.openhab.binding.knx:1.11.0]
	at tuwien.auto.calimero.link.KNXNetworkLinkIP.sendRequestWait(KNXNetworkLinkIP.java:240) [229:org.openhab.binding.knx:1.11.0]
	at tuwien.auto.calimero.process.ProcessCommunicatorImpl.readFromGroup(ProcessCommunicatorImpl.java:486) [229:org.openhab.binding.knx:1.11.0]
	at tuwien.auto.calimero.process.ProcessCommunicatorImpl.read(ProcessCommunicatorImpl.java:422) [229:org.openhab.binding.knx:1.11.0]
	at org.openhab.binding.knx.internal.bus.KNXBindingDatapointReaderTask.readFromKNXBus(KNXBindingDatapointReaderTask.java:99) [229:org.openhab.binding.knx:1.11.0]
	at org.openhab.binding.knx.internal.bus.KNXBindingDatapointReaderTask.run(KNXBindingDatapointReaderTask.java:67) [229:org.openhab.binding.knx:1.11.0]
25-Mai-2018 20:51:16.883 [WARN ] [tuwien.auto.calimero                              ] - KNXnet/IP Tunneling 192.168.1.66:3671: response timeout waiting for confirmation
tuwien.auto.calimero.exception.KNXTimeoutException: no confirmation reply received for L-Data.req from 15.15.11 to 0/0/6, low priority hop count 6 repeat tpdu 00 80 41 e9 99 9a
	at tuwien.auto.calimero.knxnetip.ClientConnection.doExtraBlockingModes(ClientConnection.java:236) [229:org.openhab.binding.knx:1.11.0]
	at tuwien.auto.calimero.knxnetip.ConnectionBase.send(ConnectionBase.java:269) [229:org.openhab.binding.knx:1.11.0]
	at tuwien.auto.calimero.knxnetip.KNXnetIPTunnel.send(KNXnetIPTunnel.java:149) [229:org.openhab.binding.knx:1.11.0]
	at tuwien.auto.calimero.link.KNXNetworkLinkIP.onSend(KNXNetworkLinkIP.java:263) [229:org.openhab.binding.knx:1.11.0]
	at tuwien.auto.calimero.link.AbstractLink.send(AbstractLink.java:304) [229:org.openhab.binding.knx:1.11.0]
	at tuwien.auto.calimero.link.KNXNetworkLinkIP.sendRequestWait(KNXNetworkLinkIP.java:240) [229:org.openhab.binding.knx:1.11.0]
	at tuwien.auto.calimero.process.ProcessCommunicatorImpl.write(ProcessCommunicatorImpl.java:466) [229:org.openhab.binding.knx:1.11.0]
	at tuwien.auto.calimero.process.ProcessCommunicatorImpl.write(ProcessCommunicatorImpl.java:438) [229:org.openhab.binding.knx:1.11.0]
	at org.openhab.binding.knx.internal.bus.KNXBinding.writeToKNX(KNXBinding.java:149) [229:org.openhab.binding.knx:1.11.0]
	at org.openhab.binding.knx.internal.bus.KNXBinding.internalReceiveUpdate(KNXBinding.java:126) [229:org.openhab.binding.knx:1.11.0]
	at org.openhab.core.binding.AbstractBinding.receiveUpdate(AbstractBinding.java:113) [200:org.openhab.core.compat1x:2.2.0]
	at org.openhab.core.events.AbstractEventSubscriber.handleEvent(AbstractEventSubscriber.java:39) [200:org.openhab.core.compat1x:2.2.0]
	at org.apache.felix.eventadmin.impl.handler.EventHandlerProxy.sendEvent(EventHandlerProxy.java:415) [3:org.apache.karaf.services.eventadmin:4.1.3]
	at org.apache.felix.eventadmin.impl.tasks.HandlerTask.runWithoutBlacklistTiming(HandlerTask.java:82) [3:org.apache.karaf.services.eventadmin:4.1.3]
	at org.apache.felix.eventadmin.impl.tasks.SyncDeliverTasks.execute(SyncDeliverTasks.java:104) [3:org.apache.karaf.services.eventadmin:4.1.3]
	at org.apache.felix.eventadmin.impl.tasks.AsyncDeliverTasks$TaskExecuter.run(AsyncDeliverTasks.java:166) [3:org.apache.karaf.services.eventadmin:4.1.3]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?]
	at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
	at java.lang.Thread.run(Unknown Source) [?:?]
25-Mai-2018 20:51:19.888 [WARN ] [tuwien.auto.calimero                              ] - KNXnet/IP Tunneling 192.168.1.66:3671: response timeout waiting for confirmation
tuwien.auto.calimero.exception.KNXTimeoutException: no confirmation reply received for L-Data.req from 15.15.11 to 2/1/28, low priority hop count 6 repeat tpdu 00 00
	at tuwien.auto.calimero.knxnetip.ClientConnection.doExtraBlockingModes(ClientConnection.java:236) [229:org.openhab.binding.knx:1.11.0]
	at tuwien.auto.calimero.knxnetip.ConnectionBase.send(ConnectionBase.java:269) [229:org.openhab.binding.knx:1.11.0]
	at tuwien.auto.calimero.knxnetip.KNXnetIPTunnel.send(KNXnetIPTunnel.java:149) [229:org.openhab.binding.knx:1.11.0]
	at tuwien.auto.calimero.link.KNXNetworkLinkIP.onSend(KNXNetworkLinkIP.java:263) [229:org.openhab.binding.knx:1.11.0]
	at tuwien.auto.calimero.link.AbstractLink.send(AbstractLink.java:304) [229:org.openhab.binding.knx:1.11.0]
	at tuwien.auto.calimero.link.KNXNetworkLinkIP.sendRequestWait(KNXNetworkLinkIP.java:240) [229:org.openhab.binding.knx:1.11.0]
	at tuwien.auto.calimero.process.ProcessCommunicatorImpl.readFromGroup(ProcessCommunicatorImpl.java:486) [229:org.openhab.binding.knx:1.11.0]
	at tuwien.auto.calimero.process.ProcessCommunicatorImpl.read(ProcessCommunicatorImpl.java:422) [229:org.openhab.binding.knx:1.11.0]
	at org.openhab.binding.knx.internal.bus.KNXBindingDatapointReaderTask.readFromKNXBus(KNXBindingDatapointReaderTask.java:99) [229:org.openhab.binding.knx:1.11.0]
	at org.openhab.binding.knx.internal.bus.KNXBindingDatapointReaderTask.run(KNXBindingDatapointReaderTask.java:67) [229:org.openhab.binding.knx:1.11.0]
	

25-Mai-2018 20:51:10.866 [INFO ] [nhab.binding.knx.internal.connection.KNXConnection] - Established connection to KNX bus on 192.168.1.66:3671 in mode TUNNEL.
25-Mai-2018 20:51:13.881 [WARN ] [ing.knx.internal.bus.KNXBindingDatapointReaderTask] - Autorefresh: Cannot read value for item 'Bus_Spannungsmesswert' from KNX bus: no confirmation reply received for L-Data.req from 15.15.11 to 0/0/6, low priority hop count 6 repeat tpdu 00 00: timeout
25-Mai-2018 20:51:13.885 [WARN ] [ing.knx.internal.bus.KNXBindingDatapointReaderTask] - Autorefresh: Remaining retries for address '0/0/6' = '2'
25-Mai-2018 20:51:16.883 [WARN ] [org.openhab.binding.knx.internal.bus.KNXBinding   ] - Value '29.2' could not be sent to the KNX bus using datapoint 'command DP 0/0/6 Bus_Spannungsmesswert, DPT main 0 id 14.027, low priority' - retrying one time: no confirmation reply received for L-Data.req from 15.15.11 to 0/0/6, low priority hop count 6 repeat tpdu 00 80 41 e9 99 9a
25-Mai-2018 20:51:19.888 [WARN ] [ing.knx.internal.bus.KNXBindingDatapointReaderTask] - Autorefresh: Cannot read value for item 'Licht_EG_Kueche_CtE' from KNX bus: no confirmation reply received for L-Data.req from 15.15.11 to 2/1/28, low priority hop count 6 repeat tpdu 00 00: timeout
25-Mai-2018 20:51:19.892 [WARN ] [ing.knx.internal.bus.KNXBindingDatapointReaderTask] - Autorefresh: Remaining retries for address '2/1/28' = '2'

Are there any hints in the log entries that can help with troubelshooting Routing?

Thanks & regards
John