This page last changed on Jan 21, 2015 by galbip.

I've just downloaded the new 2.1.0 and have issues with UDP.

I'm trasferring Arduino I/O status sending a string over UDP (using 8801 and 8802 ports).
I have one command (UDPlistener) per each UDP port with RegEx (.*) to capture the whole string.
Finally, two custom sensors report string on two labels.

At OR startup, I get this error message, and the two labels show N/A

ERROR [UDPListener Port: 8801]: Error in UDPListenerThread
java.lang.IllegalStateException: No match found
        at java.util.regex.Matcher.group(Matcher.java:536)
        at org.openremote.controller.protocol.socket.UDPListenerCommand$UDPListenerThread.run(UDPListenerCommand.java:122)
ERROR [UDPListener Port: 8802]: Error in UDPListenerThread
java.lang.IllegalStateException: No match found
        at java.util.regex.Matcher.group(Matcher.java:536)
        at org.openremote.controller.protocol.socket.UDPListenerCommand$UDPListenerThread.run(UDPListenerCommand.java:122)

Thanks

Did the same configuration work with a pre 2.1.0 controller?
Do you use a different Java version then before?

Posted by mredeker at Jan 24, 2015 17:18

Hi,

I did not change java version.

Setup was (and is) Windows 7 - Java 1.8.0_25 - OpenRemote-Controller-2.1.0_SNAPSHOT-2013-06-17. This OR release was the only one I managed to make almost working with UDPListener. I said "almost" because often OR was not reporting content of the received UDP strings and I had to just restar OR controller to restore the correct behaviour.

Looking at the Release Note of the latest OR controller, I noticed some fix un UDP, that's why I tried the new one.

I'm ready to make tests if useful, but I need some guidance.

Thanks

Posted by galbip at Jan 24, 2015 18:36

The change mentioned in the 2.1 changes should be the already in the 2013-06-17 snapshot.
The error occurs when the groupCount is > 0 and we try to access the first group.
I don't know why this causes an issue now and not before.
Do you see in the log what string is received and the regex is used on?

Posted by mredeker at Jan 24, 2015 22:23

understood. Thanks.

In this case I prefer to redo my tests with 2013-06-17 snapshot and then with the new one in a "structured way".
I would hate to pass wrong info....

Will come back in the next days.

Paolo

Posted by galbip at Jan 25, 2015 10:05

I have tested the two versions simplifying a bit the environment to remove possible variables:

I have an Arduino sending every 2 seconds a string over UDP on port 8801. I alternate two strings as follow to simulate a change in I/O state:

:AR88_10:off:AR88_11:on:AR88_12:off
:AR88_10:on:AR88_11:on:AR88_12:off

I added this rule just to print out the received string:

package org.openremote.controller.protocol;

global org.openremote.controller.statuscache.CommandFacade execute;

rule "UDPListener"
when
  Event(source=="UDP_rx_str_8801", $v: value!="")
then


end

This is what I get with OpenRemote-Controller-2.1.0_SNAPSHOT-2013-06-17 every 2 seconds:


DEBUG 2015-01-25 16:17:58,475 : Rule Activation Imminent:
        rule "UDPListener" // (package org.openremote.controller.protocol)
        Declarations
                Declaration: "$v"
                Value:
                        Custom declarative value
        LHS objects(antecedents)
                Class: "CustomState"
                Fields:
                        Event Name:     "UDP_rx_str_8801"
                        Event Value:    ":AR88_10:off:AR88_11:on:AR88_12:off"

DEBUG 2015-01-25 16:18:00,458 : Rule Activation Imminent:
        rule "UDPListener" // (package org.openremote.controller.protocol)
        Declarations
                Declaration: "$v"
                Value:
                        Custom declarative value
        LHS objects(antecedents)
                Class: "CustomState"
                Fields:
                        Event Name:     "UDP_rx_str_8801"
                        Event Value:    ":AR88_10:on:AR88_11:on:AR88_12:off"

while, this is the output when I run the latest 2.1.0 controller:


ERROR [UDPListener Port: 8801]: Error in UDPListenerThread
java.lang.IllegalStateException: No match found
        at java.util.regex.Matcher.group(Matcher.java:536)
        at org.openremote.controller.protocol.socket.UDPListenerCommand$UDPListenerThread.run(UDPListenerCommand.java:122)

Posted by galbip at Jan 25, 2015 15:35

It looks like something was merged into the 2.1 branch but something else was missed.
I can't say when a fixed 2.1 version will come out.

Posted by mredeker at Jan 26, 2015 21:06
Document generated by Confluence on Jun 05, 2016 09:39