This page last changed on Jan 29, 2012 by mewar.
I jumped into your marvelous project and just at the beginning I discovered following problems:
1) Controller is polling TCP server for sensors' value even if no panel is connected
2) Controller is polling for ALL the sensors in ALL the panels and panels' screens
3) Controller is closing/reopening the TCP connection for every sensor in each polling loop
All of these increases a lot the traffic between the controller and the TCP server. My system is going to consist
of 3 panels (android, iphone, web) each containing about 100 sensors (on 10 screens). I can't imagine that my server will stand that
Instead of having 300 connections per second, it could be something like 10. If controller would poll only the sensors
from active screen of active panel.
I found on this forum solution to 3) by using Richard's connection manager but I was not able to figure out how to solve 1) and 2).
Could you guide me on that?
Thanks and again I really like what you are doing
If you reuse the same sensor for all panels, you should only have 100 sensors.
It does not matter how many screens are using those sensors. So 2) should not be an issue already.
The TCP protocol implementation is still based on our deprecated StatusCommand interface which means the socket request is performed every 500ms and the connection is closed and opened for each call. This will change to be based on our EventListener interface where (depending on the device) you can either define a polling interval or no polling is done but the device is informing about state changes while the connection stays open.
This is on the list but I cannot give you a release time yet.
Posted by mredeker at Jan 29, 2012 13:39
OK. Thanks for the answer. It seems that this EventListener is going to resolve most of my problems. Bad luck it is not ready yet.
Do you think that, for the moment, I would be able modify the Controller that it won't poll TCP server if any of the panels is not connected? I don't have an idea where to search...
Posted by mewar at Jan 29, 2012 19:28
That would involve some deep code digging
Right now the way it works is that the panel is only asking the status cache for the sensor values.
The controller is responsible for updating the statuc cache. So there is no real connection between a connected panel and the sensor update.
You could increase the polling interval if that would help in the moment.
The value is defined in org.openremote.controller.protocol.ReadCommand
Posted by mredeker at Jan 29, 2012 19:55
I've already increased the polling interval. This change and kind of connection manager which will keep the TCP connection must be enough for the moment. I'm not ready for exhaustive digging
Posted by mewar at Jan 29, 2012 20:36
Yes, I vote for improvement here too.
After doing some tests with capable devices - I ended up with over two hundred TCP/IP sensors per device (switches, various sensors etc). There could be 5-10 devices in a loop. Since current controller version 2.x pools every sensor regardless if is used or not - you can imagine how fast messages on Tomcat message window are scrolling
This unfortunately for some reason often causes panels not reacting upon user commands... Not sure if that's CPU issue or something else.
Posted by mlab at Sep 28, 2012 07:20
I've got a similar problem: I'm trying to get openremote to talk with a TCP Server that I implemented on an openpicus Flyport.
Openremote should use a sensor to get the status. Unfortunately the controller sends that request way to frequent (twice per second).
Now I wanted to modify the polling interval in the file described obove: org.openremote.controller.protocol.ReadCommand
This file is a .class file, that I cannot ope with a text editor (only weird letters displayed). I tried to open it with eclipse, but i get an error and can't open.
Please, can somebody explain me how to modify the TCP Polling interval? I'm new to java..
Posted by strupp3003 at Nov 18, 2012 17:14
The other day I looked into Flyport. I noticed it supports a number of communication protocols, amongst which HTTP. In OpenRemote you can define the interval for HTTP calls. Is it an option for you to get your data out of Flyport with HTTP?
Just my 2 cts
Posted by pz1 at Nov 21, 2012 12:13
Thanks for the idea of using http instead of tcp.
I don't exactly know how to use http for communication, I think in Flyport it is mainly intended for the operation of the integrated webserver.
I need to establish a connection between the Flyport and Openremote to send 2-3 commands from OR and receive the Status.
How does the communication with http work? Do I have to build a normal web-page for the Flyport which offers Buttons (Commands) and displays values, and then OR will get the data from that page / send commands via that page?
Thanks for your help!
Posted by strupp3003 at Nov 22, 2012 15:10
If you are in control of the software on the flyport, you could save your data in an XML (or JSON) file. Then het them in OR Designer create a command using the http protocol. I have an example for that if you need it.
Posted by pz1 at Nov 22, 2012 15:26
Yes, I'm currently writing the software. I want to use the Flyport to control an Husqvarna Automower Robot via WLAN..
Unfortunately my http / Html skills are very limited.
I would really appreciate that example!
Posted by strupp3003 at Nov 22, 2012 15:33
Send me an email, and I'll return a little document. (push on my avatar for email address. Please mind the characters .@ you have to replace)
Posted by pz1 at Nov 22, 2012 15:45