No-polling 2-way interface

Pop your questions regarding Home automation software here.....
Post Reply
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

No-polling 2-way interface

Post by Digit »

I'm currently working on the foundations for my homebrew Touch application. It's going to be written in VB.NET and will run on my ASUS TOP.

Now i'm considering a few options on how to supply this Touch application with data it has to show on the screen.
I could periodically query the database. Everything needed is in there.
Or i could query my HA application by means of XML-RPC.

I have both methods available and ready to run, but i'm not sure if this is the best way to do it.
I would prefer having a mechanism that pushes new information to the Touch app as soon as it becomes available; i just don't want to use polling on the Touch-side to get the info available to the Touch.

Now you could implement XML-RPC in 2-way:
1 for Touch -> HA for things like user activity on the Touch,
and another one for HA -> Touch meant for displaying changed data on the Touch screen.

Any suggestions on other ways to accomplish what i want, without polling?
User avatar
Rene
Global Moderator
Global Moderator
Posts: 1689
Joined: Wed Oct 08, 2008 3:54 pm
Location: Netherlands

No-polling 2-way interface

Post by Rene »

From what you are describing I guess you are using HTTP as the communication protocol between the touch and HA application. Why are you not using a persistent connection? Using a persistent connection, you can push new info as soon as it becomes available in your HA application.

Rene.
Mdamen
Forum Moderator
Forum Moderator
Posts: 390
Joined: Sat Nov 22, 2008 6:58 pm
Location: Netherlands
Contact:

No-polling 2-way interface

Post by Mdamen »

You could for example use socketjs:

http://dev.dschini.org/socketjs/

Implement a server socket in your application and then write to the client socket as soon as data becomes available.

--
Maarten Damen

www.maartendamen.com
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

No-polling 2-way interface

Post by Digit »

Thanks Rene, keep-alive can be a good solution too, haven't tried that one yet. I'll give it a try.
Maarten thanks for the tip, i didn't mention it but i was talking about 2 Windows Forms applications :-)
Esteban
Forum Moderator
Forum Moderator
Posts: 677
Joined: Sun Jan 13, 2008 6:39 pm
Location: Netherlands

No-polling 2-way interface

Post by Esteban »

For HS -> Touch you could something like UDP broadcasting? Every client then just picks up whatever events you broadcast.

Ciao,
Esteban
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

No-polling 2-way interface

Post by Digit »

Thanks Esteban for reminding me :-)
I am already using UDP broadcast for some time for another purpose: broadcasting incoming phone calls to all the PC's where a tiny tool will pop up and display the phone number. (why didn't i think of that)
I've altered my HA application to broadcast every change over UDP and added a listener to my Touch app. I think this is good enough.
For the Touch -> HA direction i think i will first try XML-RPC; this also gives me SSL when i need it.

Thanks for all your suggestions.
Post Reply

Return to “Questions & Discussions Forum”