Built in udp config

Hi,

I’m trying to integrate an old HA system call WebBrick (no longer available).

The devices publish UDP packets over port 2552 when there are changes.

The UDP packet format is

9.1 General UDP Packet format
The UDP Packet Format is formed as follows:
Field Description
Len (byte) The overall size of the UDP packet.
udpType (byte) The packet type one of the characters ‘A’, ‘G’, ‘R’.
Source 0-1 (2bytes) These are two characters to identify the Udp source see later table.
srcChannel (byte) The channel/event index.
tgtChannel (byte) The target channel when sending remote commands, if the target
channel type is analogue then the top bit is set, i.e. values are
128+channel.
action (byte) The action being triggered (low 4 bits), includes Dwell number
(high 4 bits).
fromNodeNr (byte) Source webrick number 1-253.
toNodeNr (byte) Target webrick number for remote commands.
setPointNr (byte) Where relevant for packet type.
curValH (byte) High byte of any value being sent
curValL (byte) Low byte of any value being sentEnter code here…

I’ve set my config up as

#udp spec
udp:itemsharedconnections=true
udp:bindingsharedconnections=true
udp:directionssharedconnections=false
udp:addressmask=true
udp:postamble=
udp:blocking=false
udp:refreshinterval=250
udp:port=2552

I can see the UDP hitting in the logs, but not processing through the channel

GCT\�� on the listener port from /192.168.1.243:4096Binding] - Received
GCT\�� from an undefined remote end /192.168.1.243:4096. We will not process it
2015-07-29 06:23:43.499 [WARN ] [AbstractDatagramChannelBinding] - No channel is active or defined for the data we received from /192.168.1.243:4096. It will be discarded.

My Item is setup as

/* UDP Items /
String MY_UDP_String “Test String[%s]” {udp="<[192.168.1.249:4096:'REGEX((.
))’]"}

And a test rule as

rule “Log UDP”
when
String MY_UDP_String changed
then
logInfo(“UDP Packet *******************************”)
end

Any suggestions, or areas that I’m missing ?

Thanks

Paul

Are you sure you wrote the ip properly ? logs state 192.169.1.243 but your config states 192.169.1.249 …

Didn’t use the udp binding so far but that would be my first guess.

Hi,

I’ve got an array of these devices on 192.168.1.24x, and had set up the config with wildcard before. This had the same problems. I’m not sure how the port mappings work or how the channel is mapped to it to avoid the No channel is active or defined error.

Thanks

Paul

Use a * wildcard for the port number in the items definition instead of 4096

I presume you can not set from which port number the remote device sends the udp packets, right?

And indeed the ip addresses need to match

Thanks, but still seeing the same issue.

I changed the item setup to

String MY_UDP_String "Test String" {udp="<[192.168.1.*:*:'REGEX((.*))']"}

but the logs are still showing

GST\o�� on the listener port from /192.168.1.246:4096nnelBinding] - Received
GST\o�� from an undefined remote end /192.168.1.246:4096. We will not process it
2015-08-13 17:06:02.450 [WARN ] [AbstractDatagramChannelBinding] - No channel is active or defined for the data we received from /192.168.1.246:4096. It will be discarded.

Any suggestions on how or where to set up channels ?

Thanks

Paul

Paul, can you try to use a wildcard only for the port number, not in the IP. Looking at the code, it seems the wildcard is not supported in the ip.

Thanks - that did the trick, its not being discarded now.

Paul

192...* is not a valid wild mark in openhab
It is either * for any address, or a fully defined hostname or IP address to denote a single host