Keepalives between Homegate and Comfort?

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by Ingo, Jul 28, 2008.

  1. Ingo

    Ingo

    Joined:
    Dec 2, 2006
    Messages:
    290
    Likes Received:
    1
    Location:
    South Africa
    Has anyone ever tried to run a Keepalive protocol between two Logic engines? I have HomeGate on the one end and Comfort on the other. When all things are perfect, HomeGate runs all my logic but it has happened twice that my Serial-to-Ethernet converter has 'blown' due to lightning and then there is logic no more. I can hear you saying PAC already...

    I thought of a Active/Standby scenario for HomeGate. If HomeGate loses connectivity to CBus (the other Logic engine) then it must display "Fallback Mode" on the screen - no problem and only for informational purposes. On the otherhand, I want Comfort to change from Standby to Active mode and run some minimal logic to control things until the connection to HomeGate is restored.

    What I came up with is to set a CBus group, EG. 254, to ON, then I check in Comfort for Counter 254, if ON then wait 2s and turn it off again. If HomeGate detects group 254 to be ON after 10s then it tries 3 times and declares the connection down. If the group is OFF when checking then it keeps on polling.

    On the Comfort side, if the "set_cbusgroup254_OFF" response runs it also retriggers a timer and keeps the unit in Slave mode. My logic on Comfort is then written to look at the Active/Standby state before it runs any responses or logic code.

    Unfortunately my Keepalive protocol isn't very reliable - it misses a few polls every now and then. Any suggestions for a simpler solution?
     
    Ingo, Jul 28, 2008
    #1
  2. Ingo

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,397
    Likes Received:
    26
    Location:
    Adelaide, South Australia
    Simple suggestion:

    System A is the master.

    System B is the standby / fail-over device.

    Set up system B so that it expects to get a "ping" of some form, say every 2 minutes. And if it does get that ping it sets a flag to say "the master is there so I do not need to take over". If it has received NO PINGS AT ALL at the end of any 2 minute period then it assums the master is dead and takes over.

    Now set up System A so that it sends a ping every 30 seconds. This way normally system B will be getting 4 pings roughly (actually it will be 3 to 5 because of timing differences) in each "timeout" period.

    This gives you tolerance to missed pings between the systems - you can have timing differences and/or drop one or two and it will be no big deal.

    But if System A really does stop or go down for some reason, system B will pick up and take over.
     
    ashleigh, Jul 29, 2008
    #2
  3. Ingo

    Ingo

    Joined:
    Dec 2, 2006
    Messages:
    290
    Likes Received:
    1
    Location:
    South Africa
    Thanks. Let me rewrite my code and see what happens.
     
    Ingo, Jul 29, 2008
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.