C-Bus with Raspberry PI 4 & openHAB

Discussion in 'C-Gate Developers' started by Dan, Jan 31, 2020.

  1. Dan

    Dan

    Joined:
    Jan 17, 2018
    Messages:
    19
    Likes Received:
    2
    Hello all,

    I have C-Gate running on my PI 4. I can access my CBUS network through the PI over my LAN using a remote C-Gate connection and toolkit on my Windows PC.

    After A LOT of pain I have openHAB installed on my PI along with the C-BUS Binding from (https://github.com/openhab/openhab-addons/pull/776) I am trying to interface the both together.

    I cannot get openHAB to connect to the CGate Connection. The C-Gate service is running on the PI when I'm trying to set up openHAB.

    Hoping someone can assist to get me going. When I enter the address of the PI (192.168.1.100) in the CGate Server IP field I get the error bellow. I have tried 192.168.1.100:10001, 192.168.1.100:20123 but all I get is;

    Status: UNINITIALIZED - HANDLER_INITIALIZING_ERROR Illegal status INITIALIZING. Bindings only may set UNKNOWN, ONLINE, OFFLINE or REMOVED.


    Thanks :)

    upload_2020-1-31_10-24-14.png
    upload_2020-1-31_10-24-46.png
     

    Attached Files:

    Dan, Jan 31, 2020
    #1
    1. Advertisements

  2. Dan

    Pie Boy

    Joined:
    Nov 21, 2012
    Messages:
    44
    Likes Received:
    6
    Location:
    New Zealand
    On open hab try to connect to cgate at the localhost ip address 127.0.0.1, I am assuming you have cgate and open hab installed on the pi together?
     
    Pie Boy, Jan 31, 2020
    #2
    1. Advertisements

  3. Dan

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    137
    Likes Received:
    14
    Location:
    Perth
    You will need to check that the cgate config file has the ipaddress of the openHAB device set to allowed, localhost 127.0.0.1 is usually automatic, but you may also need to set the LAN IPaddress of the Pi with openHAB on it depending how your router handles the traffic.
     
    chromus, Jan 31, 2020
    #3
  4. Dan

    Dan

    Joined:
    Jan 17, 2018
    Messages:
    19
    Likes Received:
    2
    Thanks for the reply guys,

    I put that in and rebooted the PI and re-launched C-Gate, no change.

    I also have the PI's IP in the access.txt file in the c-gate folder on the PI;

    ##C-Gate Server Access Control File
    ## This file was written automatically by a command issued to the server
    ## Created:Tue Oct 05 16:22:26 CST 2004
    ## File name: C:\clipsal\c-gate\config\access.txt
    interface 0:0:0:0:0:0:0:1 Program
    interface 127.0.0.1 Program
    interface localhost Program
    interface 192.168.1.100 Program
    remote 192.168.1.135 Program
    ## End of access control file
     

    Attached Files:

    Dan, Jan 31, 2020
    #4
  5. Dan

    Dan

    Joined:
    Jan 17, 2018
    Messages:
    19
    Likes Received:
    2
    I have made progress. The cbus addon for openHAB was an old verson (2.0.0)

    I found the latest version which is 2.2.0.

    I now have openHAB connected to my CGate. It has an option to add a network which I presume this is what you do next o_O, there are absolutly no instructions as far as I can find.

    I have added a network with paramaters of [C-Bus Network ID] of 254 and [C-Bus Project Name] of MYHOME.xml but I get a new error; Status: UNINITIALIZED - HANDLER_INITIALIZING_ERROR

    I have tried rebooting.

    Thoughts please? :D

    upload_2020-1-31_16-43-2.png upload_2020-1-31_16-43-19.png upload_2020-1-31_16-43-36.png
     
    Dan, Jan 31, 2020
    #5
  6. Dan

    Pie Boy

    Joined:
    Nov 21, 2012
    Messages:
    44
    Likes Received:
    6
    Location:
    New Zealand
    I would expect open hab is looking for the cgate .xml, do you have a toolkit project configured with all devices programming etc called MYHOME, also dose cgate have a way to connect to the c bus network? And Can you remote cgate into your raspi with toolkit and connect to the project MYHOME and scan in the network?
     
    Pie Boy, Jan 31, 2020
    #6
  7. Dan

    Dan

    Joined:
    Jan 17, 2018
    Messages:
    19
    Likes Received:
    2
    Thanks for your reply.

    It seems I missed one small step. I had to enter the project name in the C-GateConfig.txt file.

    Now once C-Gate opens it starts to scan the network. When I add the network to openHAB it says its online. I have been able to add some lights to control and dimming. Very cool!!! I plan to make a youtube video in how to set it up for noobs such as myself.

    I have one other issue thought may or may not be a problem. When I connect to the C-Gate on my PI from my desktop PC I get the bellow message in the terminal on my PI. The desktop is however able to scan and control the network through the PI.

    20200201-180148 803 cmd5 - Host:/192.168.1.135 opened command interface from port: 55126
    WARNING: An illegal reflective access operation has occurred
    WARNING: Illegal reflective access by org.exolab.castor.xml.BaseXercesOutputFormat (file:/usr/local/bin/C-Gate2/lib/castor-xml-1.4.1.jar) to method com.sun.org.apache.xml.internal.serialize.OutputFormat.setMethod(java.lang.String)
    WARNING: Please consider reporting this to the maintainers of org.exolab.castor.xml.BaseXercesOutputFormat
    WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
    WARNING: All illegal access operations will be denied in a future release


    upload_2020-2-1_19-31-30.png
     

    Attached Files:

    Last edited: Feb 1, 2020
    Dan, Feb 1, 2020
    #7
  8. Dan

    mminehan

    Joined:
    Oct 31, 2012
    Messages:
    27
    Likes Received:
    0
    Location:
    Auckland, New Zealand
    @Dan I am running a similar setup. Cgate and Cgateweb (cgate to MQTT) on a Pi. I use HomeSeer as opposed to openHAB. It all works well apart from Toolkit on a Windows PC talking to Cgate on the Pi. You can't backup the project file (.xml) via Toolkit on the PC which is a known issue. And I get the same 'illegal access' error in the cgate log on the Pi, as you describe above.

    I'm no expert but it looks like something to do with the way Cgate handles the XML (project) files which may explain why you can't use Toolkit to backup the project files. I have to manually make backups of my project files.

    Toolkit v1.15.6
    Cgate v2.11.5

    Feb 19 09:27:25 raspberrypi systemd[1]: Started cgate.
    Feb 19 09:27:25 raspberrypi java[4689]: Clipsal C-Gate(TM) v2.11.5 (build 3255)
    Feb 19 09:27:28 raspberrypi java[4689]: Logging to file: logs/event.txt
    Feb 19 09:27:28 raspberrypi java[4689]: 20200219-092728 800 cgate - C-Gate started.
    Feb 19 09:27:28 raspberrypi java[4689]: C-Gate is running.
    Feb 19 09:33:03 raspberrypi java[4689]: WARNING: An illegal reflective access operation has occurred
    Feb 19 09:33:03 raspberrypi java[4689]: WARNING: Illegal reflective access by org.exolab.castor.xml.BaseXercesOutputForm
    Feb 19 09:33:03 raspberrypi java[4689]: WARNING: Please consider reporting this to the maintainers of org.exolab.castor.
    Feb 19 09:33:03 raspberrypi java[4689]: WARNING: Use --illegal-access=warn to enable warnings of further illegal reflect
    Feb 19 09:33:03 raspberrypi java[4689]: WARNING: All illegal access operations will be denied in a future release
     
    mminehan, Feb 18, 2020 at 8:55 PM
    #8
    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.