CGate on Linux ARM

Discussion in 'C-Gate Developers' started by DarylMc, Jun 22, 2012.

  1. DarylMc

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Could anyone tell me if it is possible to find and run a linux arm cgate on a device such as raspberry pi.

    Thanks
     
    DarylMc, Jun 22, 2012
    #1
  2. DarylMc

    Ingo

    Joined:
    Dec 2, 2006
    Messages:
    290
    Likes Received:
    1
    Location:
    South Africa
    I want to 'bump' this question.

    Can C-Gate run on 512MB RPi ?

    Ingo
     
    Ingo, Feb 5, 2013
    #2
  3. DarylMc

    Mr Mark

    Joined:
    Jan 27, 2006
    Messages:
    322
    Likes Received:
    5
    Location:
    FNQ
    Yes it can.
    I've got C-Gate running on the older RPi with no speed or reliability issues, and it runs 24/7. The only mods I have done include a heat sink and slight over clocking.
    The only drama I still have is being unable to connect to the raspberry pi c-gate when using Toolkit. Most likely some setup error on my part though...

    To make it clearer, C-Gate runs on my RPi. Firing up Toolkit on a PC and using "Connect to Remote C-Gate" option fails. No problems using a Windows PC as the C-Gate server and the access.txt file has been modified accordingly.

    Maybe this weekend I'll try a fresh image on the newer 512MB RPi...

    Mark
     
    Mr Mark, Feb 5, 2013
    #3
  4. DarylMc

    Ingo

    Joined:
    Dec 2, 2006
    Messages:
    290
    Likes Received:
    1
    Location:
    South Africa
    Thanks Mark. I did see the other post as well.

    What image you are running? I tried the Java image with Soft Float and I struggled for a while before I stopped fiddling.

    I do see that the Hard Float is available under 'Early Access' release.

    Ingo
     
    Ingo, Feb 5, 2013
    #4
  5. DarylMc

    Ingo

    Joined:
    Dec 2, 2006
    Messages:
    290
    Likes Received:
    1
    Location:
    South Africa
    Got it working !!!

    Using standard 'wheezy' image, pre-release Hard-Float JaveFX and JulianC's post on getting it all going on Linux.

    I now and then have to connect twice to get it working but that's ok. After editing the CGate-Config file with my project details it works perfectly. Both Toolkit and C-Mote Android App works well. RPi gets a bit busy on initial network sync but that's fine.

    Ingo
     
    Ingo, Feb 5, 2013
    #5
  6. DarylMc

    ievolve

    Joined:
    Mar 20, 2010
    Messages:
    112
    Likes Received:
    1
    Location:
    Idaho
    This is really awesome, I love the raspberry pi!

    I am playing around with a proxy on the pi that will connect to the CNI and proxy traffic to CGate or other apps (like my nodejs/http app) and remove the restriction of having only a single app connected to the CNI. Not sure what hiccups I may hit along the way, but having some fun :)
     
    ievolve, Feb 6, 2013
    #6
  7. DarylMc

    cheekymonkey

    Joined:
    Mar 10, 2013
    Messages:
    19
    Likes Received:
    1
    Location:
    Perth, WA
    Hi, newbie here

    My previous access has been via a 5000SM/2 with a max232 level converter and usb-serial on win7 but I thought it was time to expose the interface via the network.

    I've followed JulianC's post but it seems directed at the x86 platform so failed, I then tried just using javafx and apt-get'g librxtx-java but despite making a link for javax.comm.properties to the cgate dir and trying all sort of things I still have probs. When cgate fires up it seems to work but because the serial portion is broken throws up errors when I try and connect with the toolkit, the Diagnostic utility also doesn't seem to work.

    Couldn't find a version of libjspLuxARM.so that would maybe make things easier so I'd appreciate if some one could find the time to reply with the steps they followed to get their pi working
     
    Last edited by a moderator: Mar 10, 2013
    cheekymonkey, Mar 10, 2013
    #7
  8. DarylMc

    cheekymonkey

    Joined:
    Mar 10, 2013
    Messages:
    19
    Likes Received:
    1
    Location:
    Perth, WA
    Still struggling. It doesn't matter what I try the error message always seem to be similar. I think the message below means it cant see the serial driver but I have placed it in multiple instances of javax.comm.properties that I've found but nothing improves, neither does copying the comm api around.

    Surely you guys made some notes as to how you got it working.

    Code:
    java.io.IOException: Error instantiating class gnu.io.RXTXCommDriver
    gnu.io.RXTXCommDriver
            at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:238)
            at javax.comm.CommPortIdentifier.<clinit>(CommPortIdentifier.java:109)
            at com.clipsal.portpower.plugin.javaxcomm.PortSupporterJavaxComm.g(ProGuard:140)
            at com.clipsal.portpower.plugin.javaxcomm.PortSupporterJavaxComm.d(ProGuard:111)
            at hV.a(ProGuard:64)
            at hG.a(ProGuard:44)
            at com.clipsal.cgate.cmd.Command.b(ProGuard:231)
            at ic.a(ProGuard:62)
            at com.clipsal.cgate.cmd.Command.b(ProGuard:231)
            at cw.a(ProGuard:177)
            at fm.run(ProGuard:259)
            at java.lang.Thread.run(Thread.java:679)
    java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z
            at com.sun.comm.SunrayInfo.isSessionActive(Native Method)
            at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155)
            at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100)
            at javax.comm.CommPortIdentifier.<clinit>(CommPortIdentifier.java:138)
            at com.clipsal.portpower.plugin.javaxcomm.PortSupporterJavaxComm.g(ProGuard:140)
            at com.clipsal.portpower.plugin.javaxcomm.PortSupporterJavaxComm.d(ProGuard:111)
            at hV.a(ProGuard:64)
            at hG.a(ProGuard:44)
            at com.clipsal.cgate.cmd.Command.b(ProGuard:231)
            at ic.a(ProGuard:62)
            at com.clipsal.cgate.cmd.Command.b(ProGuard:231)
            at cw.a(ProGuard:177)
            at fm.run(ProGuard:259)
            at java.lang.Thread.run(Thread.java:679)
     
    cheekymonkey, Mar 18, 2013
    #8
  9. DarylMc

    cheekymonkey

    Joined:
    Mar 10, 2013
    Messages:
    19
    Likes Received:
    1
    Location:
    Perth, WA
    Guys, just wondering why no one has replied.

    Is it my profilename? should I have asked the question slightly differently, just slightly confused as I've never stuck this before on other forums.

    Several people who have posted here that they have it working have been online yet they haven't replied despite being online.

    I can find my way around linux/perl/shell/php but this Java stuff has me stumped.
     
    cheekymonkey, Apr 5, 2013
    #9
  10. DarylMc

    Ingo

    Joined:
    Dec 2, 2006
    Messages:
    290
    Likes Received:
    1
    Location:
    South Africa
    Sorry, I never worked with the serial interface. Perhaps someone else can assist.

    Ingo
     
    Ingo, Apr 5, 2013
    #10
  11. DarylMc

    cheekymonkey

    Joined:
    Mar 10, 2013
    Messages:
    19
    Likes Received:
    1
    Location:
    Perth, WA
    No serial? Sorry I'm a bit confused how you interfaced into CBUS.

    A member has contacted me offline, I'm hopeful my problems will be easily solved and I can then post the solution for others
     
    cheekymonkey, Apr 6, 2013
    #11
  12. DarylMc

    Ingo

    Joined:
    Dec 2, 2006
    Messages:
    290
    Likes Received:
    1
    Location:
    South Africa
    I have a CNI.
     
    Ingo, Apr 6, 2013
    #12
  13. DarylMc

    cheekymonkey

    Joined:
    Mar 10, 2013
    Messages:
    19
    Likes Received:
    1
    Location:
    Perth, WA
    I now have it working on a pi using a usb-serial converter.

    I'm awa on a bit more info so as to clean up the process and some more hardware so I can hopefully get it working using the inbuilt serial pins.
     
    cheekymonkey, May 3, 2013
    #13
  14. DarylMc

    cbusdave

    Joined:
    Jun 19, 2013
    Messages:
    2
    Likes Received:
    0
    Location:
    Albury
    c-gate on raspberry pi

    Hi cheekymonkey,

    Could you post the steps to get this working on Raspberry Pi ? I have tried many different ways the past week (hard float/soft float image, javafx8arm/java1.4.2/open-jdk) and always seem to come unstuck trying to find the arm version of libjspLux, were you able to find or purchase a copy of this library? or were you able to get it working without needing the library at all?

    -cbusdave
     
    cbusdave, Jun 20, 2013
    #14
  15. DarylMc

    cheekymonkey

    Joined:
    Mar 10, 2013
    Messages:
    19
    Likes Received:
    1
    Location:
    Perth, WA
    No probs, but please note I am just a home user and may have used the incorrect terminology in some places

    I didn't purchase the lib, too much of a tight arse, the solution was to setup cgate on the pi as though it was talking to a CNI.

    The solution was found at
    http://www.nutech.com/index.php?option=com_fireboard&Itemid=74&func=view&id=1158&catid=4#1158

    It also meant I could connect using the Diagnostic Utility despite actually only having a serial connection.

    I trust you have been able to successfully install java and cgate successfully so this is a bit abreviated.

    Btw my java version is
    Code:
    java version "1.8.0-ea"
    Java(TM) SE Runtime Environment (build 1.8.0-ea-b36e)
    Java HotSpot(TM) Client VM (build 25.0-b04, mixed mode)
    Get the source

    Code:
    wget http://www.nutech.com/images/fbfiles/files/ser2sock.c
    Build it

    Code:
    cc -o ser2sock ser2sock.c
    Move it

    Code:
    sudo mv ser2sock /usr/local/bin/
    Create a startup script

    Code:
    sudo vi /etc/init.d/ser2sock
    This is mine, exposes the usb port to TCP port 10001, this is used as the port in CGATE and the diagnostic utility

    Code:
    #! /bin/sh
    # /etc/init.d/ser2sock
    
    ### BEGIN INIT INFO
    # Provides:          ser2sock
    # Required-Start:    $remote_fs $syslog
    # Required-Stop:     $remote_fs $syslog
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: Accept simultaneous tcp connections and fwd them to a serial port
    # Description:       A simple script to start / stop the serial port network interface at boot / shutdown.
    ### END INIT INFO
    
    # If you want a command to always run, put it here
    
    # Carry out specific functions when asked to by the system
    case "$1" in
      start)
        echo "Starting ser2sock"
        # run application you want to start
        /usr/local/bin/ser2sock -d -p 10001 -s /dev/ttyUSB0 -b 9600
        ;;
      stop)
        echo "Stopping ser2sock"
        # kill application you want to stop
        killall ser2sock
        ;;
      *)
        echo "Usage: /etc/init.d/ser2sock {start|stop}"
        exit 1
        ;;
    esac
    
    exit 0
    Set the correct permissions

    Code:
    sudo chmod 755 /etc/init.d/ser2sock
    Configure it to automatically run at boot

    Code:
    sudo update-rc.d ser2sock defaults

    My status script for cgate was based on what is already listed here in the forums.Create it set the permissions and configure it to run at boot. I called mine cbus so the killall commands could target the cgate and java process


    I copied the project xml file off my windows box into the tag dir on the pi, modifed the Network line, I couldnt paste the exact code as this forum doesnt like it

    Code:
    Network  TagName  Network /TagName  Address 254 /Address  NetworkNumber 254 /NetworkNumber  Interface  InterfaceType cni /InterfaceType  InterfaceAddress 127.0.0.1:10001 /InterfaceAddress  /Interface 
    
    Set my project to start in C-GateConfig.txt

    Reboot, as mentioned in others posts it does take a while to sync up after the inital boot

    Both the Toolkit and the Diagnostic Utility need to point to the IP address of your PI
     
    cheekymonkey, Jun 20, 2013
    #15
  16. DarylMc

    malpasi

    Joined:
    Nov 10, 2004
    Messages:
    2
    Likes Received:
    0
    Location:
    Bristol, England
    Cgate on Raspberry Pi

    Attached are some notes to help getting cgate running on a Raspberry Pi. Big thanks to 'cheeky monkey' who provided the last bit of the puzzle.
     

    Attached Files:

    malpasi, Oct 21, 2013
    #16
  17. DarylMc

    daniel C-Busser Moderator

    Joined:
    Jul 26, 2004
    Messages:
    766
    Likes Received:
    20
    Location:
    Adelaide
    That's brilliant! Well done to you and everyone else involved!

    :D:D:D:D:D
     
    daniel, Oct 21, 2013
    #17
  18. DarylMc

    zei20t

    Joined:
    Aug 18, 2010
    Messages:
    130
    Likes Received:
    1
    Location:
    Sydney, Australia
    +1 on that

    big thanks for the info!
     
    zei20t, Oct 25, 2013
    #18
  19. DarylMc

    ashields

    Joined:
    Feb 2, 2011
    Messages:
    20
    Likes Received:
    1
    Location:
    Nottinghamshire,UK
    me too

    And another thumbs up from me on that, I spent hours trying to get the serial io working before I came across this thread.

    Just in case anybody is interested I'm using a C-Bus SIM module (taken from a Comfort UCM) connected directly to the pi's IO header. I thought I was probably going to have to purchase some MAX232's but the levels actually seem to match and it works with no other components in between.

    Disclaimer - Don't try this yourself, if you do and fry something don't blame me.;)
     
    ashields, Oct 27, 2013
    #19
  20. DarylMc

    Dils

    Joined:
    Nov 14, 2009
    Messages:
    11
    Likes Received:
    0
    Location:
    London
    Hi ashields

    Any pointer on how you set up the SIM.

    I have connected it directly to the pi,

    did you still use ser2sock, if so what settings did you have on startup of ser2sock.

    I know /dev/ttyUSB0 prob wont work, did you replace it with /dev/ttyS0
     
    Dils, Dec 6, 2013
    #20
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.