Cgate on Raspberry Pi

Discussion in 'C-Bus Toolkit and C-Gate Software' started by GlenF, Nov 22, 2016.

  1. GlenF

    GlenF

    Joined:
    Jan 22, 2006
    Messages:
    130
    Likes Received:
    0
    Hi all,

    Been trying to get cgate running on a raspberry Pi to try and get Homekit working. This bit all works fine thanks to ievolve, however, I am having difficulty getting cgate to talk to the CNI.

    Cgate is running fine on the pi but I cannot work out how to connect it.

    Any suggestions for the following appreciated:

    How do I open a cgate style window in the PI. I have seen a few examples but I cannot get a line to start it.

    How can I configure the cgate to talk to my CNI or does it just find it. My challenge is the cgate commands through homekit are not responding.
     
    GlenF, Nov 22, 2016
    #1
  2. GlenF

    Damaxx

    Joined:
    May 12, 2008
    Messages:
    228
    Likes Received:
    47
    To connect to the pi c-gate from a windows pc, you need a telnet program like putty.
    Then use that program to connect to the pi IP address with port number 20023.

    Question 2 - you will need to add your cni, project name, etc in the C-Gate settings file. Easiest way that I have found is to copy the details or the whole file across to the pi (with a program like WinSCP) from a windows pc that you have used Toolkit on to connect to the CNI. If it runs cgate on the windows pc, it will fill the Cgate file with all the details.

    Not near my pc or I would put in a few links & screenshots.
     
    Damaxx, Nov 23, 2016
    #2
  3. GlenF

    GlenF

    Joined:
    Jan 22, 2006
    Messages:
    130
    Likes Received:
    0
    Thanks Damaxx, I will give it a try
     
    GlenF, Nov 29, 2016
    #3
  4. GlenF

    GlenF

    Joined:
    Jan 22, 2006
    Messages:
    130
    Likes Received:
    0
    Hi Damaxx,

    Still having issues, I think I am out of my depth on this one.

    The Putty screen will not connect and says Network error: software caused connection abort (under SSH) or under Telnet is say 421 connection refused.

    I have added the IP address to the access file in cgate so not sure what to do next.
    Glen
     
    GlenF, Nov 30, 2016
    #4
  5. GlenF

    Ambro

    Joined:
    Nov 23, 2010
    Messages:
    104
    Likes Received:
    1
    Location:
    Adelaide
    Hey GlenF,


    I assume you're doing a Cgate/Homebridge install.
    Maybe this might help....

    Install Jessie Lite. (google how to)

    Connect putty to RPI. (google how to). Stay with basic user and password.

    *IMPORTANT*
    I'm new to linux & one thing that has caught me out is that some commands are case sensative (especially file names). Make sure you are typing things correctly or better yet simply cut commands found in the links below and right click in putty to paste.
    *IMPORTANT*

    Follow the instructions on this link to install Homebridge on RPI (it will also take you through bringing your RPI up to date with necessary installs):
    https://github.com/nfarina/homebridge/wiki/Running-HomeBridge-on-a-Raspberry-Pi

    You should connect your homebridge code to a known working and running cgate connection (such as your laptops IP address running windows cgate service which you've successfully connected on). Cgate needs to be running. You should see the homebridge running with cgate messages updating the putty screen and should be able to connect via iphone app. Ctr+C to exit homebridge and make it a service.

    Make sure homebridge runs as a service. It should say Active and Running - if it doesn't work then find out where you went wrong before the next step.

    Now for Cgate.....

    Install Java. (google how to)

    Follow the instructions on this link to install Cgate:
    http://addictedtopi.tumblr.com/post/96351714013/installing-c-gate-on-a-raspberry-pi

    don't forget the end step at the bottom of the previous instructions - after you've run the service for the first time as it will create C-gateConfig.txt (and remember "C-gateConfig.txt" is case sensative when trying to edit it with nano!!).

    Cgate is installed but not running properly yet because it needs to know the local project - follow the instructions given in this link to make Cgate run with your project:
    http://www.cbusforums.com/forums/showpost.php?p=4802&postcount=5

    You should be able to run
    Code:
    systemctl status cgate
    and see that the service is active and running.

    Change your password, change the hombridge config file to 127.0.0.1 so it looks at itself when trying to find cgate, reboot and check the services are running again via putty.

    That's it!!! - it'll probably take you a few hours but well worth it. Make backup images of your SD at known working points too - we've all made mistakes and these images are your insurance.

    Last point - If you just want Cgate to run then please have a look at the homebridge instructions too as it gives a basic overall update/setup guide in the beginning which is really helpful for us first timers.

    Cheers,
    Ambro
     
    Last edited by a moderator: Nov 30, 2016
    Ambro, Nov 30, 2016
    #5
  6. GlenF

    GlenF

    Joined:
    Jan 22, 2006
    Messages:
    130
    Likes Received:
    0
    Thanks Ambro, appreciate the help. Looks like I have a busy weekend ahead of me
     
    GlenF, Nov 30, 2016
    #6
  7. GlenF

    GlenF

    Joined:
    Jan 22, 2006
    Messages:
    130
    Likes Received:
    0
    Hi Ambro, your advice was great. Seems my problem all along was a non-capitalised "C" in the file name. Thanks a lot.
     
    GlenF, Dec 1, 2016
    #7
  8. GlenF

    Ambro

    Joined:
    Nov 23, 2010
    Messages:
    104
    Likes Received:
    1
    Location:
    Adelaide
    :D that's why I highlighted that point - I reckon alot of people had been caught out by this in the past, me included !! :D
     
    Ambro, Dec 2, 2016
    #8
  9. GlenF

    Damaxx

    Joined:
    May 12, 2008
    Messages:
    228
    Likes Received:
    47
    Ditto here. Then I worked out how much power the tab key is in linux and everything became a lot easier.
     
    Damaxx, Dec 2, 2016
    #9
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.