This page last changed on Jan 31, 2011 by kide.

I tried to create a sensor for a (working) telnet switch but i get a strange polling message that seems to be hanging:

In the controller.log i see the following:

[Controller]2011-01-31 10:30:11,506 INFO [HTTP-Thread-5] org.openremote.controller.rest.StatusPollingRESTServlet.doPost(77) | Started polling at 2011-01-31 10:30:11
[Controller]2011-01-31 10:30:11,507 INFO [HTTP-Thread-5] org.openremote.controller.service.impl.StatusPollingServiceImpl.queryChangedState(74) | Querying changed state from ChangedStatus table...
[Controller]2011-01-31 10:30:11,508 INFO [HTTP-Thread-5] org.openremote.controller.service.impl.StatusPollingServiceImpl.queryChangedState(89) | Not Found: [device => 030070774321090, sensorIDs => 499] in ChangedStatus table.
[Controller]2011-01-31 10:30:11,508 INFO [HTTP-Thread-5] org.openremote.controller.service.impl.StatusPollingServiceImpl.queryChangedState(107) | DEVICEID:030070774321090	sensorID:[499]statusChangedSensorID:[]Waiting...
[Controller]2011-01-31 10:30:11,646 INFO [Thread-8] org.openremote.controller.statuscache.StatusCache.saveOrUpdateStatus(68) | Status is null or "" while calling saveOrUpdateStatus in statusCache.
[Controller]2011-01-31 10:30:11,646 INFO [Thread-8] org.openremote.controller.statuscache.StatusCache.saveOrUpdateStatus(68) | Status is null or "" while calling saveOrUpdateStatus in statusCache.
[Controller]2011-01-31 10:30:12,146 INFO [Thread-8] org.openremote.controller.statuscache.StatusCache.saveOrUpdateStatus(68) | Status is null or "" while calling saveOrUpdateStatus in statusCache.
[Controller]2011-01-31 10:30:12,647 INFO [Thread-8] org.openremote.controller.statuscache.StatusCache.saveOrUpdateStatus(68) | Status is null or "" while calling saveOrUpdateStatus in statusCache.
[Controller]2011-01-31 10:30:13,147 INFO [Thread-8] org.openremote.controller.statuscache.StatusCache.saveOrUpdateStatus(68) | Status is null or "" while calling saveOrUpdateStatus in statusCache.
[Controller]2011-01-31 10:30:13,648 INFO [Thread-8] org.openremote.controller.statuscache.StatusCache.saveOrUpdateStatus(68) | Status is null or "" while calling saveOrUpdateStatus in statusCache.
[Controller]2011-01-31 10:30:14,148 INFO [Thread-8] org.openremote.controller.statuscache.StatusCache.saveOrUpdateStatus(68) | Status is null or "" while calling saveOrUpdateStatus in statusCache.
[Controller]2011-01-31 10:30:14,579 INFO [HTTP-Thread-4] org.openremote.controller.protocol.telnet.TelnetCommand.sendString(203) | send: set Stalamp_KL on
[Controller]2011-01-31 10:30:14,649 INFO [Thread-8] org.openremote.controller.statuscache.StatusCache.saveOrUpdateStatus(68) | Status is null or "" while calling saveOrUpdateStatus in statusCache.
[Controller]2011-01-31 10:30:15,150 INFO [Thread-8] org.openremote.controller.statuscache.StatusCache.saveOrUpdateStatus(68) | Status is null or "" while calling saveOrUpdateStatus in statusCache.
[Controller]2011-01-31 10:30:15,650 INFO [Thread-8] org.openremote.controller.statuscache.StatusCache.saveOrUpdateStatus(68) | Status is null or "" while calling saveOrUpdateStatus in statusCache.
[Controller]2011-01-31 10:30:16,151 INFO [Thread-8] org.openremote.controller.statuscache.StatusCache.saveOrUpdateStatus(68) | Status is null or "" while calling saveOrUpdateStatus in statusCache.
[Controller]2011-01-31 10:30:16,651 INFO [Thread-8] org.openremote.controller.statuscache.StatusCache.saveOrUpdateStatus(68) | Status is null or "" while calling saveOrUpdateStatus in statusCache.
[Controller]2011-01-31 10:30:17,152 INFO [Thread-8] org.openremote.controller.statuscache.StatusCache.saveOrUpdateStatus(68) | Status is null or "" while calling saveOrUpdateStatus in statusCache.

The  Reciever that should be queried for the status is not recieving any traffic except when i send a command. I decoded the stream and no data except "set Stalamp_KL on" is found (as far as my knowledge goes)

Does somebody has an idea on this?

As the controller starts there is an HTTP error which i cannot define but when you start it without the sensor in place its gone

INFO: Server startup in 5893 ms
 -------- Started thread for sensor 511 switch org.openremote.controller.protocol.telnet.TelnetCommand@571cac41
 -------- Started thread for sensor 511 switch org.openremote.controller.protocol.telnet.TelnetCommand@2575679c
[Controller]2011-01-31 11:49:10,495 ERROR [HTTP-Thread-11] org.openremote.controller.rest.StatusCommandRESTServlet.doPost(106) | CommandException occurs
org.openremote.controller.exception.NoSuchComponentException: No such component in status cache : 511
	at org.openremote.controller.statuscache.StatusCache.queryStatuses(StatusCache.java:96)
	at org.openremote.controller.service.impl.StatusCacheServiceImpl.queryStatuses(StatusCacheServiceImpl.java:43)
	at org.openremote.controller.service.impl.StatusCommandServiceImpl.readFromCache(StatusCommandServiceImpl.java:97)
	at org.openremote.controller.rest.StatusCommandRESTServlet.doPost(StatusCommandRESTServlet.java:103)
	at org.openremote.controller.rest.StatusCommandRESTServlet.doGet(StatusCommandRESTServlet.java:68)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.openremote.controller.rest.support.json.JSONCallbackFilter.doFilter(JSONCallbackFilter.java:65)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:78)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:354)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)
 -------- Started thread for sensor 513 switch org.openremote.controller.protocol.telnet.TelnetCommand@318f37c
 -------- Started thread for sensor 513 switch org.openremote.controller.protocol.telnet.TelnetCommand@4fbfc4a4

Posted by kide at Jan 31, 2011 11:02

Ernst - I don't believe a sensor (read) has yet been implemented in the the Telnet command....

from telnetcommand.java.....

   public String read(EnumSensorType sensoryType, Map<String, String> statusMap) {
      // TODO Auto-generated method stub
      return null;
   }

it looks like the Socket version has though...

Currently I cant get a switch (or slider) to change state though based on the read. Still checking all my config and options.

Posted by deanox at Jan 31, 2011 16:32

Ernst, I have been doing some work with the Telnet Command and I've updated the TelnetCommand.java and TelnetCommandBuilder.java files
to implement the read method (which is needed for updating sensors). As Dean has pointed out, this method is not implemented in the current release.
I have implemented a regex filter to sift through the telnet response and extract the required information for the sensor. I am going to put this
in branches/feature/Controller_2_0_0_Alpha11_telnet/ of the repo sometime in the next day or so.

If you want more info on this so you can test it out then let me know and I'll give you an overview.

Rich

Posted by kurrazyman at Jan 31, 2011 21:58

Rich - I'd certainly like a copy to try. I've now got a local copy that is building so it should be a relativly straightforward copy over the top for the 2 files or does it need any XML changes ?

Could you mail it to dean@eatworms.org.uk.

Thanks - Dean

Posted by deanox at Jan 31, 2011 22:16

Yes i'll test no problem. Please supply me with the info you have and i'll send you back a test report.

Page me as soon as you've uploaded the branch so i can check it out.

Posted by kide at Feb 01, 2011 06:31

Ernst,

I've uploaded my code changes to a new branch as promised, I've written an overview in a separate thread:

Telnet Read Status Implemented

Posted by kurrazyman at Feb 02, 2011 22:27

Topic closed

Posted by kide at Feb 10, 2011 13:12
Document generated by Confluence on Jun 05, 2016 09:32