Toolkit and Remote C-Gate on Raspberry Pi

Discussion in 'C-Bus Toolkit and C-Gate Software' started by garethadams, Nov 15, 2017.

  1. garethadams

    garethadams

    Joined:
    Oct 25, 2015
    Messages:
    13
    Likes Received:
    0
    Location:
    Perth
    I am new to the forum and this is my first post, so please excuse this newbe. I need some help with troubleshooting a problem with Toolkit with remote C-Gate on a Raspberry Pi. I have followed the instruction posted by DarylMc.

    Everything works fine and I can see my Test network.
    Pic1.png
    [​IMG]

    I can connect to all units and upload the unit data expect for the eDLT. When I connect to it, the verify dialogue appears then the loading unit gets to 10% then the following errors, occur.
    Pic2.png [​IMG]
    Pic3.png
    [​IMG]

    I have checked the network and can upload the data if I connect if using a local C-Gate. I have also ensured that the C-Gate Server is not running on my laptop when using the Pi.
    Pic4.png
    Pic5.png
    [​IMG]
    [​IMG]
     
    Last edited: Nov 15, 2017
    garethadams, Nov 15, 2017
    #1
  2. garethadams

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Hi Gareth
    I have not used EDLT product.
    I believe Anthony Webb has an EDLT, Homebridge and CGate on pi3 but I don't know if he has used Toolkit to make any changes.
    Maybe some other forum members can recognize the response from the EDLT and give you some tips.

    If you followed my video Homebridge will be running as a service.
    I can use Toolkit while Homebridge is running no problem.
    But you could try stopping Homebridge service while using Toolkit and see if that helps.
    sudo systemctl stop homebridge


    Just to check, with Toolkit version 1.15.2 you need CGate 2.11.1 and Java v8 on the pi
     
    DarylMc, Nov 16, 2017
    #2
  3. garethadams

    daniel C-Busser Moderator

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

    Out of interest, what happens if you do the following workflow:

    * Transfer to Database (you can right-click it on the network and transfer just this one unit to database)
    * Edit the unit on the Database
    * Transfer the programming back to the Network (right-click on the unit in the database to see this option)
     
    daniel, Nov 16, 2017
    #3
  4. garethadams

    garethadams

    Joined:
    Oct 25, 2015
    Messages:
    13
    Likes Received:
    0
    Location:
    Perth
    Hi Daryl, thanks for the information. I have installed C-Gate and configured, up to line 73 of your spreadsheet guide. This was just to test the remote C-Gate. I haven't started Homebridge as a service yet.

    Using Toolkit 1.15.2 build 2433, C-Gate 2.11.1 build 3240 and java 8

    Hi Daniel, thanks also for the information. Did as per your workflow and something unexpected happened!

    picerror.jpg

    However, after Toolkit crashed and then restarted the eDLT was in the database. I was able to edit it and transfer to the network. It was quite slow over 3 minutes without any labels. Opening again from the database is ok, but if I try from the network at any time I get the above error.
     
    garethadams, Nov 16, 2017
    #4
  5. garethadams

    GlenF

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

    I have the same issue where I can only open the EDLT from the database and the saving to the network crashes in the same way quite often. I just keeping trying and it finishes the save probably 1 out of three time. At least by opening from the database and saving it is just a re-load. I do not think it is a PI issue as it has been this way for me before the PI.
     
    GlenF, Nov 17, 2017
    #5
  6. garethadams

    garethadams

    Joined:
    Oct 25, 2015
    Messages:
    13
    Likes Received:
    0
    Location:
    Perth
    garethadams, Nov 17, 2017
    #6
  7. garethadams

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    @daniel
    I wonder if CGate memory could be a problem?
    I just had a look at my pi3 cgate memory settings in the logs and I think it is set for 256 max.

    20171117-225413 300 sys dump cgate: JavaArguments=[-Djava.awt.headless=true, -Xverify:none]
    20171117-225413 300 sys dump cgate: LogFreeSpace=unknown
    20171117-225413 300 sys dump cgate: MemoryFree=10179880
    20171117-225413 300 sys dump cgate: MemoryMaximum=247332864
    20171117-225413 300 sys dump cgate: MemoryTotal=16252928
    20171117-225413 300 sys dump cgate: MemoryUsed=6073048

    Not that I have any problems on my small test network but I've been trying to figure out how to change the memory to 512.
    I added -Xms64M -Xmx512M to the params section of the startup script.
    This is the new response in the logs.
    20171117-224219 300 sys dump cgate: JavaArguments=[-Xms64M, -Xmx512M, -Djava.awt.headless=true, -Xverify:none]
    20171117-224219 300 sys dump cgate: LogFreeSpace=unknown
    20171117-224219 300 sys dump cgate: MemoryFree=48929128
    20171117-224219 300 sys dump cgate: MemoryMaximum=519045120
    20171117-224219 300 sys dump cgate: MemoryTotal=64880640
    20171117-224219 300 sys dump cgate: MemoryUsed=15951512

    Before I go telling everyone how to do it I wonder if you could verify that seems to be correct.
    Also some idea when it might likely be necessary to increase the memory from 256MB.
     
    DarylMc, Nov 17, 2017
    #7
  8. garethadams

    garethadams

    Joined:
    Oct 25, 2015
    Messages:
    13
    Likes Received:
    0
    Location:
    Perth
    Hi Daryl,

    I have tried the suggestion aim at Daniel. The results I had where the same as the original problem.

    This is the original event file.

    Code:
    20171118-183428 800 cgate - C-Gate started.
    20171118-183428 807 cgate - Logback logging active.  Destination='logs/event.txt'. Size=5000000 bytes. History=7 days. Asynchronous=yes.
    20171118-183428 899 sys Debug: New Command Context: cc001 = AccessContext Session console#2
    20171118-183428 300 sys dump cgate: ComputerName=null
    20171118-183428 300 sys dump cgate: DatabaseVersion=2.3
    20171118-183428 300 sys dump cgate: EventLevel=5
    20171118-183428 300 sys dump cgate: IPAddress=127.0.1.1
    20171118-183428 300 sys dump cgate: IsPrerelease=no
    20171118-183428 300 sys dump cgate: JavaArguments=[-Djava.awt.headless=true, -Xverify:none]
    20171118-183428 300 sys dump cgate: LogFreeSpace=unknown
    20171118-183428 300 sys dump cgate: MemoryFree=10145152
    20171118-183428 300 sys dump cgate: MemoryMaximum=239337472
    20171118-183428 300 sys dump cgate: MemoryTotal=16252928
    20171118-183428 300 sys dump cgate: MemoryUsed=6107776
    20171118-183428 300 sys dump cgate: ProjectFreeSpace=12597348 kBytes
    20171118-183428 300 sys dump cgate: ServerMode=no
    20171118-183428 300 sys dump cgate: State=new
    20171118-183428 300 sys dump cgate: Threads=16
    20171118-183428 300 sys dump cgate: Version=v2.11.1 (build 3240)
    After I modified the min/max memory.

    Code:
    20171118-190707 800 cgate - C-Gate started.
    20171118-190707 807 cgate - Logback logging active.  Destination='logs/event.txt'. Size=5000000 bytes. History=7 days. Asynchronous=yes.
    20171118-190707 899 sys Debug: New Command Context: cc001 = AccessContext Session console#2
    20171118-190707 300 sys dump cgate: ComputerName=null
    20171118-190707 300 sys dump cgate: DatabaseVersion=2.3
    20171118-190707 300 sys dump cgate: EventLevel=5
    20171118-190707 300 sys dump cgate: IPAddress=127.0.1.1
    20171118-190707 300 sys dump cgate: IsPrerelease=no
    20171118-190708 300 sys dump cgate: JavaArguments=[-Xms64M, -Xmx512M, -Djava.awt.headless=true, -Xverify:none]
    20171118-190708 300 sys dump cgate: LogFreeSpace=unknown
    20171118-190708 300 sys dump cgate: MemoryFree=48709856
    20171118-190708 300 sys dump cgate: MemoryMaximum=519045120
    20171118-190708 300 sys dump cgate: MemoryTotal=64880640
    20171118-190708 300 sys dump cgate: MemoryUsed=16170784
    20171118-190708 300 sys dump cgate: ProjectFreeSpace=12596912 kBytes
    20171118-190708 300 sys dump cgate: ServerMode=no
    20171118-190708 300 sys dump cgate: State=new
    20171118-190708 300 sys dump cgate: Threads=16
    20171118-190708 300 sys dump cgate: Version=v2.11.1 (build 3240)
    The status the the cgate service on the RPi.

    Code:
    ● cgate.service - LSB: Example initscript
       Loaded: loaded (/etc/init.d/cgate; generated; vendor preset: enabled)
       Active: active (running) since Sat 2017-11-18 19:04:46 AWST; 2min 18s ago
         Docs: man:systemd-sysv-generator(8)
      Process: 335 ExecStart=/etc/init.d/cgate start (code=exited, status=0/SUCCESS)
       CGroup: /system.slice/cgate.service
               └─342 /usr/bin/java -Xms64M -Xmx512M -Djava.awt.headless=true -jar -noverify /usr/local/bin/cgate/cgate.jar
    
    Nov 18 19:04:46 raspberrypi systemd[1]: Starting LSB: Example initscript...
    Nov 18 19:04:46 raspberrypi cgate[335]: Starting C-Gate server:.
    Nov 18 19:04:46 raspberrypi systemd[1]: Started LSB: Example initscript.
    Nov 18 19:04:48 raspberrypi cgate[335]: Clipsal C-Gate(TM) v2.11.1 (build 3240)
    The C-Gate Service starts without issue and I can connect remotely to it. When I open a unit on the network, other than the eDLT, the unit opens uplaods without issue. When I try the eDLT same issue.

    Error.jpg

    Just out of interest, I have tried turning off both the Windows10 firewall and my Trend antivirus, no change.
     
    garethadams, Nov 18, 2017
    #8
  9. garethadams

    garethadams

    Joined:
    Oct 25, 2015
    Messages:
    13
    Likes Received:
    0
    Location:
    Perth
    As another test I set up Toolbox and C-Gate on another PC. Changed the access.txt to allow remote connections, and tried again. Still the same error with the eDLT. Looks like this is a bug with Toolkit 1.15.2 build 2433, C-Gate 2.11.1 build 3243. I did notice the C-Gate installed with Toolbox was build 3243 whilst the standalone version is build 3240.

    Perhaps I need to talk to CIS Technical Support on Monday and report the problem
     
    garethadams, Nov 18, 2017
    #9
  10. garethadams

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Thanks Gareth
    It was just a wild guess memory could have been a problem and the error report will be more useful for the people who actually know what they are talking about.
    I can verify the CGate installed with Toolkit is a different build version to the CGate zip download.
    Whether that makes any difference I don't know.

    If your goal is to set up the pi for Homebridge I wouldn't worry too much about the error right now.
    When or if you need to reconfigure the EDLT I think it should just be a matter of using local CGate to do that then replace the project xml on the pi.

    I have set my pi3 to 512max cgate memory right now and will run it for a while to see if it causes any other problems
    The whole thing has been running pretty nice for me.
     
    Last edited: Nov 19, 2017
    DarylMc, Nov 19, 2017
    #10
  11. garethadams

    garethadams

    Joined:
    Oct 25, 2015
    Messages:
    13
    Likes Received:
    0
    Location:
    Perth
    Thanks,

    The rest also seems to be working fine for me also. Nice work with the tutorial btw, really easy to follow.

    I have also used a couple of status commands to see what's going on in the RPi.

    sudo service cgate status
    sudo service homebridge status
     
    garethadams, Nov 19, 2017
    #11
  12. garethadams

    garethadams

    Joined:
    Oct 25, 2015
    Messages:
    13
    Likes Received:
    0
    Location:
    Perth
    A quick update, today I spoke with CIS Technical Support. They thought it was a problem with Toolkit and the .Net Framework. So I installed the latest version, no change.

    Then I tried uninstalling the complete ToolKit and CGate application. Installed again, no change.....

    Still working on the problem.
     
    garethadams, Nov 20, 2017
    #12
  13. garethadams

    daniel C-Busser Moderator

    Joined:
    Jul 26, 2004
    Messages:
    766
    Likes Received:
    20
    Location:
    Adelaide
    @DarylMc @garethadams
    I do want to mention that C-Gate memory is unlikely to ever be the issue for a residential installation - the only time I've seen the memory needing to be increased is for large commercial sites with 20MB+ projects. In your logs the MemoryUsed amount is only about 15-16MB. You do need to be careful increasing the MemoryMaximum on a Raspberry Pi because it can affect the memory available to the other apps on the Pi.

    C-Gate's memory doesn't play a big part in transferring data to/from the units - local connections generally work well. It's the remote hop between TK and C-Gate, or across bridges, where problems can occur.

    Could you finish the commissioning with TK and C-Gate on a PC, and then transfer the project to the Pi for operational purposes?
     
    Last edited: Nov 23, 2017
    daniel, Nov 20, 2017
    #13
  14. garethadams

    garethadams

    Joined:
    Oct 25, 2015
    Messages:
    13
    Likes Received:
    0
    Location:
    Perth
    Hi Daniel, thanks for your help. Yes I a could commission on a local PC and then transfer to the PI, amking changes would be a little tideous.

    However, as a test I have set up 1 laptop with a local c-gate, works fine. On a second laptop I tried to remote in to the first c-gate, connects ok but I can not upload the eDLT. So on the second laptop I then created a local c-gate, that works fine also, so proves the laptops. I have turned off all firewalls and anti-virus, always connects to the remote c-gate, upload all units expects the eDLT ok.
     
    garethadams, Nov 21, 2017
    #14
  15. garethadams

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    @daniel
    Thanks for the explanation.
     
    DarylMc, Nov 21, 2017
    #15
  16. garethadams

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    @garethadams
    If you set up samba on the raspberry pi and share the CGate folder.
    Then you can just copy the project xml from Windows C:\Clipsal\C-Gate2\tag.
    Then replace the project xml in \\RASPBERRYPI\CGate\tag.
    Reboot.

    I've got an example modified samba.config in the text files I uploaded.
    Between that and Google you should have no trouble setting it up.
    With access to the CGate folder on the pi you can also easily access CGate logs from the PC.
     
    DarylMc, Nov 25, 2017
    #16
  17. garethadams

    znelbok

    Joined:
    Aug 3, 2004
    Messages:
    1,151
    Likes Received:
    17
    WinSCP is an alternative to SAMBA, Nothing to setup, just a utility on your PC. Although, if a permanent install setting up Samba may be worth the while.
     
    znelbok, Nov 26, 2017
    #17
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.