C-Gate on Raspberry Pi - can't connect via Toolkit (SSL issue?)

Discussion in 'C-Bus Toolkit and C-Gate Software' started by jbaker, Jun 25, 2017.

  1. jbaker

    jbaker

    Joined:
    Jun 25, 2017
    Messages:
    7
    Likes Received:
    0
    Location:
    Adelaide
    Hi there,

    I've been trying to configure C-Gate on my Raspberry Pi... feels like I'm almost there but have hit an issue when trying to connect to the remote C-Gate from Toolkit.

    Following these instructions on the forums and the associated links, I've:

    - successfully installed Homebridge and Homebridge-CBus on the RPi. I was able to test that it works by pointing it to the existing C-Gate server on my Windows PC.

    - install C-Gate on the RPi and confirm that it is running correctly (telnet session from remote computer on port 20023)

    However, when I try to access the remote C-Gate server from Toolkit on port 20123, it tells me "An error has occurred while initialising Secure Socket Layer. Cannot connect to the C-Gate server."

    Checking the logs on the RPi in /usr/local/bin/cgate/logs, it says:

    20170625-105600 999 sys Selected client cipher: SSL_NULL_WITH_NULL_NULL
    20170625-105600 191 sys javax.net.ssl.SSLPeerUnverifiedException exception encountered : peer not authenticated

    Does anyone have any ideas on how to resolve this? I've tried self-signing a certificate on the RPi but couldn't work out how to install it.

    Thanks in advance.
     
    jbaker, Jun 25, 2017
    #1
    1. Advertisements

  2. jbaker

    znelbok

    Joined:
    Aug 3, 2004
    Messages:
    1,107
    Likes Received:
    9
    Did you enable access from the remote node?

    /usr/local/bin/cgate/config/access.txt needs to needs edited and have the following added

    remote XXX.XXX.XXX.XXX Program

    All in the instructions you pointed to. Without this you wont get anywhere as localhost is the only allowed default address.
     
    znelbok, Jun 25, 2017
    #2
    1. Advertisements

  3. jbaker

    jbaker

    Joined:
    Jun 25, 2017
    Messages:
    7
    Likes Received:
    0
    Location:
    Adelaide
    Thanks for the quick reply :)

    Yes, I've added the remote line to access.txt with the Toolkit computer's IP address. I can also successfully access C-Gate from that computer using Telnet and port 20023. It's only when I try to connect using Toolkit (connect to remote C-Gate server) that it fails with the SSL error (port 20123).
     
    jbaker, Jun 26, 2017
    #3
  4. jbaker

    daniel C-Busser Moderator

    Joined:
    Jul 26, 2004
    Messages:
    761
    Likes Received:
    14
    Location:
    Adelaide
    What versions of Toolkit and C-Gate, by the way?
     
    daniel, Jun 26, 2017
    #4
  5. jbaker

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,097
    Likes Received:
    15
    Location:
    Brisbane, QLD, Australia
    Hello jbaker
    Just asking because I don't understand.
    So you have Homebridge and CGate running on a raspberry pi.
    Why would you need to use the SSL port?
     
    DarylMc, Jun 26, 2017
    #5
  6. jbaker

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,097
    Likes Received:
    15
    Location:
    Brisbane, QLD, Australia
    I just checked my Toolkit and remote CGate does use port 20123.
    It's working fine for me.
    Must be something going on.
     
    DarylMc, Jun 26, 2017
    #6
  7. jbaker

    jbaker

    Joined:
    Jun 25, 2017
    Messages:
    7
    Likes Received:
    0
    Location:
    Adelaide
    Toolkit version is 1.14.8 and C-Gate (on the Raspberry Pi) is 2.11.1.

    Yes, it seems like Toolkit uses the secure port for config... based on the error messages, it seems like something specific to the C-Gate Raspberry Pi setup is causing issues.

    Could it be something to do with the version of Java being used on the Pi, or some other setting?
     
    jbaker, Jun 26, 2017
    #7
  8. jbaker

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,097
    Likes Received:
    15
    Location:
    Brisbane, QLD, Australia
    Any other instances of CGate possibly running on another pc?
     
    DarylMc, Jun 26, 2017
    #8
  9. jbaker

    jbaker

    Joined:
    Jun 25, 2017
    Messages:
    7
    Likes Received:
    0
    Location:
    Adelaide
    Java version on the Pi is Oracle Java 7, which came bundled with the Raspbian GNU/Linux 8 (jessie).
     
    jbaker, Jun 26, 2017
    #9
  10. jbaker

    jbaker

    Joined:
    Jun 25, 2017
    Messages:
    7
    Likes Received:
    0
    Location:
    Adelaide
    What about the C-Gate version running on the Toolkit PC? I've tried stopping the C-Gate service on the PC then trying to connect again to the Pi but it didn't seem to make a difference...
     
    jbaker, Jun 26, 2017
    #10
  11. jbaker

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,097
    Likes Received:
    15
    Location:
    Brisbane, QLD, Australia
    CGate 2.11.0 and 2.11.1 are meant to use Java 8
    Toolkit 1.14.8 is meant to use Java 7 and an earlier version of CGate.
     
    DarylMc, Jun 26, 2017
    #11
  12. jbaker

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,097
    Likes Received:
    15
    Location:
    Brisbane, QLD, Australia
    I haven't tried mixing them all around to see what happens.
     
    DarylMc, Jun 26, 2017
    #12
  13. jbaker

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,097
    Likes Received:
    15
    Location:
    Brisbane, QLD, Australia
    On another forum I was talking someone through using an image I made for pi3 cgate and homebridge.
    The image had cgate 2.11.0
    I had toolkit 1.15.1 on my pc and was getting an ssl error from toolkit
    Downgraded to the correct toolkit version 1.15.0 and was able to connect Toolkit to the remote CGate.
    I think everyone wants to pay careful attention to toolkit versions with remote cgate.
    Java versions for various CGate releases too.
     
    Last edited by a moderator: Jun 28, 2017
    DarylMc, Jun 27, 2017
    #13
  14. jbaker

    jbaker

    Joined:
    Jun 25, 2017
    Messages:
    7
    Likes Received:
    0
    Location:
    Adelaide
    Thanks, DarylMc - I'll try again with the correct versions of C-Gate, Toolkit and Java.
     
    jbaker, Jun 27, 2017
    #14
  15. jbaker

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,097
    Likes Received:
    15
    Location:
    Brisbane, QLD, Australia
    The reason I had to downgrade Toolkit was because the image was built with an earlier version of CGate and my PC had the latest Toolkit.
    I've tried the latest Toolkit 1.15.1 with CGate exe 2.11.1 on rapsberry pi3 and that all works nicely too.
     
    Last edited by a moderator: Jun 28, 2017
    DarylMc, Jun 27, 2017
    #15
  16. jbaker

    jbaker

    Joined:
    Jun 25, 2017
    Messages:
    7
    Likes Received:
    0
    Location:
    Adelaide
    As it turns out, I already had Java 8 installed on the Raspberry Pi.

    I upgraded my version of Toolkit, and what do you know... it works! After a few more issues with getting the right USB device assigned to ser2sock, everything is working well :)

    Thanks for your help.
     
    jbaker, Jun 28, 2017
    #16
  17. jbaker

    znelbok

    Joined:
    Aug 3, 2004
    Messages:
    1,107
    Likes Received:
    9
    I'm getting the same thing now as well. I can telnet in OK just toolkit is generating an error.

    C-Gate is verison 2.10.2 (build 3106) and toolkit is 1.15.1

    Do I need to upgrade C-gate or downgrade toolkit?

    Thanks
     
    znelbok, Aug 5, 2017
    #17
  18. jbaker

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,097
    Likes Received:
    15
    Location:
    Brisbane, QLD, Australia
    That toolkit version needs the latest cgate
     
    DarylMc, Aug 5, 2017
    #18
  19. jbaker

    Russiops

    Joined:
    Oct 26, 2017
    Messages:
    12
    Likes Received:
    0
    Location:
    Australia
    Hi, has anybody made a SD card image :) I would love to try this but is over my head.
     
    Russiops, Nov 15, 2017
    #19
  20. jbaker

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,097
    Likes Received:
    15
    Location:
    Brisbane, QLD, Australia
    I think it is good to learn how to do it yourself.
    iOS, Toolkit, CGate updates and all sorts of things can cause grief so you need some basic understanding to keep it running.
    I've sent images to people before and by the time you alter the files required it is not much harder to start from scratch.

    There is a video here showing the process to create the SD and link to a speadsheet with all the commands ready to copy and paste.
     
    DarylMc, Nov 16, 2017
    #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.