Modbus openHAB2 binding available for alpha testing

openhab2-addons
modbus
binding
Tags: #<Tag:0x00007f1830ac1490> #<Tag:0x00007f1830ac12d8> #<Tag:0x00007f1830ac1170>

(Ssalonen) #324

Thanks for the excellent debugging! The refresh should work, this is something I have not noticed before.

  • What does the verbose logs say? Few seconds of logs is enough.
  • what openHAB version?
  • I assume you have latest binding and transport versions, from the marketplace.

Best


(Nathan Stratton) #325

[root@lisa openhab2]# yum list installed |grep openHAB
openhab2.noarch 2.2.0-1 @openHAB-Stable

Yes, latest transport and binding.

grep for shed:coils:00

26-Jan-2018 12:48:27.294 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:number will be updated to '0' (type DecimalType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:27.295 [DEBUG] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:datetime will not be updated since transformation was unsuccesful
26-Jan-2018 12:48:27.295 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:string will be updated to '0' (type StringType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:27.295 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:contact will be updated to 'CLOSED' (type OpenClosedType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:27.296 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:rollershutter will be updated to '0' (type PercentType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:27.296 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:dimmer will be updated to 'OFF' (type OnOffType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:27.296 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:switch will be updated to 'OFF' (type OnOffType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:29.422 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:number will be updated to '0' (type DecimalType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:29.423 [DEBUG] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:datetime will not be updated since transformation was unsuccesful
26-Jan-2018 12:48:29.423 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:string will be updated to '0' (type StringType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:29.423 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:contact will be updated to 'CLOSED' (type OpenClosedType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:29.424 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:rollershutter will be updated to '0' (type PercentType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:29.424 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:dimmer will be updated to 'OFF' (type OnOffType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:29.424 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:switch will be updated to 'OFF' (type OnOffType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:31.556 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:number will be updated to '0' (type DecimalType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:31.557 [DEBUG] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:datetime will not be updated since transformation was unsuccesful
26-Jan-2018 12:48:31.557 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:string will be updated to '0' (type StringType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:31.557 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:contact will be updated to 'CLOSED' (type OpenClosedType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:31.558 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:rollershutter will be updated to '0' (type PercentType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:31.558 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:dimmer will be updated to 'OFF' (type OnOffType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:31.558 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:switch will be updated to 'OFF' (type OnOffType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:33.683 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:number will be updated to '0' (type DecimalType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:33.683 [DEBUG] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:datetime will not be updated since transformation was unsuccesful
26-Jan-2018 12:48:33.684 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:string will be updated to '0' (type StringType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:33.684 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:contact will be updated to 'CLOSED' (type OpenClosedType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:33.684 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:rollershutter will be updated to '0' (type PercentType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:33.684 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:dimmer will be updated to 'OFF' (type OnOffType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:33.684 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:switch will be updated to 'OFF' (type OnOffType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:35.811 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:number will be updated to '0' (type DecimalType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:35.811 [DEBUG] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:datetime will not be updated since transformation was unsuccesful
26-Jan-2018 12:48:35.812 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:string will be updated to '0' (type StringType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:35.812 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:contact will be updated to 'CLOSED' (type OpenClosedType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:35.812 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:rollershutter will be updated to '0' (type PercentType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:35.812 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:dimmer will be updated to 'OFF' (type OnOffType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:35.812 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:switch will be updated to 'OFF' (type OnOffType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:37.939 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:number will be updated to '0' (type DecimalType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:37.940 [DEBUG] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:datetime will not be updated since transformation was unsuccesful
26-Jan-2018 12:48:37.940 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:string will be updated to '0' (type StringType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:37.940 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:contact will be updated to 'CLOSED' (type OpenClosedType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:37.940 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:rollershutter will be updated to '0' (type PercentType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:37.940 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:dimmer will be updated to 'OFF' (type OnOffType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:37.940 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:switch will be updated to 'OFF' (type OnOffType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:40.087 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:number will be updated to '0' (type DecimalType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:40.087 [DEBUG] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:datetime will not be updated since transformation was unsuccesful
26-Jan-2018 12:48:40.087 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:string will be updated to '0' (type StringType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:40.087 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:contact will be updated to 'CLOSED' (type OpenClosedType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:40.087 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:rollershutter will be updated to '0' (type PercentType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:40.087 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:dimmer will be updated to 'OFF' (type OnOffType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:40.088 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:switch will be updated to 'OFF' (type OnOffType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:42.214 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:number will be updated to '0' (type DecimalType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:42.215 [DEBUG] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:datetime will not be updated since transformation was unsuccesful
26-Jan-2018 12:48:42.215 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:string will be updated to '0' (type StringType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:42.215 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:contact will be updated to 'CLOSED' (type OpenClosedType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:42.216 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:rollershutter will be updated to '0' (type PercentType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:42.216 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:dimmer will be updated to 'OFF' (type OnOffType). Numeric state '0' and bool value 'false'
26-Jan-2018 12:48:42.216 [TRACE] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:switch will be updated to 'OFF' (type OnOffType). Numeric state '0' and bool value 'false'

(Nathan Stratton) #326

More debuging, as you can see from wireshark the query is almost exactly every second.

1081	40.012081638	10.88.64.4	10.88.64.49	Modbus/TCP	66	   Query: Trans: 37545; Unit:   4, Func:   1: Read Coils
1082	40.014052074	10.88.64.49	10.88.64.4	Modbus/TCP	65	Response: Trans: 37545; Unit:   4, Func:   1: Read Coils
1121	41.076132229	10.88.64.4	10.88.64.49	Modbus/TCP	66	   Query: Trans: 37549; Unit:   4, Func:   1: Read Coils
1122	41.078407158	10.88.64.49	10.88.64.4	Modbus/TCP	71	Response: Trans: 37549; Unit:   4, Func:   1: Read Coils
1161	42.140020022	10.88.64.4	10.88.64.49	Modbus/TCP	66	   Query: Trans: 37553; Unit:   4, Func:   1: Read Coils
1162	42.142667657	10.88.64.49	10.88.64.4	Modbus/TCP	65	Response: Trans: 37553; Unit:   4, Func:   1: Read Coils

However when I look at DEBUG logs I see at least the transformation was unsuccesful error every few seconds:

26-Jan-2018 13:34:55.799 [DEBUG] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:datetime will not be updated since transformation was unsuccesful
26-Jan-2018 13:34:57.929 [DEBUG] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:datetime will not be updated since transformation was unsuccesful
26-Jan-2018 13:35:00.056 [DEBUG] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:datetime will not be updated since transformation was unsuccesful
26-Jan-2018 13:35:02.183 [DEBUG] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:datetime will not be updated since transformation was unsuccesful
26-Jan-2018 13:35:04.311 [DEBUG] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:datetime will not be updated since transformation was unsuccesful
26-Jan-2018 13:35:06.439 [DEBUG] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:datetime will not be updated since transformation was unsuccesful
26-Jan-2018 13:35:08.567 [DEBUG] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:datetime will not be updated since transformation was unsuccesful
26-Jan-2018 13:35:10.696 [DEBUG] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:datetime will not be updated since transformation was unsuccesful
26-Jan-2018 13:35:12.824 [DEBUG] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:datetime will not be updated since transformation was unsuccesful
26-Jan-2018 13:35:14.951 [DEBUG] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:datetime will not be updated since transformation was unsuccesful
26-Jan-2018 13:35:17.079 [DEBUG] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:datetime will not be updated since transformation was unsuccesful
26-Jan-2018 13:35:19.207 [DEBUG] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:datetime will not be updated since transformation was unsuccesful
26-Jan-2018 13:35:21.335 [DEBUG] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:datetime will not be updated since transformation was unsuccesful
26-Jan-2018 13:35:23.463 [DEBUG] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:datetime will not be updated since transformation was unsuccesful
26-Jan-2018 13:35:25.592 [DEBUG] [nhab.binding.modbus.handler.ModbusDataThingHandler] - Thing modbus:data:shed:coils:00 'Modbus data', channel modbus:data:shed:coils:00:datetime will not be updated since transformation was unsuccesful

So not sure what the actual delay is on updates, but it’s at least 1 second if not longer.


(Ssalonen) #327

Thank you. I was actually looking for log lines where it shows the poll period as seen by the binding… Can you please paste full logs (=ungrepped) for few seconds?


(Nathan Stratton) #328

A few seconds:

https://drive.google.com/file/d/1Bm5qUHZCtYXC3WFtnWszFH6tQeQCUKT2/view?usp=sharing


(Nathan Stratton) #329

From startup:

https://drive.google.com/file/d/1y_5H6LULgMuT78uv-71JYDilQ0chnbfE/view?usp=sharing


(Ssalonen) #330

@sipvoip the logging not setup correctly – cannot see TRACE level logs from modbus transport. Please follow the instructions in the docs.

Otherwise it was good that you included logs from startup as well as from continuous operation.

Best,
Sami

EDIT: cannot reproduce your issue, so looking forward seeing the logs.


(Nathan Stratton) #331

Sorry, just had TRACE on modbus binding.

https://drive.google.com/file/d/1yheej55vIBO6BPJIgfF-OaTCFFnJ-i6I/view?usp=sharing


(Ssalonen) #332

Hmm, it seems to take a long time to get an connection (you can grep logs with Connection received). It’s a bit hard to say why that would be…

grep "Connection received" modbus.log |cut -d '!' -f2
 Connection received in 13 ms [operation ID 9e6f8235-52a3-4726-897b-1a1420e9e3fc]
 Connection received in 1081 ms [operation ID f90b815f-5ad5-432f-84ec-0d19b432e4e5]
 Connection received in 2126 ms [operation ID c5ee89f1-cc9e-4b0a-925d-4f1784c55ac6]
 Connection received in 3210 ms [operation ID 3ee22ed0-02e0-4946-a6e6-92e3553b19d7]
 Connection received in 4274 ms [operation ID cf9a5b43-11e2-4855-a406-fb6363756d14]
 Connection received in 5318 ms [operation ID 5335c037-868d-4e98-942c-4fa09cef09da]
 Connection received in 5344 ms [operation ID c5a7aeb2-d0b1-4ec8-88ae-662f91995538]
...

How about if would reuse the same TCP connection, similarly to your old configuration?

I actually already gave tips for converting the configuration to the new binding here. Previously you had some connection used for 10 minutes, before it was re-connected.

Best,
Sami

EDIT: I can also see that there is some “backlog” for the initial REFRESH commands, posted by openHAB itself on initialization. You can grep with POLL MONITOR:

$ grep "POLL MONITOR" modbus.log |grep queue
27-Jan-2018 08:20:04.491 [TRACE] [hab.io.transport.modbus.internal.ModbusManagerImpl] - POLL MONITOR: scheduledThreadPoolExecutor queue size: 0, remaining space 2147483647. Active threads 1
27-Jan-2018 08:20:04.491 [TRACE] [hab.io.transport.modbus.internal.ModbusManagerImpl] - POLL MONITOR: callbackThreadPool queue size: 0, remaining space 2147483647. Active threads 0
27-Jan-2018 08:20:34.541 [TRACE] [hab.io.transport.modbus.internal.ModbusManagerImpl] - POLL MONITOR: scheduledThreadPoolExecutor queue size: 91, remaining space 2147483647. Active threads 5
27-Jan-2018 08:20:34.543 [TRACE] [hab.io.transport.modbus.internal.ModbusManagerImpl] - POLL MONITOR: callbackThreadPool queue size: 0, remaining space 2147483647. Active threads 1
27-Jan-2018 08:21:05.424 [TRACE] [hab.io.transport.modbus.internal.ModbusManagerImpl] - POLL MONITOR: scheduledThreadPoolExecutor queue size: 53, remaining space 2147483647. Active threads 5
27-Jan-2018 08:21:05.426 [TRACE] [hab.io.transport.modbus.internal.ModbusManagerImpl] - POLL MONITOR: callbackThreadPool queue size: 0, remaining space 2147483647. Active threads 1

Perhaps that slows down normal polling as well… Based on this the poll rate might come back to normal eventually.

I think I want to optimize that “startup behaviour” for sure, now each data thing will introduce one poll to the queue.
EDIT: cannot reproduce this spamming of poll tasks. Perhaps this is related to slow connections…


(Nathan Stratton) #333

I was able to get down to 25 ms poll, however I am seeing a LOT of errors in the log. The odd part is I am not seeing the same errors in wireshark.

https://drive.google.com/file/d/1JL_H9wyY6QMMCRy9pFLrCQtQgZDHwX64/view?usp=sharing

modbus.things

Bridge modbus:tcp:basement [ host="10.88.64.46", port=502, timeBetwenTransactionsMillis=50, reconnectAfterMills=600000, connectTimeoutMillis=100, id=1 ] {
  Bridge poller coils [ start=0, length=55, refresh=100, type="coil" ] {
    Thing data 00 [ readStart="0", readValueType="bit", writeStart="0", writeValueType="bit", writeType="coil" ]
    Thing data 01 [ readStart="1", readValueType="bit", writeStart="1", writeValueType="bit", writeType="coil" ]
    Thing data 02 [ readStart="2", readValueType="bit", writeStart="2", writeValueType="bit", writeType="coil" ]
    Thing data 03 [ readStart="3", readValueType="bit", writeStart="3", writeValueType="bit", writeType="coil" ]
    Thing data 04 [ readStart="4", readValueType="bit", writeStart="4", writeValueType="bit", writeType="coil" ]
    Thing data 05 [ readStart="5", readValueType="bit", writeStart="5", writeValueType="bit", writeType="coil" ]
    Thing data 06 [ readStart="6", readValueType="bit", writeStart="6", writeValueType="bit", writeType="coil" ]
    Thing data 07 [ readStart="7", readValueType="bit", writeStart="7", writeValueType="bit", writeType="coil" ]
    Thing data 08 [ readStart="8", readValueType="bit", writeStart="8", writeValueType="bit", writeType="coil" ]
    Thing data 09 [ readStart="9", readValueType="bit", writeStart="9", writeValueType="bit", writeType="coil" ]
    Thing data 10 [ readStart="10", readValueType="bit", writeStart="10", writeValueType="bit", writeType="coil" ]
    Thing data 11 [ readStart="11", readValueType="bit", writeStart="11", writeValueType="bit", writeType="coil" ]
    Thing data 12 [ readStart="12", readValueType="bit", writeStart="13", writeValueType="bit", writeType="coil" ]
    Thing data 13 [ readStart="13", readValueType="bit", writeStart="14", writeValueType="bit", writeType="coil" ]
    Thing data 14 [ readStart="14", readValueType="bit", writeStart="14", writeValueType="bit", writeType="coil" ]
    Thing data 15 [ readStart="15", readValueType="bit", writeStart="15", writeValueType="bit", writeType="coil" ]
    Thing data 16 [ readStart="16", readValueType="bit", writeStart="16", writeValueType="bit", writeType="coil" ]
    Thing data 17 [ readStart="17", readValueType="bit", writeStart="17", writeValueType="bit", writeType="coil" ]
    Thing data 18 [ readStart="18", readValueType="bit", writeStart="18", writeValueType="bit", writeType="coil" ]
    Thing data 29 [ readStart="19", readValueType="bit", writeStart="19", writeValueType="bit", writeType="coil" ]
    Thing data 20 [ readStart="20", readValueType="bit", writeStart="20", writeValueType="bit", writeType="coil" ]
    Thing data 21 [ readStart="21", readValueType="bit", writeStart="21", writeValueType="bit", writeType="coil" ]
    Thing data 51 [ readStart="51", readValueType="bit", writeStart="51", writeValueType="bit", writeType="coil" ]
    Thing data 52 [ readStart="52", readValueType="bit", writeStart="52", writeValueType="bit", writeType="coil" ]
    Thing data 53 [ readStart="53", readValueType="bit", writeStart="53", writeValueType="bit", writeType="coil" ]
  }
  Bridge poller ponet [ start=2072, length=8, refresh=100, type="coil" ] {
    Thing data 00 [ readStart="2072", readValueType="bit", writeStart="2072", writeValueType="bit", writeType="coil" ]
    Thing data 01 [ readStart="2073", readValueType="bit", writeStart="2073", writeValueType="bit", writeType="coil" ]
    Thing data 02 [ readStart="2074", readValueType="bit", writeStart="2074", writeValueType="bit", writeType="coil" ]
    Thing data 03 [ readStart="2075", readValueType="bit", writeStart="2075", writeValueType="bit", writeType="coil" ]
    Thing data 04 [ readStart="2076", readValueType="bit", writeStart="2076", writeValueType="bit", writeType="coil" ]
    Thing data 05 [ readStart="2077", readValueType="bit", writeStart="2077", writeValueType="bit", writeType="coil" ]
    Thing data 06 [ readStart="2078", readValueType="bit", writeStart="2078", writeValueType="bit", writeType="coil" ]
    Thing data 07 [ readStart="2079", readValueType="bit", writeStart="2079", writeValueType="bit", writeType="coil" ]
  }
}

Bridge modbus:tcp:first [ host="10.88.64.47", port=502, timeBetwenTransactionsMills=50, reconnectAfterMillis=600000, connectTimeoutMillis=100, id=2 ] {
  Bridge poller coils [ start=0, length=55, refresh=100, type="coil" ] {
    Thing data 00 [ readStart="0", readValueType="bit", writeStart="0", writeValueType="bit", writeType="coil" ]
    Thing data 01 [ readStart="1", readValueType="bit", writeStart="1", writeValueType="bit", writeType="coil" ]
    Thing data 02 [ readStart="2", readValueType="bit", writeStart="2", writeValueType="bit", writeType="coil" ]
    Thing data 03 [ readStart="3", readValueType="bit", writeStart="3", writeValueType="bit", writeType="coil" ]
    Thing data 04 [ readStart="4", readValueType="bit", writeStart="4", writeValueType="bit", writeType="coil" ]
    Thing data 05 [ readStart="5", readValueType="bit", writeStart="5", writeValueType="bit", writeType="coil" ]
    Thing data 06 [ readStart="6", readValueType="bit", writeStart="6", writeValueType="bit", writeType="coil" ]
    Thing data 07 [ readStart="7", readValueType="bit", writeStart="7", writeValueType="bit", writeType="coil" ]
    Thing data 08 [ readStart="8", readValueType="bit", writeStart="8", writeValueType="bit", writeType="coil" ]
    Thing data 09 [ readStart="9", readValueType="bit", writeStart="9", writeValueType="bit", writeType="coil" ]
    Thing data 10 [ readStart="10", readValueType="bit", writeStart="10", writeValueType="bit", writeType="coil" ]
    Thing data 11 [ readStart="11", readValueType="bit", writeStart="11", writeValueType="bit", writeType="coil" ]
    Thing data 12 [ readStart="12", readValueType="bit", writeStart="13", writeValueType="bit", writeType="coil" ]
    Thing data 13 [ readStart="13", readValueType="bit", writeStart="14", writeValueType="bit", writeType="coil" ]
    Thing data 14 [ readStart="14", readValueType="bit", writeStart="14", writeValueType="bit", writeType="coil" ]
    Thing data 15 [ readStart="15", readValueType="bit", writeStart="15", writeValueType="bit", writeType="coil" ]
    Thing data 16 [ readStart="16", readValueType="bit", writeStart="16", writeValueType="bit", writeType="coil" ]
    Thing data 17 [ readStart="17", readValueType="bit", writeStart="17", writeValueType="bit", writeType="coil" ]
    Thing data 18 [ readStart="18", readValueType="bit", writeStart="18", writeValueType="bit", writeType="coil" ]
    Thing data 29 [ readStart="19", readValueType="bit", writeStart="19", writeValueType="bit", writeType="coil" ]
    Thing data 20 [ readStart="20", readValueType="bit", writeStart="20", writeValueType="bit", writeType="coil" ]
    Thing data 21 [ readStart="21", readValueType="bit", writeStart="21", writeValueType="bit", writeType="coil" ]
    Thing data 22 [ readStart="22", readValueType="bit", writeStart="22", writeValueType="bit", writeType="coil" ]
    Thing data 23 [ readStart="23", readValueType="bit", writeStart="23", writeValueType="bit", writeType="coil" ]
    Thing data 24 [ readStart="24", readValueType="bit", writeStart="24", writeValueType="bit", writeType="coil" ]
    Thing data 25 [ readStart="25", readValueType="bit", writeStart="25", writeValueType="bit", writeType="coil" ]
    Thing data 26 [ readStart="26", readValueType="bit", writeStart="26", writeValueType="bit", writeType="coil" ]
  }
  Bridge poller ponet [ start=2072, length=8, refresh=100, type="coil" ] {
    Thing data 00 [ readStart="2072", readValueType="bit", writeStart="2072", writeValueType="bit", writeType="coil" ]
    Thing data 01 [ readStart="2073", readValueType="bit", writeStart="2073", writeValueType="bit", writeType="coil" ]
    Thing data 02 [ readStart="2074", readValueType="bit", writeStart="2074", writeValueType="bit", writeType="coil" ]
    Thing data 03 [ readStart="2075", readValueType="bit", writeStart="2075", writeValueType="bit", writeType="coil" ]
    Thing data 04 [ readStart="2076", readValueType="bit", writeStart="2076", writeValueType="bit", writeType="coil" ]
    Thing data 05 [ readStart="2077", readValueType="bit", writeStart="2077", writeValueType="bit", writeType="coil" ]
    Thing data 06 [ readStart="2078", readValueType="bit", writeStart="2078", writeValueType="bit", writeType="coil" ]
    Thing data 07 [ readStart="2079", readValueType="bit", writeStart="2079", writeValueType="bit", writeType="coil" ]
  }
}

Bridge modbus:tcp:second [ host="10.88.64.48", port=502, timeBetwenTransactionsMills=50, reconnectAfterMillis=600000, connectTimeoutMillis=100, id=3 ] {
  Bridge poller coils [ start=0, length=55, refresh=100, type="coil" ] {
    Thing data 00 [ readStart="0", readValueType="bit", writeStart="0", writeValueType="bit", writeType="coil" ]
    Thing data 01 [ readStart="1", readValueType="bit", writeStart="1", writeValueType="bit", writeType="coil" ]
    Thing data 02 [ readStart="2", readValueType="bit", writeStart="2", writeValueType="bit", writeType="coil" ]
    Thing data 03 [ readStart="3", readValueType="bit", writeStart="3", writeValueType="bit", writeType="coil" ]
    Thing data 04 [ readStart="4", readValueType="bit", writeStart="4", writeValueType="bit", writeType="coil" ]
    Thing data 05 [ readStart="5", readValueType="bit", writeStart="5", writeValueType="bit", writeType="coil" ]
    Thing data 06 [ readStart="6", readValueType="bit", writeStart="6", writeValueType="bit", writeType="coil" ]
    Thing data 07 [ readStart="7", readValueType="bit", writeStart="7", writeValueType="bit", writeType="coil" ]
    Thing data 08 [ readStart="8", readValueType="bit", writeStart="8", writeValueType="bit", writeType="coil" ]
    Thing data 09 [ readStart="9", readValueType="bit", writeStart="9", writeValueType="bit", writeType="coil" ]
    Thing data 10 [ readStart="10", readValueType="bit", writeStart="10", writeValueType="bit", writeType="coil" ]
    Thing data 11 [ readStart="11", readValueType="bit", writeStart="11", writeValueType="bit", writeType="coil" ]
    Thing data 12 [ readStart="12", readValueType="bit", writeStart="13", writeValueType="bit", writeType="coil" ]
    Thing data 13 [ readStart="13", readValueType="bit", writeStart="14", writeValueType="bit", writeType="coil" ]
    Thing data 14 [ readStart="14", readValueType="bit", writeStart="14", writeValueType="bit", writeType="coil" ]
    Thing data 15 [ readStart="15", readValueType="bit", writeStart="15", writeValueType="bit", writeType="coil" ]
    Thing data 16 [ readStart="16", readValueType="bit", writeStart="16", writeValueType="bit", writeType="coil" ]
    Thing data 17 [ readStart="17", readValueType="bit", writeStart="17", writeValueType="bit", writeType="coil" ]
    Thing data 18 [ readStart="18", readValueType="bit", writeStart="18", writeValueType="bit", writeType="coil" ]
    Thing data 29 [ readStart="19", readValueType="bit", writeStart="19", writeValueType="bit", writeType="coil" ]
    Thing data 20 [ readStart="20", readValueType="bit", writeStart="20", writeValueType="bit", writeType="coil" ]
    Thing data 21 [ readStart="21", readValueType="bit", writeStart="21", writeValueType="bit", writeType="coil" ]
    Thing data 22 [ readStart="22", readValueType="bit", writeStart="22", writeValueType="bit", writeType="coil" ]
    Thing data 23 [ readStart="23", readValueType="bit", writeStart="23", writeValueType="bit", writeType="coil" ]
    Thing data 24 [ readStart="24", readValueType="bit", writeStart="24", writeValueType="bit", writeType="coil" ]
    Thing data 25 [ readStart="25", readValueType="bit", writeStart="25", writeValueType="bit", writeType="coil" ]
    Thing data 26 [ readStart="26", readValueType="bit", writeStart="26", writeValueType="bit", writeType="coil" ]
    Thing data 27 [ readStart="27", readValueType="bit", writeStart="27", writeValueType="bit", writeType="coil" ]
    Thing data 28 [ readStart="28", readValueType="bit", writeStart="28", writeValueType="bit", writeType="coil" ]
    Thing data 29 [ readStart="29", readValueType="bit", writeStart="29", writeValueType="bit", writeType="coil" ]
    Thing data 30 [ readStart="30", readValueType="bit", writeStart="30", writeValueType="bit", writeType="coil" ]
    Thing data 31 [ readStart="31", readValueType="bit", writeStart="31", writeValueType="bit", writeType="coil" ]
    Thing data 32 [ readStart="32", readValueType="bit", writeStart="32", writeValueType="bit", writeType="coil" ]
    Thing data 51 [ readStart="51", readValueType="bit", writeStart="51", writeValueType="bit", writeType="coil" ]
    Thing data 52 [ readStart="52", readValueType="bit", writeStart="52", writeValueType="bit", writeType="coil" ]
  }
  Bridge poller ponet [ start=2072, length=8, refresh=100, type="coil" ] {
    Thing data 00 [ readStart="2072", readValueType="bit", writeStart="2072", writeValueType="bit", writeType="coil" ]
    Thing data 01 [ readStart="2073", readValueType="bit", writeStart="2073", writeValueType="bit", writeType="coil" ]
    Thing data 02 [ readStart="2074", readValueType="bit", writeStart="2074", writeValueType="bit", writeType="coil" ]
    Thing data 03 [ readStart="2075", readValueType="bit", writeStart="2075", writeValueType="bit", writeType="coil" ]
    Thing data 04 [ readStart="2076", readValueType="bit", writeStart="2076", writeValueType="bit", writeType="coil" ]
    Thing data 05 [ readStart="2077", readValueType="bit", writeStart="2077", writeValueType="bit", writeType="coil" ]
    Thing data 06 [ readStart="2078", readValueType="bit", writeStart="2078", writeValueType="bit", writeType="coil" ]
    Thing data 07 [ readStart="2079", readValueType="bit", writeStart="2079", writeValueType="bit", writeType="coil" ]
  }
}

Bridge modbus:tcp:shed [ host="10.88.64.49", port=502, timeBetwenTransactionsMills=50, reconnectAfterMillis=600000, connectTimeoutMillis=100, id=4 ] {
  Bridge poller coils [ start=0, length=55, refresh=100, type="coil" ] {
    Thing data 00 [ readStart="0", readValueType="bit", writeStart="0", writeValueType="bit", writeType="coil" ]
    Thing data 01 [ readStart="1", readValueType="bit", writeStart="1", writeValueType="bit", writeType="coil" ]
    Thing data 02 [ readStart="2", readValueType="bit", writeStart="2", writeValueType="bit", writeType="coil" ]
    Thing data 03 [ readStart="3", readValueType="bit", writeStart="3", writeValueType="bit", writeType="coil" ]
    Thing data 04 [ readStart="4", readValueType="bit", writeStart="4", writeValueType="bit", writeType="coil" ]
    Thing data 05 [ readStart="5", readValueType="bit", writeStart="5", writeValueType="bit", writeType="coil" ]
    Thing data 06 [ readStart="6", readValueType="bit", writeStart="6", writeValueType="bit", writeType="coil" ]
    Thing data 07 [ readStart="7", readValueType="bit", writeStart="7", writeValueType="bit", writeType="coil" ]
    Thing data 08 [ readStart="8", readValueType="bit", writeStart="8", writeValueType="bit", writeType="coil" ]
    Thing data 09 [ readStart="9", readValueType="bit", writeStart="9", writeValueType="bit", writeType="coil" ]
    Thing data 10 [ readStart="10", readValueType="bit", writeStart="10", writeValueType="bit", writeType="coil" ]
  }
  Bridge poller ponet [ start=2072, length=8, refresh=100, type="coil" ] {
    Thing data 00 [ readStart="2072", readValueType="bit", writeStart="2072", writeValueType="bit", writeType="coil" ]
    Thing data 01 [ readStart="2073", readValueType="bit", writeStart="2073", writeValueType="bit", writeType="coil" ]
    Thing data 02 [ readStart="2074", readValueType="bit", writeStart="2074", writeValueType="bit", writeType="coil" ]
    Thing data 03 [ readStart="2075", readValueType="bit", writeStart="2075", writeValueType="bit", writeType="coil" ]
    Thing data 04 [ readStart="2076", readValueType="bit", writeStart="2076", writeValueType="bit", writeType="coil" ]
    Thing data 05 [ readStart="2077", readValueType="bit", writeStart="2077", writeValueType="bit", writeType="coil" ]
    Thing data 06 [ readStart="2078", readValueType="bit", writeStart="2078", writeValueType="bit", writeType="coil" ]
    Thing data 07 [ readStart="2079", readValueType="bit", writeStart="2079", writeValueType="bit", writeType="coil" ]
  }
}

(Ssalonen) #334

Hi!

The log is full of connection timeout errors. Actually all the errors are due to those.

Default timeout for connection is 10 seconds (or connectTimeoutMillis=10000). In your configuration that is 100 ms, perhaps it is too aggressive for your slave?

I would try out with the default connection timeout.

Best,
Sami

EDIT: Btw, you throttling the polling to 50 ms, not 25. See timeBetwenTransactionsMills.


(Nathan Stratton) #335

So the odd part and why I sent the logs is that I was not seeing any timeouts in wireshark. However, I took out the others and just left timeBetwenTransactionsMillis= and don’t see any errors.

On the 25 ms yes, that config was set to 50, I had just tried all the way down to 25 ms.

P.S. Very good work, this is a much better binding them the 1.x one.


(Ssalonen) #336

Glad to hear this. Let me know if there is still some issues

Btw, what devices you have as slaves?

Best
Sami


(Nathan Stratton) #337

Slaves are PoKeys 57Es


(Nathan Stratton) #338

So I thought I had it, but reconnectAfterMillis=0 even tho I have it set to 600000. Even restarted the binding:

modbus.log:

grep reconnectAfterMillis *
modbus.log:28-Jan-2018 14:52:27.582 [TRACE] [.internal.pooling.ModbusSlaveConnectionFactoryImpl] - (passivate) Connection TCPMasterConnection@46825a29[socket=Socket[addr=/10.88.64.46,port=502,localport=46658]] (endpoint ModbusTCPSlaveEndpoint@6c96f183[address=10.88.64.46,port=502]) age 11ms is over the reconnectAfterMillis=0ms limit or has been connection time (1517169147571) is after the "disconnectBeforeConnectedMillis"=-1 -> disconnecting.
modbus.log:28-Jan-2018 14:52:27.582 [TRACE] [.internal.pooling.ModbusSlaveConnectionFactoryImpl] - (passivate) Connection TCPMasterConnection@3e3dab37[socket=Socket[addr=/10.88.64.45,port=502,localport=57990]] (endpoint ModbusTCPSlaveEndpoint@1f608048[address=10.88.64.45,port=502]) age 18ms is over the reconnectAfterMillis=0ms limit or has been connection time (1517169147564) is after the "disconnectBeforeConnectedMillis"=-1 -> disconnecting.
modbus.log:28-Jan-2018 14:52:28.631 [TRACE] [.internal.pooling.ModbusSlaveConnectionFactoryImpl] - (passivate) Connection TCPMasterConnection@3e3dab37[socket=Socket[addr=/10.88.64.45,port=502,localport=57994]] (endpoint ModbusTCPSlaveEndpoint@1f608048[address=10.88.64.45,port=502]) age 3ms is over the reconnectAfterMillis=0ms limit or has been connection time (1517169148628) is after the "disconnectBeforeConnectedMillis"=-1 -> disconnecting.

modbus.things:

Bridge modbus:tcp:water [ host="10.88.64.45", port=502, id=1 ] {
  Bridge poller coils [ start=0, length=55, refresh=100, reconnectAfterMillis=600000, connectTimeoutMillis=1200, type="coil" ] {
    Thing data 00 [ readStart="0", readValueType="bit", writeStart="0", writeValueType="bit", writeType="coil" ]
    Thing data 01 [ readStart="1", readValueType="bit", writeStart="1", writeValueType="bit", writeType="coil" ]
  }
}

Bridge modbus:tcp:basement [ host="10.88.64.46", port=502, id=2 ] {
  Bridge poller coils [ start=0, length=55, refresh=100, reconnectAfterMillis=600000, connectTimeoutMillis=1200, type="coil" ] {
    Thing data 00 [ readStart="0", readValueType="bit", writeStart="0", writeValueType="bit", writeType="coil" ]
    Thing data 01 [ readStart="1", readValueType="bit", writeStart="1", writeValueType="bit", writeType="coil" ]
    Thing data 02 [ readStart="2", readValueType="bit", writeStart="2", writeValueType="bit", writeType="coil" ]
    Thing data 03 [ readStart="3", readValueType="bit", writeStart="3", writeValueType="bit", writeType="coil" ]
    Thing data 04 [ readStart="4", readValueType="bit", writeStart="4", writeValueType="bit", writeType="coil" ]
    Thing data 05 [ readStart="5", readValueType="bit", writeStart="5", writeValueType="bit", writeType="coil" ]
    Thing data 06 [ readStart="6", readValueType="bit", writeStart="6", writeValueType="bit", writeType="coil" ]
    Thing data 07 [ readStart="7", readValueType="bit", writeStart="7", writeValueType="bit", writeType="coil" ]
    Thing data 08 [ readStart="8", readValueType="bit", writeStart="8", writeValueType="bit", writeType="coil" ]
    Thing data 09 [ readStart="9", readValueType="bit", writeStart="9", writeValueType="bit", writeType="coil" ]
    Thing data 10 [ readStart="10", readValueType="bit", writeStart="10", writeValueType="bit", writeType="coil" ]
    Thing data 11 [ readStart="11", readValueType="bit", writeStart="11", writeValueType="bit", writeType="coil" ]
    Thing data 12 [ readStart="12", readValueType="bit", writeStart="13", writeValueType="bit", writeType="coil" ]
    Thing data 13 [ readStart="13", readValueType="bit", writeStart="14", writeValueType="bit", writeType="coil" ]
    Thing data 14 [ readStart="14", readValueType="bit", writeStart="14", writeValueType="bit", writeType="coil" ]
    Thing data 15 [ readStart="15", readValueType="bit", writeStart="15", writeValueType="bit", writeType="coil" ]
    Thing data 16 [ readStart="16", readValueType="bit", writeStart="16", writeValueType="bit", writeType="coil" ]
    Thing data 17 [ readStart="17", readValueType="bit", writeStart="17", writeValueType="bit", writeType="coil" ]
    Thing data 18 [ readStart="18", readValueType="bit", writeStart="18", writeValueType="bit", writeType="coil" ]
    Thing data 29 [ readStart="19", readValueType="bit", writeStart="19", writeValueType="bit", writeType="coil" ]
    Thing data 20 [ readStart="20", readValueType="bit", writeStart="20", writeValueType="bit", writeType="coil" ]
    Thing data 21 [ readStart="21", readValueType="bit", writeStart="21", writeValueType="bit", writeType="coil" ]
    Thing data 49 [ readStart="49", readValueType="bit", writeStart="49", writeValueType="bit", writeType="coil" ]
    Thing data 50 [ readStart="50", readValueType="bit", writeStart="50", writeValueType="bit", writeType="coil" ]
    Thing data 51 [ readStart="51", readValueType="bit", writeStart="51", writeValueType="bit", writeType="coil" ]
    Thing data 52 [ readStart="52", readValueType="bit", writeStart="52", writeValueType="bit", writeType="coil" ]
    Thing data 53 [ readStart="53", readValueType="bit", writeStart="53", writeValueType="bit", writeType="coil" ]
  }
  Bridge poller ponet [ start=2072, length=8, refresh=100, reconnectAfterMillis=600000, connectTimeoutMillis=1200, type="coil" ] {
    Thing data 00 [ readStart="2072", readValueType="bit", writeStart="2072", writeValueType="bit", writeType="coil" ]
    Thing data 01 [ readStart="2073", readValueType="bit", writeStart="2073", writeValueType="bit", writeType="coil" ]
    Thing data 02 [ readStart="2074", readValueType="bit", writeStart="2074", writeValueType="bit", writeType="coil" ]
    Thing data 03 [ readStart="2075", readValueType="bit", writeStart="2075", writeValueType="bit", writeType="coil" ]
    Thing data 04 [ readStart="2076", readValueType="bit", writeStart="2076", writeValueType="bit", writeType="coil" ]
    Thing data 05 [ readStart="2077", readValueType="bit", writeStart="2077", writeValueType="bit", writeType="coil" ]
    Thing data 06 [ readStart="2078", readValueType="bit", writeStart="2078", writeValueType="bit", writeType="coil" ]
    Thing data 07 [ readStart="2079", readValueType="bit", writeStart="2079", writeValueType="bit", writeType="coil" ]
  }
}

Bridge modbus:tcp:first [ host="10.88.64.47", port=502, id=3 ] {
  Bridge poller coils [ start=0, length=55, refresh=100, reconnectAfterMillis=600000, connectTimeoutMillis=1200, type="coil" ] {
    Thing data 00 [ readStart="0", readValueType="bit", writeStart="0", writeValueType="bit", writeType="coil" ]
    Thing data 01 [ readStart="1", readValueType="bit", writeStart="1", writeValueType="bit", writeType="coil" ]
    Thing data 02 [ readStart="2", readValueType="bit", writeStart="2", writeValueType="bit", writeType="coil" ]
    Thing data 03 [ readStart="3", readValueType="bit", writeStart="3", writeValueType="bit", writeType="coil" ]
    Thing data 04 [ readStart="4", readValueType="bit", writeStart="4", writeValueType="bit", writeType="coil" ]
    Thing data 05 [ readStart="5", readValueType="bit", writeStart="5", writeValueType="bit", writeType="coil" ]
    Thing data 06 [ readStart="6", readValueType="bit", writeStart="6", writeValueType="bit", writeType="coil" ]
    Thing data 07 [ readStart="7", readValueType="bit", writeStart="7", writeValueType="bit", writeType="coil" ]
    Thing data 08 [ readStart="8", readValueType="bit", writeStart="8", writeValueType="bit", writeType="coil" ]
    Thing data 09 [ readStart="9", readValueType="bit", writeStart="9", writeValueType="bit", writeType="coil" ]
    Thing data 10 [ readStart="10", readValueType="bit", writeStart="10", writeValueType="bit", writeType="coil" ]
    Thing data 11 [ readStart="11", readValueType="bit", writeStart="11", writeValueType="bit", writeType="coil" ]
    Thing data 12 [ readStart="12", readValueType="bit", writeStart="13", writeValueType="bit", writeType="coil" ]
    Thing data 13 [ readStart="13", readValueType="bit", writeStart="14", writeValueType="bit", writeType="coil" ]
    Thing data 14 [ readStart="14", readValueType="bit", writeStart="14", writeValueType="bit", writeType="coil" ]
    Thing data 15 [ readStart="15", readValueType="bit", writeStart="15", writeValueType="bit", writeType="coil" ]
    Thing data 16 [ readStart="16", readValueType="bit", writeStart="16", writeValueType="bit", writeType="coil" ]
    Thing data 17 [ readStart="17", readValueType="bit", writeStart="17", writeValueType="bit", writeType="coil" ]
    Thing data 18 [ readStart="18", readValueType="bit", writeStart="18", writeValueType="bit", writeType="coil" ]
    Thing data 29 [ readStart="19", readValueType="bit", writeStart="19", writeValueType="bit", writeType="coil" ]
    Thing data 20 [ readStart="20", readValueType="bit", writeStart="20", writeValueType="bit", writeType="coil" ]
    Thing data 21 [ readStart="21", readValueType="bit", writeStart="21", writeValueType="bit", writeType="coil" ]
    Thing data 22 [ readStart="22", readValueType="bit", writeStart="22", writeValueType="bit", writeType="coil" ]
    Thing data 23 [ readStart="23", readValueType="bit", writeStart="23", writeValueType="bit", writeType="coil" ]
    Thing data 24 [ readStart="24", readValueType="bit", writeStart="24", writeValueType="bit", writeType="coil" ]
    Thing data 25 [ readStart="25", readValueType="bit", writeStart="25", writeValueType="bit", writeType="coil" ]
    Thing data 26 [ readStart="26", readValueType="bit", writeStart="26", writeValueType="bit", writeType="coil" ]
  }
  Bridge poller ponet [ start=2072, length=8, refresh=100, reconnectAfterMillis=600000, connectTimeoutMillis=1200, type="coil" ] {
    Thing data 00 [ readStart="2072", readValueType="bit", writeStart="2072", writeValueType="bit", writeType="coil" ]
    Thing data 01 [ readStart="2073", readValueType="bit", writeStart="2073", writeValueType="bit", writeType="coil" ]
    Thing data 02 [ readStart="2074", readValueType="bit", writeStart="2074", writeValueType="bit", writeType="coil" ]
    Thing data 03 [ readStart="2075", readValueType="bit", writeStart="2075", writeValueType="bit", writeType="coil" ]
    Thing data 04 [ readStart="2076", readValueType="bit", writeStart="2076", writeValueType="bit", writeType="coil" ]
    Thing data 05 [ readStart="2077", readValueType="bit", writeStart="2077", writeValueType="bit", writeType="coil" ]
    Thing data 06 [ readStart="2078", readValueType="bit", writeStart="2078", writeValueType="bit", writeType="coil" ]
    Thing data 07 [ readStart="2079", readValueType="bit", writeStart="2079", writeValueType="bit", writeType="coil" ]
  }
}

Bridge modbus:tcp:second [ host="10.88.64.48", port=502, id=4 ] {
  Bridge poller coils [ start=0, length=55, refresh=100, reconnectAfterMillis=600000, connectTimeoutMillis=1200, type="coil" ] {
    Thing data 00 [ readStart="0", readValueType="bit", writeStart="0", writeValueType="bit", writeType="coil" ]
    Thing data 01 [ readStart="1", readValueType="bit", writeStart="1", writeValueType="bit", writeType="coil" ]
    Thing data 02 [ readStart="2", readValueType="bit", writeStart="2", writeValueType="bit", writeType="coil" ]
    Thing data 03 [ readStart="3", readValueType="bit", writeStart="3", writeValueType="bit", writeType="coil" ]
    Thing data 04 [ readStart="4", readValueType="bit", writeStart="4", writeValueType="bit", writeType="coil" ]
    Thing data 05 [ readStart="5", readValueType="bit", writeStart="5", writeValueType="bit", writeType="coil" ]
    Thing data 06 [ readStart="6", readValueType="bit", writeStart="6", writeValueType="bit", writeType="coil" ]
    Thing data 07 [ readStart="7", readValueType="bit", writeStart="7", writeValueType="bit", writeType="coil" ]
    Thing data 08 [ readStart="8", readValueType="bit", writeStart="8", writeValueType="bit", writeType="coil" ]
    Thing data 09 [ readStart="9", readValueType="bit", writeStart="9", writeValueType="bit", writeType="coil" ]
    Thing data 10 [ readStart="10", readValueType="bit", writeStart="10", writeValueType="bit", writeType="coil" ]
    Thing data 11 [ readStart="11", readValueType="bit", writeStart="11", writeValueType="bit", writeType="coil" ]
    Thing data 12 [ readStart="12", readValueType="bit", writeStart="13", writeValueType="bit", writeType="coil" ]
    Thing data 13 [ readStart="13", readValueType="bit", writeStart="14", writeValueType="bit", writeType="coil" ]
    Thing data 14 [ readStart="14", readValueType="bit", writeStart="14", writeValueType="bit", writeType="coil" ]
    Thing data 15 [ readStart="15", readValueType="bit", writeStart="15", writeValueType="bit", writeType="coil" ]
    Thing data 16 [ readStart="16", readValueType="bit", writeStart="16", writeValueType="bit", writeType="coil" ]
    Thing data 17 [ readStart="17", readValueType="bit", writeStart="17", writeValueType="bit", writeType="coil" ]
    Thing data 18 [ readStart="18", readValueType="bit", writeStart="18", writeValueType="bit", writeType="coil" ]
    Thing data 29 [ readStart="19", readValueType="bit", writeStart="19", writeValueType="bit", writeType="coil" ]
    Thing data 20 [ readStart="20", readValueType="bit", writeStart="20", writeValueType="bit", writeType="coil" ]
    Thing data 21 [ readStart="21", readValueType="bit", writeStart="21", writeValueType="bit", writeType="coil" ]
    Thing data 22 [ readStart="22", readValueType="bit", writeStart="22", writeValueType="bit", writeType="coil" ]
    Thing data 23 [ readStart="23", readValueType="bit", writeStart="23", writeValueType="bit", writeType="coil" ]
    Thing data 24 [ readStart="24", readValueType="bit", writeStart="24", writeValueType="bit", writeType="coil" ]
    Thing data 25 [ readStart="25", readValueType="bit", writeStart="25", writeValueType="bit", writeType="coil" ]
    Thing data 26 [ readStart="26", readValueType="bit", writeStart="26", writeValueType="bit", writeType="coil" ]
    Thing data 27 [ readStart="27", readValueType="bit", writeStart="27", writeValueType="bit", writeType="coil" ]
    Thing data 28 [ readStart="28", readValueType="bit", writeStart="28", writeValueType="bit", writeType="coil" ]
    Thing data 29 [ readStart="29", readValueType="bit", writeStart="29", writeValueType="bit", writeType="coil" ]
    Thing data 30 [ readStart="30", readValueType="bit", writeStart="30", writeValueType="bit", writeType="coil" ]
    Thing data 31 [ readStart="31", readValueType="bit", writeStart="31", writeValueType="bit", writeType="coil" ]
    Thing data 32 [ readStart="32", readValueType="bit", writeStart="32", writeValueType="bit", writeType="coil" ]
    Thing data 51 [ readStart="51", readValueType="bit", writeStart="51", writeValueType="bit", writeType="coil" ]
    Thing data 52 [ readStart="52", readValueType="bit", writeStart="52", writeValueType="bit", writeType="coil" ]
  }
  Bridge poller ponet [ start=2072, length=8, refresh=100, reconnectAfterMillis=600000, connectTimeoutMillis=1200, type="coil" ] {
    Thing data 00 [ readStart="2072", readValueType="bit", writeStart="2072", writeValueType="bit", writeType="coil" ]
    Thing data 01 [ readStart="2073", readValueType="bit", writeStart="2073", writeValueType="bit", writeType="coil" ]
    Thing data 02 [ readStart="2074", readValueType="bit", writeStart="2074", writeValueType="bit", writeType="coil" ]
    Thing data 03 [ readStart="2075", readValueType="bit", writeStart="2075", writeValueType="bit", writeType="coil" ]
    Thing data 04 [ readStart="2076", readValueType="bit", writeStart="2076", writeValueType="bit", writeType="coil" ]
    Thing data 05 [ readStart="2077", readValueType="bit", writeStart="2077", writeValueType="bit", writeType="coil" ]
    Thing data 06 [ readStart="2078", readValueType="bit", writeStart="2078", writeValueType="bit", writeType="coil" ]
    Thing data 07 [ readStart="2079", readValueType="bit", writeStart="2079", writeValueType="bit", writeType="coil" ]
  }
}

Bridge modbus:tcp:shed [ host="10.88.64.49", port=502, id=5 ] {
  Bridge poller coils [ start=0, length=55, refresh=100, reconnectAfterMillis=600000, connectTimeoutMillis=1200, type="coil" ] {
    Thing data 00 [ readStart="0", readValueType="bit", writeStart="0", writeValueType="bit", writeType="coil" ]
    Thing data 01 [ readStart="1", readValueType="bit", writeStart="1", writeValueType="bit", writeType="coil" ]
    Thing data 02 [ readStart="2", readValueType="bit", writeStart="2", writeValueType="bit", writeType="coil" ]
    Thing data 03 [ readStart="3", readValueType="bit", writeStart="3", writeValueType="bit", writeType="coil" ]
    Thing data 04 [ readStart="4", readValueType="bit", writeStart="4", writeValueType="bit", writeType="coil" ]
    Thing data 05 [ readStart="5", readValueType="bit", writeStart="5", writeValueType="bit", writeType="coil" ]
    Thing data 06 [ readStart="6", readValueType="bit", writeStart="6", writeValueType="bit", writeType="coil" ]
    Thing data 07 [ readStart="7", readValueType="bit", writeStart="7", writeValueType="bit", writeType="coil" ]
    Thing data 08 [ readStart="8", readValueType="bit", writeStart="8", writeValueType="bit", writeType="coil" ]
    Thing data 09 [ readStart="9", readValueType="bit", writeStart="9", writeValueType="bit", writeType="coil" ]
    Thing data 10 [ readStart="10", readValueType="bit", writeStart="10", writeValueType="bit", writeType="coil" ]
  }
  Bridge poller ponet [ start=2072, length=8, refresh=100, reconnectAfterMillis=600000, connectTimeoutMillis=1200, type="coil" ] {
    Thing data 00 [ readStart="2072", readValueType="bit", writeStart="2072", writeValueType="bit", writeType="coil" ]
    Thing data 01 [ readStart="2073", readValueType="bit", writeStart="2073", writeValueType="bit", writeType="coil" ]
    Thing data 02 [ readStart="2074", readValueType="bit", writeStart="2074", writeValueType="bit", writeType="coil" ]
    Thing data 03 [ readStart="2075", readValueType="bit", writeStart="2075", writeValueType="bit", writeType="coil" ]
    Thing data 04 [ readStart="2076", readValueType="bit", writeStart="2076", writeValueType="bit", writeType="coil" ]
    Thing data 05 [ readStart="2077", readValueType="bit", writeStart="2077", writeValueType="bit", writeType="coil" ]
    Thing data 06 [ readStart="2078", readValueType="bit", writeStart="2078", writeValueType="bit", writeType="coil" ]
    Thing data 07 [ readStart="2079", readValueType="bit", writeStart="2079", writeValueType="bit", writeType="coil" ]
  }
}

(Nathan Stratton) #339

Looks like I had it in the wrong section of the config, it goes on the first line, not the poller.


(Antanas) #340

@ssalonen

in general, is there a way to do a “scan/poll” of the register (-s) and know it’s type? Asking such to know how I could use it further more connecting an ‘undocumented’ unit [I have a pellet boiler where the manufacturer does not want to share this information].

p.s. it has RS485 over TCP and I’m starting to play around with it.

Thanks


(Ssalonen) #341

Generally speaking there is no way to know the types on data items by just using modbus. Furthermore, even scanning can be complicated, devices might have their individual restrictions that prevent reading the register data easily (non continuous registers)

The address space in modbus is quite large so without any knowledge this can be hard if not impossible.

At least this my understanding…

I would try really hard to find reverse engineered specs. Or perhaps you can spy / listen modbus traffic with HMI device or something similar…


(Nathan Stratton) #342

Have you tested this with expire binding?

Switch    Garage_Door_A_Relay                 "Garage Door A"                                         <garagedoor>    (Garage)                                {channel="modbus:data:basement:coils:51:switch", expire="1s, command=OFF", autoupdate="false"}
Contact   Garage_Door_A                       "Garage Door A [MAP(en.map):%s]"                        <garagedoor>    (Garage, Entry)                         {channel="modbus:data:basement:coils:17:contact"}
Switch    Garage_Door_B_Relay                 "Garage Door B"                                         <garagedoor>    (Garage)                                {channel="modbus:data:basement:coils:52:switch", expire="1s, command=OFF", autoupdate="false"}
Contact   Garage_Door_B                       "Garage Door B [MAP(en.map):%s]"                        <garagedoor>    (Garage, Entry)                         {channel="modbus:data:basement:coils:18:contact"}
Switch    Garage_Door_C_Relay                 "Garage Door C"                                         <garagedoor>    (Garage)                                {channel="modbus:data:basement:coils:53:switch", expire="1s, command=OFF", autoupdate="false"}
Contact   Garage_Door_C                       "Garage Door C [MAP(en.map):%s]"                        <garagedoor>    (Garage, Entry)                         {channel="modbus:data:basement:coils:15:contact"}

If I look at events.log it looks normal:

2018-01-30 14:05:24.170 [vent.ItemStateChangedEvent] - Garage_Door_A_Relay changed from NULL to ON
2018-01-30 14:05:24.170 [vent.ItemStateChangedEvent] - Garage_Door_A changed from NULL to OPEN
2018-01-30 14:05:24.194 [.ItemChannelLinkAddedEvent] - Link 'Garage_Door_A_Relay-modbus:data:basement:coils:51:switch' has been added.
2018-01-30 14:05:24.197 [.ItemChannelLinkAddedEvent] - Link 'Garage_Door_A-modbus:data:basement:coils:17:contact' has been added.
2018-01-30 14:05:46.710 [ome.event.ItemCommandEvent] - Item 'Garage_Door_A_Relay' received command OFF
2018-01-30 14:05:58.457 [vent.ItemStateChangedEvent] - Garage_Door_A_Relay changed from ON to OFF

However, expire sees the binding updating the current state OFF like crazy:

expire.log:30-Jan-2018 14:09:16.953 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.
expire.log:30-Jan-2018 14:09:17.074 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.
expire.log:30-Jan-2018 14:09:17.194 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.
expire.log:30-Jan-2018 14:09:17.309 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.
expire.log:30-Jan-2018 14:09:17.430 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.
expire.log:30-Jan-2018 14:09:17.555 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.
expire.log:30-Jan-2018 14:09:17.675 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.
expire.log:30-Jan-2018 14:09:17.794 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.
expire.log:30-Jan-2018 14:09:17.913 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.
expire.log:30-Jan-2018 14:09:18.034 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.
expire.log:30-Jan-2018 14:09:18.159 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.
expire.log:30-Jan-2018 14:09:18.275 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.
expire.log:30-Jan-2018 14:09:18.686 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.
expire.log:30-Jan-2018 14:09:18.753 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.
expire.log:30-Jan-2018 14:09:18.874 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.
expire.log:30-Jan-2018 14:09:18.997 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.
expire.log:30-Jan-2018 14:09:19.120 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.
expire.log:30-Jan-2018 14:09:19.236 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.
expire.log:30-Jan-2018 14:09:19.360 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.
expire.log:30-Jan-2018 14:09:19.483 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.
expire.log:30-Jan-2018 14:09:19.609 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.
expire.log:30-Jan-2018 14:09:19.722 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.
expire.log:30-Jan-2018 14:09:19.842 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.
expire.log:30-Jan-2018 14:09:19.966 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.
expire.log:30-Jan-2018 14:09:20.086 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.
expire.log:30-Jan-2018 14:09:20.204 [DEBUG] [org.openhab.binding.expire.internal.ExpireBinding ] - Item Garage_Door_A_Relay received update 'OFF'; stopping any future expiration.

If I stop the modbus binding, the flood to expire stops.


(Ssalonen) #343

Hi,

Perhaps the event log just shows state changes?

It is true that thing channels and item states are updated on every poll, even when the value is not changed. Is this not the case you want to have?

With the old binding, at least using openHAB1, this increased CPU usage quite a lot. For this purpose, a configuration parameter was introduced to disable state updates when the value is unchanged from previous poll (updateunchangeditems). See PRs #4291 and #4339 for the original discussion regarding this topic.

Unfortunately, the feature has its downsides, and the item state can get out of sync of the polled data, see this comment (especially this chain of events).

As far I understood from the “openHAB philosophy”, the binding should update the states, whenever new data is available. It is said that binding is “stateless” in this sense. However, the CPU usage was considered such a downside, that it was well founded to limit the updates (see the PRs for the discussions).

I am curious to know how the CPU usage is with openHAB2 (pinging high frequency modbus poller @mbs38) . With openHAB1, the CPU usage was due to the internal state update events inside openHAB itself, the actual polling does not require much CPU.

Note that one can always react on state changes only (instead of all updates). However, it looks like expire binding does not allow this, and makes no distinction between the updates. In fact, they even have disclaimer in the docs about this:

If another binding is repeatedly updating the state of the item to be the same state it already was, the expiration timer will continue to be reset into the future. Dedicating an item to the expiration function (so it doesn’t receive repeated updates from another binding) would avoid unwanted behavior, should it apply in your case.

I wonder if such improvements are possible in expire binding, or if it has been discussed here in community forums? At least there is some new version of expire binding in the works, see here.

The good side with the current behaviour is that you can detect if the data just stop updating, e.g. when the slave goes down. On the other hand, there are now dedicated diagnostics channels(“last error” and “last read”) for this purpose, and using expire binding is perhaps more complicated than necessary.

Best,
Sami