How to run C-Gate under Linux with PCI

Discussion in 'C-Bus Toolkit and C-Gate Software' started by JulianC, Aug 15, 2004.

  1. JulianC

    daniel C-Busser Moderator

    Joined:
    Jul 26, 2004
    Messages:
    766
    Likes Received:
    20
    Location:
    Adelaide
    Hi Alex,

    At this point we don't offer Linux-ready distributions, so you'll need to have a Windows installation to start with, be comfortable within a Linux environment, and be prepared to get your hands dirty.

    While people have had success running C-Gate on Linux, you are still advised to run Toolkit and Homegate on Windows.

    Note : The quick-witted out there will spot that Toolkit 1.5.0 still contains the same version 2108 of C-Gate as previous releases. However the supporting files under /unitspec have changed and still need to be copied to Linux in order to be used with Toolkit 1.5.0.
     
    daniel, Aug 17, 2006
    #21
  2. JulianC

    AlexSamad

    Joined:
    Aug 8, 2006
    Messages:
    9
    Likes Received:
    0
    Hi

    I have upgraded to 1.5, and copied the directoy across to my linux box. I am trying to follow the pdf attached, with one exception I have a CNI box not serial attached and can't find the network.txt file talked about. I am presuming (as the windows setup is working) is the setup information is in the .xml file!



    Alex
     
    AlexSamad, Aug 17, 2006
    #22
  3. JulianC

    daniel C-Busser Moderator

    Joined:
    Jul 26, 2004
    Messages:
    766
    Likes Received:
    20
    Location:
    Adelaide
    Hi Alex,

    Have you read through this thread from beginning to end? The pdf at the beginning which refers to networks.txt is now out of date, but the rest of the thread contains useful information.
     
    daniel, Aug 17, 2006
    #23
  4. JulianC

    Richo

    Joined:
    Jul 26, 2004
    Messages:
    1,257
    Likes Received:
    0
    Location:
    Adelaide
    You won't be able to configure it using file editing. Once you have it running you will need to connect to it via Toolkit. Since toolkit is running on a seperate machine (vm) you will need to configure your access.txt file for permissions. This is covered extensively elsewhere in the forums.
     
    Richo, Aug 17, 2006
    #24
  5. JulianC

    AlexSamad

    Joined:
    Aug 8, 2006
    Messages:
    9
    Likes Received:
    0

    hi

    Fixed up the access.txt. had a quick search on using toolkit remotely, but couldn't find anything (will have a second look), but having a look through the windows interface and it doesn't seem to be able to talk to a cgate server running on a different machine..
     
    AlexSamad, Aug 17, 2006
    #25
  6. JulianC

    AlexSamad

    Joined:
    Aug 8, 2006
    Messages:
    9
    Likes Received:
    0
    Hi

    Another question, I have cgate starting at boot up of my linux box. What I have noticed is that my project that is used by homegate is loaded but not started automatically.

    I restarted cgate
    I start homegate project

    and then I telneted into cgate server, ran a projects list and it had my project loaded which is good, but it had not started it. This could just be me not waiting long enough.

    So my questions is should i append a config file to the start up line which loads and starts my project or will homegate there eventually

    Alex
     
    AlexSamad, Aug 17, 2006
    #26
  7. JulianC

    bgprior

    Joined:
    Aug 13, 2006
    Messages:
    2
    Likes Received:
    0
    Thanks for the suggestions Daniel. Yes, I copied everything under C:\Clipsal\C-Gate2.

    I've tried following your suggestions from start to finish (apart from installing commapi in /usr/lib, which I think was a mistake, right?), but still get a "Critical Server Exception". Could I confirm a couple of details (given that I am running an i586 version of linux on an AMD64 machine:

    1. Should I be using the linux or solaris/sparc version of commapi (sounds a daft question, but the original instructions emphasised that you should use the solaris one)?

    2. Do I still need RXTX from rxtx-bins, as well as commapi, and if so, again should I be using the linux-i386 or the solaris-sun version?

    I have tried with or without RXTX and the linux and solaris versions of commapi without success. At the moment, I am using the linux versions, because it makes more sense for my machine. I have the following files installed:

    comm.jar in /usr/java/jre/lib/ext/

    RXTXcomm.jar in /usr/java/jre/lib/ext/

    libLinuxSerialParallel.so, libLinuxSerialParallel_g.so, libSerial.so and libParallel.so in /usr/java/jre/lib/i386/

    The whole of the filesystem from C:\Clipsal\C-Gate2 under /usr/bin/cgate2/

    javax.comm.properties in /usr/bin/cgate2/ (with just the one uncommented line: "Driver=gnu.io.RXTXCommDriver")

    "/usr/java/jre/bin/java -version" returns:

    #java version "1.5.0_05"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
    Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)

    But /usr/java/jre/bin/java -jar cgate.jar gives me the following error (stripping out the crud):

    java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver

    Has the line I should put in javax.comm.properties changed, so I am pointed at the wrong driver, am I using the wrong driver version, or have I omitted something that means the driver isn't available or is missing something it needs? I've tried changing the Driver to gnu.io.CommDriver or javax.comm.CommDriver, but to no avail - it just changes the class that fails to instantiate.
     
    bgprior, Aug 17, 2006
    #27
  8. JulianC

    Richo

    Joined:
    Jul 26, 2004
    Messages:
    1,257
    Likes Received:
    0
    Location:
    Adelaide
    http://www.cbusforums.com/forums/showthread.php?t=628
     
    Richo, Aug 17, 2006
    #28
  9. JulianC

    Richo

    Joined:
    Jul 26, 2004
    Messages:
    1,257
    Likes Received:
    0
    Location:
    Adelaide
    There should be no need to do anything else, Homegate should be able to do it all.
     
    Richo, Aug 17, 2006
    #29
  10. JulianC

    AlexSamad

    Joined:
    Aug 8, 2006
    Messages:
    9
    Likes Received:
    0
    Hi

    Thanks for the help.

    I made a small change to the debian scripts to make it start in the cgate directory.

    Code:
    #!/bin/sh
    #
    # Starts and stops the c-gate server
    
    CGATEDIR="/home/clipsal/C-Gate2"
    CGATEJAR="$CGATEDIR/cgate.jar"
    CGATEPID="$CGATEDIR/cgate.pid"
    JAVARE="/usr/bin/java"
    PARAMS="-jar -noverify $CGATEJAR"
    LOCKFILE="$CGATEDIR/cgate.lock"
    
    test -x "$CGATEJAR" || exit 0
    
    startcgate() {
                    echo -n "Starting C-Gate server:"
                    cd $CGATEDIR
                    start-stop-daemon --start \
                    --make-pidfile --pidfile $CGATEPID \
                    --chuid clipsal \
                    --exec $JAVARE \
                    --chdir $CGATEDIR \
                    -- $PARAMS &
                    echo "."
    }
    
    stopcgate() {
                    echo -n "Stopping C-Gate server:"
                    start-stop-daemon --stop --quiet \
                    --pidfile $CGATEPID
                    rm $CGATEPID
                    rm $LOCKFILE
                    echo "."
    }
    
    case "$1" in
            start)
                    startcgate
                    ;;
            stop)
                    stopcgate
                    ;;
            restart)
                    stopcgate
                    startcgate
                    ;;
            *)
                    echo "Usage: /etc/init.d/cgate (start|stop|restart)"
                    exit 1
                    ;;
    esac
    
    exit 0
    
    Plus for those who want to find out how to admin a remote repository, open the toolkit, then file close repositroy, file open remote repository
     
    AlexSamad, Aug 17, 2006
    #30
  11. JulianC

    AlexSamad

    Joined:
    Aug 8, 2006
    Messages:
    9
    Likes Received:
    0
    AlexSamad, Aug 18, 2006
    #31
  12. JulianC

    Richo

    Joined:
    Jul 26, 2004
    Messages:
    1,257
    Likes Received:
    0
    Location:
    Adelaide
    Aaarr.... you wouldn't be the first to get caught by that, have done it myself.
     
    Richo, Aug 18, 2006
    #32
  13. JulianC

    danielcrawshay

    Joined:
    Nov 16, 2004
    Messages:
    1
    Likes Received:
    0
    Location:
    Wellington, New Zealand
    I have been struggling and failed to set up C-Gate on my linux server also. I also receive the "Error instantiating class" error. bgprior, did you manage to get this issue resolved? Can anyone else help out?
     
    danielcrawshay, Dec 5, 2006
    #33
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.