This page last changed on Dec 30, 2012 by svalent.
I am trying create sensor on base UDP command:
command name: Temperature1
Sensor is :
after start controller (2.0.1) i receive on my second server 192.168.1.40:9090 UDP packet "*S*GET_TEMP1*K*" ,immediately server
response " $server->send("5");" (i writing socket server in perl. It was easier than java for me...)
everrithing is OK (on android phone in GUI i see on my text label(which have setting Sensor SensTemp1) value 5)
1) controller send UDP packet every one second ...
2) after about 15 .. 30 ping/pong (send UDP packet & receive UDP answer from 192.168.1.40) controller get exception "java.net.SocketTimeoutException: Receive timed out" and stop sending UDP reqeust to 192.168.1.40
My question is :
1) why so often ?? (why not - perhaps once per minute ? Can I setting interval ? (polling interval))
2) of course - it may happen that the 192.168.1.40 responds after longer time (perhaps 50 ms?) or never (if is down) . But can I setting timeout time?
And when controller get timeout - why definitly stops getting sensor value ?
(and - Imust add : OpenRemote is very good project ...., but my knowledge is very poor at this time... )
2) parameter timeout is in controller.xml ?:
and - default is 1 (but 1 Second or 1 milisec ???) :
/** The default timeout used to wait for a result */
public static final int DEFAULT_TIMEOUT = 1;
Posted by svalent at Dec 30, 2012 20:12
There is code but that is only used for the socket timeout and has nothing todo with how often the command is executed itself to retrieve a new value.
UDPSocketCommand is still using the deprecated StatusCommand interface when used for a sensor.
This means it is polling every 500ms by default.
Posted by mredeker at Dec 31, 2012 15:51
result for this time for me is = i rewrite code and now using HTTP protocol - everything is OK
(but more traffics for one polling... )
Posted by svalent at Jan 04, 2013 20:13