TCP&UDP Binding - Could not transform/Could not parse

Tags: #<Tag:0x00007fc1fe85bd90> #<Tag:0x00007fc1fe85bc50>

Thank you for the respons.

So I updated my items

That I don’t know. I did not specified it anywhere… Somebody an idee?

Should I define the incoming “<” in the same item? Something like this:

Switch  OUT_Terras_Licht        "Licht Terras"          <light> (Home, OUT, GF_Terras)      {udp=">[ON:10.10.1.20:1001:'MAP(OUT_Terras_Licht.map)'] >[OFF:10.10.1.20:1001:'MAP(OUT_Terras_Licht.map)'] <udp="<[10.10.1.20:*:default]"}

Or do I have te create a separate item?

You can, but not like that.
In your existing you have udp=">[ ... ] >[ ... ]" , so you’d extend that like udp=">[ ... ] >[ ... ] <[ ...]"

For diagnostic purposes, you can do that as well and be sure about what is coming in and what happens to it.

An afterthought, because this is a 1.x version binding. There’s probably a “cached” version of udp.cfg called udp.config. These have been known to get out of step when editing. When you’ve made changes to udp.cfg, safest to stop openHAB, find and delete udp.config, restart (will be recreated automatically)

yes, of course, sorry!

So I updated my items:

Switch  OUT_Terras_Licht        "Licht Terras"          <light> (Home, OUT, GF_Terras)      {udp=">[ON:10.10.1.20:1001:'MAP(OUT_Terras_Licht.map)'] >[OFF:10.10.1.20:1001:'MAP(OUT_Terras_Licht.map)'] <[10.10.1.20:*:default]"}
String  OUT_Terras_Licht_A      "Licht Terras answer" {udp="<[10.10.1.20:*:default]"}

I also deleted the udp.config file and restarted.

Looks like this now:

udp:updatewithresponse=true
udp:blocking=true
udp:addressmask=true

But still getting the same logs.

Item 'OUT_Terras_Licht' received command ON
13:20:36.885 [WARN ] [ng.tcp.AbstractDatagramChannelBinding] - There is no channel that services [itemName=OUT_Terras_Licht, command=ON]
13:20:36.893 [INFO ] [smarthome.event.ItemStateChangedEvent] - OUT_Terras_Licht changed from OFF to ON
13:20:37.497 [WARN ] [orm.AbstractFileTransformationService] - Could not transform 'I000010115' with the file 'OUT_Terras_Licht.map' : Target value not found in map for 'I000010115'
13:20:37.500 [INFO ] [smarthome.event.ItemStateChangedEvent] - OUT_Terras_Licht_Query changed from I000010015 to I000010115
13:20:37.500 [WARN ] [ding.tcp.protocol.internal.UDPBinding] - Cannot parse input I000010115 to match command ON on item OUT_Terras_Licht
13:20:37.502 [WARN ] [orm.AbstractFileTransformationService] - Could not transform 'I000010115' with the file 'OUT_Terras_Licht.map' : Target value not found in map for 'I000010115'
13:20:37.503 [WARN ] [ding.tcp.protocol.internal.UDPBinding] - Cannot parse input I000010115 to match command OFF on item OUT_Terras_Licht
13:20:37.505 [WARN ] [orm.AbstractFileTransformationService] - Could not transform 'I000010115' with the file 'GF_Keuken_Eiland.map' : Target value not found in map for 'I000010115'
13:20:37.506 [WARN ] [ding.tcp.protocol.internal.UDPBinding] - Cannot parse input I000010115 to match command ON on item GF_Keuken_Eiland
13:20:37.507 [WARN ] [orm.AbstractFileTransformationService] - Could not transform 'I000010115' with the file 'GF_Keuken_Eiland.map' : Target value not found in map for 'I000010115'
13:20:37.509 [WARN ] [ding.tcp.protocol.internal.UDPBinding] - Cannot parse input I000010115 to match command OFF on item GF_Keuken_Eiland
13:20:39.056 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'OUT_Terras_Licht' received command OFF
13:20:39.057 [WARN ] [ng.tcp.AbstractDatagramChannelBinding] - There is no channel that services [itemName=OUT_Terras_Licht, command=OFF]
13:20:39.063 [INFO ] [smarthome.event.ItemStateChangedEvent] - OUT_Terras_Licht changed from ON to OFF
13:20:39.782 [WARN ] [orm.AbstractFileTransformationService] - Could not transform 'I000010015' with the file 'OUT_Terras_Licht.map' : Target value not found in map for 'I000010015'
13:20:39.784 [INFO ] [smarthome.event.ItemStateChangedEvent] - OUT_Terras_Licht_Query changed from I000010115 to I000010015
13:20:39.784 [WARN ] [ding.tcp.protocol.internal.UDPBinding] - Cannot parse input I000010015 to match command ON on item OUT_Terras_Licht
13:20:39.786 [WARN ] [orm.AbstractFileTransformationService] - Could not transform 'I000010015' with the file 'OUT_Terras_Licht.map' : Target value not found in map for 'I000010015'
13:20:39.788 [WARN ] [ding.tcp.protocol.internal.UDPBinding] - Cannot parse input I000010015 to match command OFF on item OUT_Terras_Licht
13:20:39.789 [WARN ] [orm.AbstractFileTransformationService] - Could not transform 'I000010015' with the file 'GF_Keuken_Eiland.map' : Target value not found in map for 'I000010015'
13:20:39.791 [WARN ] [ding.tcp.protocol.internal.UDPBinding] - Cannot parse input I000010015 to match command ON on item GF_Keuken_Eiland
13:20:39.792 [WARN ] [orm.AbstractFileTransformationService] - Could not transform 'I000010015' with the file 'GF_Keuken_Eiland.map' : Target value not found in map for 'I000010015'
13:20:39.793 [WARN ] [ding.tcp.protocol.internal.UDPBinding] - Cannot parse input I000010015 to match command OFF on item GF_Keuken_Eiland

Note there is an extra line: There is no channel that services [itemName=OUT_Terras_Licht, command=ON]

What does that mean?

Also, the string item OUT_Terras_Licht_A appears to get no data back from the relay?

I don’t know. A similar log was there in your first message.

Revealing. So perhaps we assume the warnings are not down to an actual UDP input.

Something I notice as missing from the events - in OH 2.4, with Item autoupdate enabled (the default) I’d expect to see an “predicted” message in response to a command. Sample
2019-11-22 23:47:47.741 [nt.ItemStatePredictedEvent] - nmt_CurrentTemperature predicted to become 17.5 °C
I wonder if we’re looking at autoupdate messing up here.

It would be worth a try to stop OH, clean the cache and reboot.

sudo systemctl stop openhab2

sudo openhab-cli clean-cache

sudo reboot

So I made some little changes, cleared my cach en rebooted, but the problem stays…

In my items, I cleared the incoming udp < on the item OUT_Terras_Licht en added a String to see which answer I get. I also cleared my udp.cfg and put “udp:timeout=4000” just to have something.

Items:

Switch  OUT_Terras_Licht        "Licht Terras"          <light> (Home, OUT, GF_Terras)      {udp=">[ON:10.10.1.21:1001:'MAP(OUT_Terras_Licht.map)'] >[OFF:10.10.1.21:1001:'MAP(OUT_Terras_Licht.map)']"}
String  OUT_Terras_Licht_A      "Licht Terras answer" {udp="<[10.10.1.21:1001:default]"}

Map:

ON=S0000
OFF=C0000
I000000000=OFF
I000000100=ON
My log stays the same:
16:26:12.172 [INFO ] [smarthome.event.ItemCommandEvent ] - Item 'OUT_Terras_Licht' received command ON

16:26:12.251 [INFO ] [smarthome.event.ItemStateChangedEvent] - OUT_Terras_Licht changed from NULL to ON

16:26:12.798 [WARN ] [orm.AbstractFileTransformationService] - Could not transform 'I000000100' with the file 'OUT_Terras_Licht.map' : Target value not found in map for 'I000000100'

16:26:12.801 [WARN ] [ding.tcp.protocol.internal.UDPBinding] - Cannot parse input I000000100 to match command OFF on item OUT_Terras_Licht

16:26:12.802 [WARN ] [orm.AbstractFileTransformationService] - Could not transform 'I000000100' with the file 'OUT_Terras_Licht.map' : Target value not found in map for 'I000000100'

16:26:12.803 [WARN ] [ding.tcp.protocol.internal.UDPBinding] - Cannot parse input I000000100 to match command ON on item OUT_Terras_Licht

16:26:16.547 [INFO ] [smarthome.event.ItemCommandEvent ] - Item 'OUT_Terras_Licht' received command OFF

16:26:16.562 [INFO ] [smarthome.event.ItemStateChangedEvent] - OUT_Terras_Licht changed from ON to OFF

16:26:16.840 [WARN ] [orm.AbstractFileTransformationService] - Could not transform 'I000000000' with the file 'OUT_Terras_Licht.map' : Target value not found in map for 'I000000000'

16:26:16.842 [WARN ] [ding.tcp.protocol.internal.UDPBinding] - Cannot parse input I000000000 to match command OFF on item OUT_Terras_Licht

16:26:16.843 [WARN ] [orm.AbstractFileTransformationService] - Could not transform 'I000000000' with the file 'OUT_Terras_Licht.map' : Target value not found in map for 'I000000000'

16:26:16.846 [WARN ] [ding.tcp.protocol.internal.UDPBinding] - Cannot parse input I000000000 to match command ON on item OUT_Terras_Licht

The Sting item does not get a value either.

So I’m getting a little desperate… :slight_smile:

Sorry for the delay.

Take the underscore’s out of the file name.

Change
OUT_Terras_Licht.map
to
OutTerrasLicht.map

Thanks for the reply!

I did, but still the same problem in the logs and still no value for the item OUT_Terras_Licht_A

Just to humour me, send a command to your “dummy” string Item, and observe events.log.

There’ll be some reason for the missing prediction, unless you are filtering it out.

I did, this is the result… No channel?

18:24:30.008 [WARN ] [ng.tcp.AbstractDatagramChannelBinding] - There is no channel that services [itemName=OUT_Terras_Licht_A, command=Test]
18:24:30.008 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'OUT_Terras_Licht_A' received command Test

Okay, now we get some understanding of that WARN message you saw before.
A command sent to an Item gets passed to any/all linked bindings. Of course, the binding may not be configured to do anything with it (as is the case for your test Item).
The binding author here has opted to make a WARN message for that. Fair enough, although this might well be deliberate config choice (as is the case here) so maybe that ought to be demoted to a DEBUG or TRACE level message so it doesn’t nuisance log in ordinary service.


However, there is something else going on here too. Unless you’re hiding messages, a prediction is missing.
By default, autoupdate feature should listen for commands to an Item - and for every one, usually offers a prediction of the likely state. Where’s that gone??

As I understand the way autoupdate functions, it essentially takes a poll of any linked bindings, they are allowed to veto predictions, or I think offer their own. I suppose its a pass-the-parcel arrangement.
Here it looks like UDP has swallowed the command parcel, or actively made a veto - neither of which it should do for a “read only” test Item.

So if the UDP binding is behaving badly for this supposed read only test Item, it’s probably linked to your problem with the write-only “real” Items.

We do know there is this “known bug” about UDP where you have to configure something in udp.cfg.
I wonder if you need a bit more in your udp.cfg, like an imaginary IP to listen for or something.

Okay, I did some experiments OH 2.4, TCPUDP binding 1.13

Test dummy, with no bindings

String testUDP "my test [%s]"

testUDP.sendCommand("banana") , events.log -

2019-11-29 20:33:25.247 [ome.event.ItemCommandEvent] - Item 'testUDP' received command banana
2019-11-29 20:33:25.264 [vent.ItemStateChangedEvent] - testUDP changed from NULL to banana

I got a surprise - no ‘predicted’ announcement. Never noticed that before, I guess autoupdate only announces if there are binding links? Does announce on other Items that do have links.
Anyway, autoupdate does do the command -> state update thing okay.

Added listen-only binding

String testUDP "my test [%s]" {udp="<[10.10.1.21:1001:default]"}

testUDP.sendCommand("banana")
openhab.log

2019-11-29 21:12:44.537 [WARN ] [g.tcp.AbstractDatagramChannelBinding] - There is no channel that services [itemName=testUDP, command=rhubarb]

Okay, we expected the WARN now for a command we have no config for. Nuisance value only.

events.log

2019-11-29 21:12:44.532 [ome.event.ItemCommandEvent] - Item 'testUDP' received command rhubarb
2019-11-29 21:12:44.553 [vent.ItemStateChangedEvent] - testUDP changed from banana to rhubarb

Okay, no ‘prediction’ - maybe that’s only if 2.x bindings involved? - but autoupdate has still done its thing.

That’s different to what you saw… but I think maybe you just omitted the changed event from your test items event log?
I now recognize the absence of ‘predicted’ here as a red herring.

HI

I’m not really following what you’re trying to do, but if it helps, these simple Item file entries allow me to get an Item updated with the recieved UDP command, and send the new contents of an Item to a UDP port on another machine

String UDP_IR_Blaster   "UDP Blaster"     { udp=">[*:192.168.178.240:65432:]" }


String Incoming_UDP     "Imcoming UDP[%s]"              { udp="<[*:65432:'REGEX((.*))']" }

As explained here - IR devices control

Does this help in any way ?

It’s just about these nuisance logs really. What do you get in openhab.log?

Oh okay.

I’ll have a quick look…

For the outgoing UDP, there is absolutely nothing written to either log file when I use the HabPanel buttons.

For incoming UDP, the events.log simply registers the full UDP contents.

That’s interesting. May we see your udp.cfg, and also tcp.cfg (if any uncommented content) just in case this is weirdness due to the odd split personality of this binding.

Sure, anything to assist :slight_smile:

I don’t recall having to make any drastic changes.

UDP cfg

 # all parameters can be applied to both the TCP and UDP binding unless
# specified otherwise

# Port to listen for incoming connections
port=65432

# Cron-like string to reconnect remote ends, e.g for unstable connection or remote ends
#reconnectcron=0 0 0 * * ?

# Interval between reconnection attempts when recovering from a communication error,
# in seconds
#retryinterval=5

# Queue data whilst recovering from a connection problem (TCP only)
#queue=true

# Maximum buffer size whilst reading incoming data
#buffersize=1024

# Share connections within the Item binding configurations
itemsharedconnections=true

# Share connections between Item binding configurations
bindingsharedconnections=true

# Share connections between inbound and outbound connections
directionssharedconnections=true

# Allow masks in ip:port addressing, e.g. 192.168.0.1:* etc
#addressmask=true

# Pre-amble that will be put in front of data being sent
#preamble=

# Post-amble that will be appended to data being sent
postamble=\n

# Perform all write/read (send/receive) operations in a blocking mode, e.g. the binding
# will wait for a reply from the remote end after data has been sent
#blocking=false

# timeout, in milliseconds, to wait for a reply when initiating a blocking write/read
#  operation
#timeout=3000

# Update the status of Items using the response received from the remote end (if the
# remote end sends replies to commands)
#updatewithresponse=true

# Timeout - or 'refresh interval', in milliseconds, of the worker thread
#refreshinterval=250

# Timeout, in milliseconds, to wait when "Selecting" IO channels ready for communication
#selecttimeout=1000

# Used character set
#charset=ASCII
s
bindingsharedconnections=true

# Share connections between inbound and outbound connections
directionssharedconnections=true

# Allow masks in ip:port addressing, e.g. 192.168.0.1:* etc
#addressmask=true

# Pre-amble that will be put in front of data being sent
#preamble=

# Post-amble that will be appended to data being sent
postamble=\n

# Perform

TCP cfg

# all parameters can be applied to both the TCP and UDP binding unless
# specified otherwise

# Port to listen for incoming connections
#port=25001

# Cron-like string to reconnect remote ends, e.g for unstable connection or remote ends
#reconnectcron=0 0 0 * * ?

# Interval between reconnection attempts when recovering from a communication error,
# in seconds
#retryinterval=5

# Queue data whilst recovering from a connection problem (TCP only)
#queue=true

# Maximum buffer size whilst reading incoming data
#buffersize=1024

# Share connections within the Item binding configurations
#itemsharedconnections=true

# Share connections between Item binding configurations
#bindingsharedconnections=true

# Share connections between inbound and outbound connections
#directionssharedconnections=false

# Allow masks in ip:port addressing, e.g. 192.168.0.1:* etc
#addressmask=true

# Pre-amble that will be put in front of data being sent
#preamble=

# Post-amble that will be appended to data being sent
#postamble=\r\n

# Perform all write/read (send/receive) operations in a blocking mode, e.g. the binding
# will wait for a reply from the remote end after data has been sent
#blocking=false

# timeout, in milliseconds, to wait for a reply when initiating a blocking write/read
#  operation
#timeout=3000

# Update the status of Items using the response received from the remote end (if the
# remote end sends replies to commands)
#updatewithresponse=true

# Timeout - or 'refresh interval', in milliseconds, of the worker thread
#refreshinterval=250

# Timeout, in milliseconds, to wait when "Selecting" IO channels ready for communication
#selecttimeout=1000

# Used character set
#charset=ASCII
dingsharedconnections=true

# Share connections between inbound and outbound connections
#directionssharedconnections=false

# Allow masks in ip:port addressing, e.g. 192.168.0.1:* etc
#addressmask=true

# Pre-amble that will be put in front of data being sent
#preamble=

# Post-amble that will be appended to data being sent
#postamble=\r\n

#

Thank you for the reply’s, but it is not only about the logs. It’s about 2 things:

  1. I should get the same answer than the one I send (like S0100) and I can’t seem to capture it through my UDP-binding.
  2. In the logs, I see values like I00001010, but I don’t know where there coming from. There is also something wrong with transforming them in de map file. In the logs you can see “can not parse” and can not transform?!?

I’m only chipping in as someone looking from a different direction.

“Have you installed the required transformation”

I sometimes forget to add the Regex Transformation, but get promoted when I see errors that hint at it.

:slight_smile:

Yes I did…
Appreciate all the help though! :wink:

1 Like