C-Gate and CNI (noob inside)

Discussion in 'C-Bus Toolkit and C-Gate Software' started by DaveQB, Mar 9, 2011.

  1. DaveQB

    DaveQB

    Joined:
    Jul 1, 2010
    Messages:
    25
    Likes Received:
    0
    Location:
    DaveQB
    Hi all.

    Finally have cbus setup in the house and a CNI on the TCP/IP network.

    I have read the C-Gate Manual and it is quite good, but seems to assume you have projects and a network connection already.

    I was looking for a tutorial that starts you off with a new cbus network (pre-programmed or not) and connects you to the CNI etc.

    Any tips on setting this up? I read that a networks.txt file is needed but then read that was only for 1.5 and not > 2.0.

    My CNI has an IP and I can access it via web (port 80) or telnet (port 9999) so now need to get C-Gate communicating with the CNI to then scan the network (?) and create a project (?)

    Thanks for any tips.

    Edit: I have managed to start a project and connect to the CNI. But can't open the network for some reason.


    Code:
    david@david ~ $
    /usr/kerberos/bin/telnet  127.0.0.1 20023
    Trying 127.0.0.1...
    Connected to david (127.0.0.1).
    Escape character is '^]'.
    201 Service ready: Clipsal C-Gate Version: v2.8.0 (build 2307) #cmd-syntax=1.0
    NET CREATE rizal cni 10.3.3.4
    408 Operation failed: Invalid project name
    project list
    124 no projects found
    project new rizal
    200 OK.
    project start rizal
    200 OK.
    project use rizal
    200 OK.
    port list
    126 no ports found
    net list
    132 no networks found
    net create home cni 10.3.3.4
    200 OK.
    port list
    126 no ports found
    net list
    131 network=home State=new InterfaceState=closed
    net save db
    200 OK.
    project save rizal
    200 OK.
    tree rizal
    402 Operation not supported by: //RIZAL
    tree 254
    401 Bad object or device ID: Network not found
    port cniscan
    129 ip-address=10.3.3.4 status=available port=10001 type=CNI
    net open home
    120-initializing
    120-opening port
    120-stopping threads
    120-threads stopped
    120-closing streams
    408 Operation failed: //RIZAL/home: Open failed: failure opening port
    net list
    131 network=home State=new InterfaceState=closed
    
     
    DaveQB, Mar 9, 2011
    #1
  2. DaveQB

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    When you use C-Bus ToolKit to commission a C-Bus installation, it creates a "C-Bus project" file which contains the details of the networks and so forth. It is this project file that C-Gate needs to load.

    If you have an existing C-Bus installation and no project file, use C-Bus ToolKit to create a new project and then scan your networks to build up the project details.

    It is not recommended that you try to use C-Gate commands to try to attempt to do this process yourself.
     
    Darren, Mar 9, 2011
    #2
  3. DaveQB

    DaveQB

    Joined:
    Jul 1, 2010
    Messages:
    25
    Likes Received:
    0
    Location:
    DaveQB
    Thanks for the response Darren.

    Does the Toolkit run under Wine perhaps?

    I don't have nay Windows machines handy, hence why I am using C-Gate. Couple that with the fact I was thinking about making a simple web frontend to C-Gate for control by girlfriend and I later.

    I thought C-gate could make a project from a network scan too and easily? Am I wrong?

    Thanks
     
    DaveQB, Mar 9, 2011
    #3
  4. DaveQB

    DaveQB

    Joined:
    Jul 1, 2010
    Messages:
    25
    Likes Received:
    0
    Location:
    DaveQB
    I think it might launch under Wine.

    I will try when I am home and on my network.

    So once the Toolkit runs and sets up a project, that project is saved on the c-gate side and then access the c-gate daemon from any host (with telnet or toolkit) would allow one to see the projects, load it and make slight adjustments?

    Thanks
     
    DaveQB, Mar 9, 2011
    #4
  5. DaveQB

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,397
    Likes Received:
    26
    Location:
    Adelaide, South Australia
    Toolkit MAY run under Wine, but it needs to talk to C-Gate. Getting that to go might be ok, and might not. You will have to fiddle about and try it.
     
    ashleigh, Mar 9, 2011
    #5
  6. DaveQB

    DaveQB

    Joined:
    Jul 1, 2010
    Messages:
    25
    Likes Received:
    0
    Location:
    DaveQB
    Well no I have cgate.jar running, that is how I ran all those commands in my first post.

    So I have got Toolkit running under wine and I seem to be getting as far as I did using Telnet. See image.

    I notice I don't have any license info when cgate starts like it states I should in the c-gate manual. Could this be an issue??

    [​IMG]
     
    DaveQB, Mar 9, 2011
    #6
  7. DaveQB

    DaveQB

    Joined:
    Jul 1, 2010
    Messages:
    25
    Likes Received:
    0
    Location:
    DaveQB
    Ahh posted too soon.

    Clicking on Unit > Scan Network
    Got all 41 units showing up.
    And then I can transfer them to the DB.

    I would love to know what c-gate commands this is issuing to get this done.
     
    DaveQB, Mar 9, 2011
    #7
  8. DaveQB

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    Obviously ToolKit uses C-Gate commands to create the networks and so forth. However, it is really not a good idea to try to do this manually. It would be very easy to create a dodgy project which will cause all sorts of grief. It is safest (and easiest) to let ToolKit do this for you.
     
    Darren, Mar 9, 2011
    #8
  9. DaveQB

    DaveQB

    Joined:
    Jul 1, 2010
    Messages:
    25
    Likes Received:
    0
    Location:
    DaveQB
    Cool.

    So once I have setup the project in Toolkit and saved it, I can then later access it with telnet to C-Gate, load it up and make small changes??

    Thanks Darren
     
    DaveQB, Mar 10, 2011
    #9
  10. DaveQB

    DaveQB

    Joined:
    Jul 1, 2010
    Messages:
    25
    Likes Received:
    0
    Location:
    DaveQB
    It seems I might have been right in my statement. Although had some issues with the Toolkit that using simple Telnet helped "kick" into gear.

    Now to work out how to re-program sensors....

    Thanks guys.
     
    DaveQB, Mar 11, 2011
    #10
  11. DaveQB

    daniel C-Busser Moderator

    Joined:
    Jul 26, 2004
    Messages:
    770
    Likes Received:
    21
    Location:
    Adelaide
    Hi DaveQB,

    First of all, take care when running both a telnet session and a Toolkit connection to C-Gate at the same time - you may inadvertently confuse one session with something done in the other session. You won't have any problems though if you do all programming in Toolkit and use the telnet session for run-time C-Bus operations only (triggering and detecting application events).

    To peek at how Toolkit talks to C-Gate, you can execute events e9s0c0 in your telnet session to make level 9 log messages appear there. Alternatively set up the C-Gate config file to write to event.log at level 9 - all this is in the manual.

    You'll note there are hundreds of commands used to construct a database, and in a very specific order - that's why we recommend you use Toolkit to do this and it only has to be done once for an installation.

    Once you have everything programmed in Toolkit, you can toggle and ramp groups in Toolkit and see how the commands are sent to C-Gate. That will help you form the basis of your custom interface.

    BTW - you can disregard the mention of licensing - C-Gate licenses are now unlimited and there are no restrictions.
     
    daniel, Mar 21, 2011
    #11
  12. DaveQB

    DaveQB

    Joined:
    Jul 1, 2010
    Messages:
    25
    Likes Received:
    0
    Location:
    DaveQB
    Thank you very much Daniel

    This is the path I have found. I have been using Toolkit to mess with the current settings (timer on PIR's, which button does what etc). Still learning my way around it. Then I aim to use telnet/sockets in a python script to do any day-to-day things I might want to do.

    Toolkit does seem to run well in Wine. It crashes sometimes, but I found using it in a Windows XP Virtual Box session it crashes there too. Seems more prone to crashing when importing all 50+ units from the network into the DB.

    Cool about the licensing. I have just moved on, and hadn't yet ran into any direct problems I thought were relating to licensing. Now I can definitely run that out for any future problems.

    Thanks again!
     
    DaveQB, Mar 21, 2011
    #12
  13. DaveQB

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,397
    Likes Received:
    26
    Location:
    Adelaide, South Australia
    It is perhaps worth pointing out that if you go changing the settings of a device outside Toolkit you do run the risk of breaking things, possibly in subtle and hard-to foresee ways.

    If you do this, please don't see help from Clipsal technical support. And it may also be that Toolkit crashes on loading the settings from a unit. This is because Toolkit validates the settings of a unit as they are loaded and if there is something set which is illegal, Toolkit gets all uppity.

    So... in other words, be careful, any changes you make to device programming outside Toolkit means you are on your own in every possible way and sense. There will be no warrantee support or technical support.
     
    ashleigh, Mar 21, 2011
    #13
  14. DaveQB

    DaveQB

    Joined:
    Jul 1, 2010
    Messages:
    25
    Likes Received:
    0
    Location:
    DaveQB
    Thanks ashleigh

    Valid points. I was planning on using telnet/sockets to control things like lights on/off, triggers for when alarm/sensors go off etc.

    So I will keep what you say in mind when messing with that.

    Thanks all for the info.
     
    DaveQB, Mar 22, 2011
    #14
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.