C-Gate on Raspberry Pi and Toolkit on Win7

Discussion in 'C-Gate Developers' started by zei20t, Sep 14, 2013.

  1. zei20t

    zei20t

    Joined:
    Aug 18, 2010
    Messages:
    80
    Likes Received:
    0
    Location:
    Sydney, Australia
    OK,

    so got my Pi up and running, installed the JRE and got C-Gate connecting to my CNI successfully.

    Only problem, cant get my Windows 7 machine to connect to the remote C-Gate.

    I've edited access.txt and added the IP of the Windows machine. still not working.

    I can telnet from the windows machine to port 20025 to get cbus network traffic.

    I can also telnet to port 20123 but it times out after about 15 seconds.

    In the C-Gate window on the Pi, I get:

    20130915-005536 803 cmd7 - Host:/192.168.0.107 opened command interface from port: 50935
    20130915-005536 804 cmd7 - Host:/192.168.0.107 closed command interface from port: 50935

    And an error on the Windows machine:

    Cannot connect to C-Gate server.

    Any ideas for me please? I've tried searching on the forum but to no avail.
     
    zei20t, Sep 14, 2013
    #1
    1. Advertisements

  2. zei20t

    broadk

    Joined:
    May 3, 2010
    Messages:
    8
    Likes Received:
    0
    Location:
    London
    broadk, Sep 14, 2013
    #2
    1. Advertisements

  3. zei20t

    zei20t

    Joined:
    Aug 18, 2010
    Messages:
    80
    Likes Received:
    0
    Location:
    Sydney, Australia
    thanks for the links!

    ive installed the Oracle JDK version 1.8.0-ea and still no luck. same on all counts.

    might spin up a full version of debian and see if I can get it working.

    first I might install a new version of toolkit on another machine, might be my laptop playing up

    thanks again!
     
    zei20t, Sep 15, 2013
    #3
  4. zei20t

    zei20t

    Joined:
    Aug 18, 2010
    Messages:
    80
    Likes Received:
    0
    Location:
    Sydney, Australia
    OK not sure what ive done. But, its working!

    Long story short, I have the CNI on the Ethernet side of the Pi (directly), and the WiFi adaptor connected to my house's network.

    This way I have the Pi in the cabinet with the cbus stuff and no Ethernet connected to it.

    I have this funny feeling that you cant name the remote c-gate setup the same as your project.

    I changed it and restarted the Pi at the same time, so im not sure whats fixed it.

    Ill report back when I have more info.

    thanks again for the assistance!
     
    zei20t, Sep 15, 2013
    #4
  5. zei20t

    zei20t

    Joined:
    Aug 18, 2010
    Messages:
    80
    Likes Received:
    0
    Location:
    Sydney, Australia
    hmm rebooted everything, still all working.

    changed the remote cgate site name back to what it was before, and its still working.

    so I have no idea. which is bad because id rather know.

    that said; its working :)
     
    zei20t, Sep 15, 2013
    #5
  6. zei20t

    nickrusanov

    Joined:
    Aug 5, 2004
    Messages:
    308
    Likes Received:
    0
    Location:
    russia
    guys, maybe one of you could make an image of SD card with working C-Gate package for Raspberry Pi, so everyone could use it?

    this would make life more simple for some people

    thank you
     
    Last edited by a moderator: Sep 18, 2013
    nickrusanov, Sep 18, 2013
    #6
  7. zei20t

    zei20t

    Joined:
    Aug 18, 2010
    Messages:
    80
    Likes Received:
    0
    Location:
    Sydney, Australia
    I don't mind doing that.

    but after a few reboots, im getting the connection error again in the first post :(
     
    zei20t, Sep 18, 2013
    #7
  8. zei20t

    znelbok

    Joined:
    Aug 3, 2004
    Messages:
    1,093
    Likes Received:
    5
    Did this ever get done and if so is there a link to it?

    Mick
     
    znelbok, Nov 10, 2014
    #8
  9. zei20t

    daniel C-Busser Moderator

    Joined:
    Jul 26, 2004
    Messages:
    760
    Likes Received:
    13
    Location:
    Adelaide
    Afraid I don't have an image, but some tips:

    - The last couple of C-Gate releases are also available as zips (saves a few minutes as you don't have to yank files from a Windows machine).

    - If you are using a CNI life is much easier. If you are using a PCI things can get a little annoying. The above-mentioned zips do include serial drivers for Mac and Linux x86, so Debian on a PC should work. Unfortunately there is no driver included for Linux ARM, so on a Pi you have a few options.

    1) You can do some clever tunneling from USB-to-IP, as per the solution outlined in this thread and confirmed by a couple of users: http://www.cbusforums.com/forums/showthread.php?t=8373

    2) You can configure C-Gate to revert to the old javax.comm driver (built into Java) which I believe should work on Linux ARM but haven't tried: http://www.cbusforums.com/forums/showpost.php?p=47354&postcount=22
     
    Last edited by a moderator: Nov 12, 2014
    daniel, Nov 12, 2014
    #9
  10. zei20t

    poldim

    Joined:
    Dec 7, 2010
    Messages:
    160
    Likes Received:
    0
    Location:
    San Francisco, CA

    Bringing this back.


    How did you get your C-Gate on your Rpi to connect to your CNI?
    I've got it up and running but cannot get it to execute "noop" or any kind of external connection to cgate (via telnet & toolkit):
    Code:
    pi@raspberrypi:~ $ sudo service cgate status
    ● cgate.service - LSB: Example initscript
       Loaded: loaded (/etc/init.d/cgate)
       Active: [B]active (running)[/B] since Sun 2016-02-14 01:24:47 UTC; 23s ago
      Process: 463 ExecStart=/etc/init.d/cgate start (code=exited, status=0/SUCCESS)
       CGroup: /system.slice/cgate.service
               └─467 /usr/bin/java -Djava.awt.headless=true -jar -noverify /usr/local/bin/cgate/cgate.jar
    
    Feb 14 01:24:46 raspberrypi cgate[463]: Starting C-Gate server:.
    Feb 14 01:24:47 raspberrypi systemd[1]: Started LSB: Example initscript.
    Feb 14 01:24:50 raspberrypi cgate[463]: Clipsal C-Gate(TM) v2.10.6 (build 3145)
    pi@raspberrypi:~ $ noop
    -bash: noop: command not found
    pi@raspberrypi:~ $ cgate
    -bash: cgate: command not found

    Code:
    $ ping 192.168.1.65
    PING 192.168.1.65 (192.168.1.65): 56 data bytes
    64 bytes from 192.168.1.65: icmp_seq=0 ttl=64 time=0.554 ms
    64 bytes from 192.168.1.65: icmp_seq=1 ttl=64 time=0.541 ms
    64 bytes from 192.168.1.65: icmp_seq=2 ttl=64 time=0.650 ms
    64 bytes from 192.168.1.65: icmp_seq=3 ttl=64 time=0.785 ms
    ^C
    --- 192.168.1.65 ping statistics ---
    4 packets transmitted, 4 packets received, 0.0% packet loss
    round-trip min/avg/max/stddev = 0.541/0.633/0.785/0.098 ms
    $ telnet 192.168.1.65 20023
    Trying 192.168.1.65...
    telnet: connect to address 192.168.1.65: Connection refused
    telnet: Unable to connect to remote host
    $ telnet 192.168.1.65 20026
    Trying 192.168.1.65...
    telnet: connect to address 192.168.1.65: Connection refused
    telnet: Unable to connect to remote host
    (Noop reference from here: http://www.cbusforums.com/forums/showpost.php?p=47891&postcount=16)

    I wrote down my steps to help out other linux newbies like myself:
    https://docs.google.com/document/d/1KE23CvJ0L3C6Iul8kFBycHcgriCm7AQ-DPRz_eRdblg/edit?usp=sharing
     
    poldim, Feb 14, 2016
    #10
  11. zei20t

    poldim

    Joined:
    Dec 7, 2010
    Messages:
    160
    Likes Received:
    0
    Location:
    San Francisco, CA
    I guess I'm a bit confused. When I boot up the Rpi it's set to launch cgate via the startup script. If I check service status (sudo service cgate status) immediately after boot, it returns Active: active (running) but I cannot connect from Toolkit (Error - 2080, An error has occurred, Cannot connect to C-Gate server). It turns out, if I then send another start command to init.d (/etc/init.d/cgate start), the active status does not change but it logs that c-gate has started and is running. At this point I can connect to Remote C-Gate via Toolkit and open my network to my Wiser CNI.

    Code:
    ##initial sudo service cgate status
    Feb 14 21:51:55 raspberrypi cgate[464]: Starting C-Gate server:.
    Feb 14 21:51:56 raspberrypi systemd[1]: Started LSB: cgate init-script in /etc/init.d.
    Feb 14 21:51:59 raspberrypi cgate[464]: Clipsal C-Gate(TM) v2.10.6 (build 3145)
    
    ##after sending /etc/init.d/cgate start
    Feb 14 21:53:13 raspberrypi cgate[464]: Logging to file: logs/event.txt
    Feb 14 21:53:13 raspberrypi cgate[464]: 20160214-215313 800 cgate - C-Gate started.
    Feb 14 21:53:13 raspberrypi cgate[464]: C-Gate is running.
    FINALLY
    In a new terminal window, I type telnet 192.168.1.65 20023 and viola:
    Code:
    201 Service ready: Clipsal C-Gate Version: v2.10.6 (build 3145) #cmd-syntax=1.0
    noop
    200 OK.
     
    Last edited by a moderator: Feb 14, 2016
    poldim, Feb 14, 2016
    #11
  12. zei20t

    zx9

    Joined:
    Jun 8, 2009
    Messages:
    49
    Likes Received:
    0
    Location:
    Melbourne
    have you checked the running processes to confirm that its running?

    also it's possibly that it's still starting up - do you get the same response if you wait longer?

    on startup of my nodejs app I have retry/sleep logic as it takes a while to connect to c-gate on bootup - also make sure you have your init.d dependencies set correctly.
     
    zx9, Feb 16, 2016
    #12
  13. zei20t

    Rakesh91

    Joined:
    Dec 16, 2016
    Messages:
    8
    Likes Received:
    0
    Location:
    pune india
    Hi I am trying to install cgate on my pi.
    My pi is running Raspbian Jessie.
    I have followed all the steps required.
    But when I connect to cgate from putty from windows machine at 20023 the error occurs
    Fatal error network connection refused.
    When check the cgate status
    systemctl status cgate
    It shows active(exited)
     
    Rakesh91, Apr 5, 2018
    #13
  14. zei20t

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,053
    Likes Received:
    4
    Location:
    Brisbane, QLD, Australia
    Have you added the line to allow remote access to CGate in access.txt file?
     
    DarylMc, Apr 5, 2018
    #14
  15. zei20t

    Rakesh91

    Joined:
    Dec 16, 2016
    Messages:
    8
    Likes Received:
    0
    Location:
    pune india
    yes i have added line

    remote 192.168.0.114 Program

    192.168.0.114 is ip address of my windows pc
     
    Rakesh91, Apr 5, 2018
    #15
  16. zei20t

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,053
    Likes Received:
    4
    Location:
    Brisbane, QLD, Australia
    Check CGate logs on the pi for some clues.
    One thing to remember is Java versions must suit the CGate version you are using.
    For latest CGate it is Java v8
    Is it Jessie lite?
    I suspect the full Jessie version might already have Java installed and that might cause you some problems.
     
    DarylMc, Apr 5, 2018
    #16
  17. zei20t

    Rakesh91

    Joined:
    Dec 16, 2016
    Messages:
    8
    Likes Received:
    0
    Location:
    pune india
    pls check the images below:
     

    Attached Files:

    Rakesh91, Apr 5, 2018
    #17
  18. zei20t

    Rakesh91

    Joined:
    Dec 16, 2016
    Messages:
    8
    Likes Received:
    0
    Location:
    pune india
    i have Jessie running on my pi.
    Not Jessie lite.
    should i be running Jessie lite on my pi?
     
    Rakesh91, Apr 5, 2018
    #18
  19. zei20t

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,053
    Likes Received:
    4
    Location:
    Brisbane, QLD, Australia
    You should find full logs here
    /usr/local/bin/cgate/logs
     
    DarylMc, Apr 5, 2018
    #19
  20. zei20t

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,053
    Likes Received:
    4
    Location:
    Brisbane, QLD, Australia
    Google and check if Jessie already has Java installed and if so what version.
    That might cause some difficulties.
    I always use Jessie light since I have no need for the GUI.
     
    DarylMc, Apr 5, 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.