CGate on raspberry pi with Homegate, Colour Touch and or Wiser on network

Discussion in 'C-Gate Developers' started by DarylMc, Dec 29, 2017.

  1. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,052
    Likes Received:
    4
    Location:
    Brisbane, QLD, Australia
    I have some questions regarding CGate on raspberry pi used in conjunction with other CBus devices.
    I'm trying to look for potential problems or things to avoid.

    Is it OK to run multiple CGates on a network (to multiple interfaces) and is there some config changes that should be made?
    Is it critical that all the project xml's are identical?
    Would it matter if some of the xml's were created with older CGate versions?
    That info doesn't seem to change in the xml text even if a project is upgraded.

    First Homegate/Schedule Plus.
    I think the solution is simple and point it to a remote CGate on the raspberry pi checking compatible versions.

    Colour Touch appears to run CGate.
    Should anything be changed when running another CGate?
    I already know some things.
    Run logic and schedules on just one or the other.
    Can't think of any other problems.

    Wiser I have never used.
    I am sure it has the project xml stored.
    Does Wiser run a CGate in operation?
    So in conjunction with other instances of CGate on the network can anyone think of any potential pitfalls?

    For my own small test network I just rebuilt the whole project with a current CGate version.
    If there is an older CTC on the network or Wiser would that need to be fully rebuilt with identical xml files and CGate version?
     
    Last edited: Dec 29, 2017
    DarylMc, Dec 29, 2017
    #1
    1. Advertisements

  2. DarylMc

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    768
    Likes Received:
    28
    Location:
    Adelaide, Australia
    You can run multiple copies of cgate with their own interfaces, but why would you ever need to? The whole point of cgate is that is handles multiple connections so you only ever need a single copy. If you ran multiple copies they would all need their own (identical) copy of the tag file and if you ran Toolkit on one you would then need to update all the others. Lots of potential problems for no advantage.

    The touch screens (and wiser) don't actually use the tag file. All group names are converted to numbers at compile /upload time and the numbers are used , not the names (you can use logic to access names in a colour touch screen but that is rare). Once GA numbers a assigned there is no need to change them.

    So just run a single copy of cgate and ignore all the embedded devices.
     
    Ashley, Dec 29, 2017
    #2
    1. Advertisements

  3. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,052
    Likes Received:
    4
    Location:
    Brisbane, QLD, Australia
    Thanks Ashley
     
    Last edited: Dec 29, 2017
    DarylMc, Dec 29, 2017
    #3
  4. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,052
    Likes Received:
    4
    Location:
    Brisbane, QLD, Australia
    Hi Ashley
    For instance I recently set up a pi3 with cgate and homebridge.
    The Wiser on site already has a project loaded.
    I copied the project xml from the on-site pc to the pi
    The pi had a much later version of cgate and toolkit threw an error when trying to open a remote cgate connection
    I installed latest toolkit to the windows pc
    Then I edited some tag names in the pi database with a current version of toolkit.
    But haven’t touched the Wiser.
    Wiser is still running it’s stuff.
    It’s a Wiser 2 so pi is using a spare Ethernet interface on it
    Both are running on the cbus network right now.
    I haven’t heard any problems so far but thanks very much for the info.
     
    DarylMc, Dec 29, 2017
    #4
  5. DarylMc

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    768
    Likes Received:
    28
    Location:
    Adelaide, Australia
    Toolkit and c-gate are very closely aligned so the versions always have to match. 3rd party apps generally only use a few common c-gate commands that haven't changed for years so you are unlikely to have problems there. As far as I am aware, the Wiser doesn't use the tag file at all. Piced uses the tag file to convert tag names to ga addresses which is all the wiser cares about. So changing tag names will have no affect on the Wiser. If you had say a ga called Bathroom with a value of 50 and you deleted it and created a new tag called Bathroom which had a value of say 60, nothing in the networks would actual change since every device would continue to use address 50. If you opened a device that was originally assigned to Bathroom you would find toolkit had given it a name of Group50. If you then changed it back to Bathroom it would then get a value of 60, but wouldn't talk to any previous Bathroom devices because they would still be at address 50.
     
    Ashley, Dec 30, 2017
    #5
  6. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,052
    Likes Received:
    4
    Location:
    Brisbane, QLD, Australia
    DarylMc, Dec 31, 2017
    #6
  7. DarylMc

    ICS-GS

    Joined:
    Nov 1, 2004
    Messages:
    346
    Likes Received:
    0
    Location:
    SE Melbourne
    So if I have an existing CTC, and wiser...
    And looking for HomeKit integration via Raspberry Pi, would I install a local version of cgate on the pi or try to reach the cgate in the. CTC?

    Not that I’m there yet but also looking for google home integration too... would similar principals apply?
     
    ICS-GS, Feb 9, 2018
    #7
  8. DarylMc

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    768
    Likes Received:
    28
    Location:
    Adelaide, Australia
    CTC's don't actually run Cgate and there is no way to use them as a Cbus interface. You will need your own copy of Cgate running somewhere with a dedicated pci or cni. If you have a Wiser Mk11 it has 2 cbus interfaces so you can use one of those. If it's a Mk1 you are out of luck because if you connect to it's cni the Wiser functionality is disabled. It's meant for configuration via toolkit only.
     
    Ashley, Feb 9, 2018
    #8
  9. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,052
    Likes Received:
    4
    Location:
    Brisbane, QLD, Australia
    @ICS-GS
    I'm hoping @Ashley will pop in with some wisdom but I want to describe what I will be doing next time I go to a Touch screen.

    First thing
    Record your current Toolkit and Piced versions
    Backup everything.
    Toolkit project, CTC project, Wiser and put it somewhere you can find it again.

    The CGate version on my PI is latest so since I choose to use it the latest Toolkit is also needed.
    It is an option on the PI to use an earlier version of CGate which matches your existing Toolkit/Piced and not too difficult on the PI if you wanted to do that.
    But since I choose a new CGate Piced probably requires to move to latest version too.
    I'd then make sure CTC and Wiser were upgraded saved and verified to be working correctly.

    Copy the you beaut up to date xml from the Toolkit PC to the PI and run CGate there for Homebridge.

    Something happened last time I was at a CTC with Homebridge on a PI and it seems a few group addresses got switched around in the unit programming?
    I swear I had the right xml.
    So next time I will make sure the PI is offline while sorting out Toolkit and Piced.

    Then I think I might be inclined to use Toolkits CGate on the PC if there was any little unit tweaks in the future.
    With the PI off line.
    Then copy the xml over to the PI.
    Whether doing some Toolkit changes on PC or PI I would also make sure to shut down Homebridge service.
     
    DarylMc, Feb 9, 2018
    #9
  10. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,052
    Likes Received:
    4
    Location:
    Brisbane, QLD, Australia
    You beat me to it Ashley:)
     
    DarylMc, Feb 9, 2018
    #10
  11. DarylMc

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    768
    Likes Received:
    28
    Location:
    Adelaide, Australia
    Why wouldn't you just run one copy of Cgate on the Pi and connect to it from everything? No having to copy tag files around and no chance of a mistake. I run Cgate on a headless mini pc (much easier than a Pi and really not that much more expensive :) ) and just do a remote connection via Toolkit or Piced when required.
     
    Ashley, Feb 9, 2018
    #11
  12. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,052
    Likes Received:
    4
    Location:
    Brisbane, QLD, Australia
    @Ashley
    CGate runs really nice on the PI and it's taken me years but now I find it pretty easy to setup.
    Thanks to the folks who put instructions online.

    I think with Toolkit/Piced updates which I generally do take and also in conjunction with tinkering around adding and removing devices it is easy to drag the xml over to the pi when needed.
    Either way I just need to make sure I have a backup and know where to find it.

    I spend quite a bit of time on raspberry pi trying to get new things going and trying to learn more about Linux.
    So I end up rewriting the image fairly often.
    Have you tried Homebridge?
     
    DarylMc, Feb 9, 2018
    #12
  13. DarylMc

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    768
    Likes Received:
    28
    Location:
    Adelaide, Australia
    I'm an Android guy :).
     
    Ashley, Feb 9, 2018
    #13
  14. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,052
    Likes Received:
    4
    Location:
    Brisbane, QLD, Australia
    Bit hard to get excited about Homebridge then:)
    I'm the only person in my home on iOS so I will be looking at Amazon and Google's platform one day.
     
    DarylMc, Feb 9, 2018
    #14
  15. DarylMc

    znelbok

    Joined:
    Aug 3, 2004
    Messages:
    1,092
    Likes Received:
    5
    What headless PC are you using that is a similar price to the Pi?

    I need to find something like that that can run windows and is cheap.
     
    znelbok, Feb 9, 2018
    #15
  16. DarylMc

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    768
    Likes Received:
    28
    Location:
    Adelaide, Australia
    I'm running a Cenove Mini PC with W10 which I bought for $180 from Bangood (it's $200 now).

    https://www.banggood.com/Cenovo-CEN...html?rmmds=myorder&ID=515952&cur_warehouse=CN

    I figured by the time you put a Pi together with power supply, case, sd card it would be nearly $100 anyway, plus all the hassles of getting cgate to run and updating it. The mini pc currently runs Cgate, Kodi and a home grown app that does all the control integration and cbus logic. The only annoyance I have found is that there is no bios setting to resume after a power failure so you have to restart manually. A 12V ups is on the shopping list. I use TightVNC to connect to it when required, but most of the time it just chugs away happily but itself.
     
    Ashley, Feb 10, 2018
    #16
  17. DarylMc

    znelbok

    Joined:
    Aug 3, 2004
    Messages:
    1,092
    Likes Received:
    5
    That's an awesome little PC - perfect for the client I need to install for CQC - fits behind a touchscreen and the passive cooling means its quiet as. I typically have used NUC's, but they are not as cheap.
     
    znelbok, Feb 10, 2018
    #17
  18. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,052
    Likes Received:
    4
    Location:
    Brisbane, QLD, Australia
    @Ashley
    At a remote site I have been looking at lately we are having some troubles to setup what I am quite sure is a good working Homebridge and CGate image on a PI3.
    The site has 3 CBus networks and I believe that is because there is two wireless bridges.
    Multiple applications in use for security, HVAC and others.
    Over 500 group addresses.

    Do you know if it would be possible for the CGate on the PI to have a custom xml with only the applications and group addresses required?
    I suppose CGate would also need to be told not to look for or add the rest to the project?
     
    DarylMc, Feb 11, 2018
    #18
  19. DarylMc

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    768
    Likes Received:
    28
    Location:
    Adelaide, Australia
    This is possible but I'm not really sure why you would want to do it. Cgate can very reliably map multiple networks so it is unlikely to be an issue. What are the actual problems you are trying to solve?
     
    Ashley, Feb 11, 2018
    #19
  20. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,052
    Likes Received:
    4
    Location:
    Brisbane, QLD, Australia
    @Ashley
    Homebridge and CGate on PI3 256MB memory allocated.
    For me at least Homebridge service has some problems at boot if CGate is not running or I'm quite sure if CGate is not fully synced.
    Interestingly only at boot.
    I can stop CGate service and restart it no problem once everything has been running.

    On my small test network with 9 group addresses I have a 90 second delay before starting Homebridge service.
    Less than 90 seconds Homebridge starts and connects but has a problem which does not seem to recover where messages from Homebridge to CBus work but CBus to Homebridge does not update.

    On the larger site with multiple networks and 500 group addresses I estimate it could take a very long time for CGate to fully finish syncing.
    At least initially I was thinking of trying a trimmed back xml since there will be less than 100 group addresses used at this time due to a Home app limitation of 100 accessories per bridge..
     
    DarylMc, Feb 11, 2018
    #20
    1. Advertisements

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.