Homebridge with C-Bus Plug in on Raspberry Pi 3

Discussion in 'Voice Control' started by Rob Cassidy, Mar 4, 2018.

  1. Rob Cassidy

    Rob Cassidy

    Joined:
    Mar 4, 2018
    Messages:
    9
    Likes Received:
    0
    Location:
    Buderim
    Good Evening,

    This post is mostly directed to Daryl Mcdougall (awesome video & spreadsheet mate!) but help would be appreciated from anyone that may be of assistance.

    I watched Daryl's video on this procedure & worked my way through the spreadsheet following every detail...got to the end & everything seemed to work as intended until I tried to open - nano /home/pi/my-platform.json

    Just a blank screen...so I checked the live log of the homebridge service - sudo journalctl -u homebridge.service -f

    See attached notepad file of the log. Can someone please advise what might be the problem here?

    Also attached is my config.json if you could advise if this looks ok? I converted it to a text file to allow upload.

    This is all very new to me so apologies if any of this seems silly.

    Best Regards,

    Rob Cassidy
     

    Attached Files:

    Rob Cassidy, Mar 4, 2018
    #1
  2. Rob Cassidy

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    @Rob Cassidy
    I want to mention and thank all the people who did all the work to make CGate and Homebridge work.
    I just provided the links.
    For my own use I made the spreadsheet so I could easily repeat it and manage changes.
    The video I made because even with all the links when you are new to Linux it can seem hard to do the simplest things.

    For you one problem stands out right away.
    In the config.json “client_ip_address” should be 127.0.0.1 because CGate is running on the raspberry pi.
    Google “local host IP address” and you will know why you are not just using the pi IP address better than I do.
    If you wanted to run CGate on say a Windows PC you would use the IP address of that machine.


    One other thing you can notice from the journal is that homebridge tried to open a connection to CGate, could not connect and then closed.

    With a bit of luck that might be the only thing you need to fix.
    It is important to use Raspian Jessie Lite not Raspian Stretch if you follow those instructions as I am quite sure you will have problems using init.d to start CGate service on Raspian Stretch.
     
    Last edited: Mar 5, 2018
    DarylMc, Mar 5, 2018
    #2
    Rob Cassidy likes this.
  3. Rob Cassidy

    Rob Cassidy

    Joined:
    Mar 4, 2018
    Messages:
    9
    Likes Received:
    0
    Location:
    Buderim
    @DarylMc
    Thanks Daryl.
    That was the only thing I needed to fix. I now understand localhost.
    Homebridge has been working now for around 12 hours with no issue, I can remote access from my phone & apple watch using Siri with no problems.
    Time to set up at my parents place now. They have cbus installed throughout the house.
    Thanks for steering me in the right direction!
    Let the fun begin!
     
    Rob Cassidy, Mar 6, 2018
    #3
  4. Rob Cassidy

    Rob Cassidy

    Joined:
    Mar 4, 2018
    Messages:
    9
    Likes Received:
    0
    Location:
    Buderim
    @DarylMc
    Homebridge has been solid but CGate has been unstable. Last night I could not get Homekit to work with Cbus.
    When I checked CGate it was showing up as being in error.
    I rebooted the pi, I restarted CGate, Homebridge but nothing worked.
    Yet this morning all was working ok again.
    Any ideas on what might be going on to cause this instability?
     
    Rob Cassidy, Mar 8, 2018
    #4
  5. Rob Cassidy

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    If you followed the same setup as me CGate and Homebridge will start as services at boot and no need to manually start them.
    I’ve not had any problem with CGate on the PI except for matching the right version with Toolkit.
    Oracle Java is the only Java I’ve tried and if you followed the instructions you should have that too.
    Java and CGate versions need to be match too if you have done anything different.

    Use the CGate logs on the PI to see if you can narrow it down.
    You can also check the journal to see what Homebridge thinks CGate is doing.

    What CBus interface are you using?
    I use an RS232 CBus interface with serial device server.
    I’m starting to wonder if Homebridge is bringing attention to problems with failing older CNI devices.
    The CGate logs can probably help.

    On my setup once it is all booted and services running, CGate recovers well from anything I do to try break it.
     
    DarylMc, Mar 9, 2018
    #5
  6. Rob Cassidy

    Rob Cassidy

    Joined:
    Mar 4, 2018
    Messages:
    9
    Likes Received:
    0
    Location:
    Buderim
    I'm using a brand new CNI2 for my interface so would not expect any issues there.
    I followed your spreadsheet so that should be ok. I did shut down the pi (pulled the plug) a couple of times throughout the setup process without sudo halt. Would that have caused any issues do you think?
    I'll have a closer look tonight & see what the CGate logs are saying.
     
    Rob Cassidy, Mar 9, 2018
    #6
  7. Rob Cassidy

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Not sure what incorrect shutdowns might do for you.
    I’ve lost power a number of times without any problems but UPS and correct shutdown is probably a good idea.
    Check the CGate logs and see what you can find.
     
    DarylMc, Mar 10, 2018
    #7
  8. Rob Cassidy

    Rob Cassidy

    Joined:
    Mar 4, 2018
    Messages:
    9
    Likes Received:
    0
    Location:
    Buderim
    @DarylMc
    See attached a log of Cgate this afternoon. I cannot connect properly with Toolkit on my PC, so no wonder CGate on the pi won't work. The Cbus units start loading then drop offline halfway through loading.
    What does a struck transmitter mean? I turned off firewall as well to eliminate that.
    Would my router be blocking communications to the CNI?
    Could the brand new CNI V2 be faulty?
     

    Attached Files:

    Rob Cassidy, Mar 10, 2018
    #8
  9. Rob Cassidy

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Someone else can probably add some info but I’d try power cycling the CNI and maybe check something else is not trying to use it eg CGate on the PC
     
    DarylMc, Mar 10, 2018
    #9
  10. Rob Cassidy

    Rob Cassidy

    Joined:
    Mar 4, 2018
    Messages:
    9
    Likes Received:
    0
    Location:
    Buderim
    I've power cycled the CNI many times.
    To get back to the very basics I shut down the pi & just tried to connect to the CNI with toolkit using CGate on the PC only. The resulting log as per above.
    It is the most minimal bare bones Cbus network that you could have.
    Just the CNI, 8 channel dimmer & 2 gang saturn switch. Channel 1 of the dimmer connected to a 12v Downlight. So only one group address.
    The Cbus network itself works fine. ie. The switch dims the light up & down & on & off.
    Homebridge controlled the Cbus perfectly for nearly two days..then it stopped working??
    So what changed? The system was sitting idle for the majority of the time.
    The problem seems to be narrowed down to communications to the CNI.
    Is it the CNI? Is there something blocking the communications? Router? Other than windows firewall which I turned off.
    Anyone with any suggestions on where to from here would be much appreciated.
     
    Rob Cassidy, Mar 10, 2018
    #10
  11. Rob Cassidy

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Just to be sure I’d power cycle the CBus power to the CNI too eg turn the main switch off for a bit.
    After shutting down the pi of course :)

    Hopefully your CNI has a static or an assigned fixed IP address.
    You could also search the forum for stuck transmitter.
     
    DarylMc, Mar 10, 2018
    #11
  12. Rob Cassidy

    Rob Cassidy

    Joined:
    Mar 4, 2018
    Messages:
    9
    Likes Received:
    0
    Location:
    Buderim
    Thanks for your assistance Daryl.
    I tried power cycling the Cbus as well, but still no luck!
    The CNI does have a fixed IP address which you have to set up using the control systems IP utility that downloads with toolkit.
    I think I will give the CIS tech support a call tomorrow to get their advise on connection to the CNI.
    I have been wondering whether I could connect the CNI directly to the pi's ethernet port & use the wifi on the pi to connect it to the network. Not sure how this would need to be set up though?
    Your thoughts on this?
     
    Rob Cassidy, Mar 11, 2018
    #12
  13. Rob Cassidy

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    I would not do that.
    In Toolkit
    Edit network and check CNI IP address is actually same as CNI current IP address
    This is recorded in project XML and also where the pi will be looking for the CNI
    Not sure how familiar you are with Toolkit.
    Did you notice in Toolkit the disconnect and select local or remote CGate?

    Is CGate on PC running in a window or as a service?
    I recommend running CGate instance in its own window for ease of use.
    Only one connection at a time can be made to CNI and you want to be sure CGate on the PC is shut down or disconnected while using CGate on the pi.
    If you need to change it is done during Toolkit install.
    Just redo Toolkit install if you need to change that.
    Also shut down pi or CGate on the pi when using Toolkit and local CGate.
     
    Last edited: Mar 11, 2018
    DarylMc, Mar 11, 2018
    #13
  14. Rob Cassidy

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Added more info to previous post
     
    DarylMc, Mar 11, 2018
    #14
  15. Rob Cassidy

    Rob Cassidy

    Joined:
    Mar 4, 2018
    Messages:
    9
    Likes Received:
    0
    Location:
    Buderim
    Thanks for all of your help trying to sort this Daryl.

    Just thought I would let you know that it is a faulty CNI.

    I had a teamviewer session this afternoon with a CIS tech to varify it.
     
    Rob Cassidy, Mar 13, 2018
    #15
  16. Rob Cassidy

    Rob Cassidy

    Joined:
    Mar 4, 2018
    Messages:
    9
    Likes Received:
    0
    Location:
    Buderim
    The symptoms were as follows. After a long shutdown (overnight) powered up the cbus, the CNI comes to life, lots of green activity lights on both the Ethernet & Cbus network. Open up toolkit, open up the network, cbus units load, you could open up each unit check settings, make changes update units etc as you normally would be able to do.

    Then after approx 5min the connectivity starts to fail, the units start to load then lose connection. This progressively gets worse until you cannot even see any of the cbus units on the network any longer.

    Checked the power supply for the Ethernet side of the CNI, 9V DC present, polarity correct.

    Therefore came to the conclusion that it had to be the CNI itself that was faulty.
     
    Rob Cassidy, Mar 13, 2018
    #16
  17. Rob Cassidy

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    DarylMc, Mar 15, 2018
    #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.