API Questions 2010-09-09T21:14:00+00:00

HOME Forums Gateways EZSrve API Questions

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • Anonymous
    Post count: 2
    #40276 |

    I am working on a quick proof of concept for web app with a simple touch interface. I noticed a few things while working on it.

    The ReadCluster and WriteCluster commands are documented in the v2 api as having responses with the same names, but it seems like I am getting a ClusterResponse for both. It is not to hard wait for the ClusterResponse with the correct device for the Read or Write that I sent.

    The next problem showed up because my web server was stateless so each request was opening a new tcp connection. Quickly toggling 2 devices sends two ajax calls which opens two tcp connections to the EZSrve each trying to read the current state and update it. I was seeing was the second request work and the first wait for a ClusterResponse that never came. Serializing the requests in my server or keeping a single connection worked as a workaround, but and it seems that if any other connection sends a request while another is waiting for a response both responses are sent to the connection with the last request.

    I am not sure what the correct behavior is. On a WriteCluster I could not wait for a response and hope it worked. On a ReadCluster I could resend the request if I don’t get a response after some timeout. But this seems like it would also cause problems if you wanted to be able to update a UI in real time with the asynchronous ClusterResponses because you would never be able to tell if you missed any.

    A copy of the library I am using to access the EZSrve is at GitHub

    Anonymous
    Post count: 2

    I have build a proxy that sends all responses from the ezserv to all the connected clients. It makes sure the that request to the ezserv are not intermixed. It also adds a delay between commands that I have found helps making sure you get a response. Clients using it need to be able to handle getting any response at any time., but other than that nothing special is needed. I have been running it on my wireless router without any problem so I still don’t need a PC on all the time.

    I have a bad video of the harmony client and my web interface both getting updates at the same time.

    http://www.youtube.com/watch?v=TYuBW4wEYSI
    http://github.com/armooo/ezsrve-proxy

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.