Cbus homebridge setup with rs232-ethernet interface

Discussion in 'Voice Control' started by shindig, Apr 13, 2020.

  1. shindig

    shindig

    Joined:
    Sep 6, 2019
    Messages:
    8
    Likes Received:
    1
    Hi everyone

    I wanted to get your input regarding my cbus system and getting it setup to run homebridge

    I moved into the house a little while ago and now have a bit of time to tinker with it to see how I can get the cbus network connected to the homebridge


    In my home network already, I have the homebridge running on docker on a synology nas perfectly and I want to add to the cbus network to it.


    I have read through the extensively detailed threat about how to get cbus network connected to network using rpi but my network module on the cbus on has a serial connection (5500pc)


    I have purchase a USR-IOT serial to Ethernet convertor (USR-TCP232-302) to connect “convert” the serial port to a network port and this is where I am having issues


    The IOT device has a IP address 192.168.1.229, I have it setup as a TCP server in the serial port config settings and on my windows pc (ip address 192.168.1.254) , I have downloaded the USR-VCOM software to emulate a com port to COM1 as tcp client . When I do this and then load cbus utility and try to scan COM1 port, the cbus toolkit software crashed given an error as per the image below

    When the USR-VCOM software is not running, the cbus toolkit software is able to scan for ports without any issues but obviously doesn’t find any cbus network.

    I have tried to set up the USRVCOM software COM1 virtual port as a tcp client/ tcp server/ udp but the same error pops up. I have disabled firewall and still same issue

    I hope I am making senses to someone out there and you can assist me

    Thanks in advance

    Ca11pture.PNG Captu2re.PNG Captur21e.PNG
     
    shindig, Apr 13, 2020
    #1
  2. shindig

    shindig

    Joined:
    Sep 6, 2019
    Messages:
    8
    Likes Received:
    1
    i have also attached the logs from the from C:\Clipsal\C-Gate2\logs to this post
     

    Attached Files:

    shindig, Apr 13, 2020
    #2
  3. shindig

    jboer

    Joined:
    Apr 27, 2012
    Messages:
    458
    Likes Received:
    35
    Location:
    Sydney
    Hi Shindig, I wouldnt try and use the virtual com app and just tell Toolkit to telnet directly into the unit. At my house I have my 'config' PC Serial Interface onto the network using a Neteon Serial Server and it works well.

    In toolkit under your network edit change the interface type to 'CNI' and put in the serial server address and port. That should work as you are expecting. Homebridge should also be able to do the same. (As long as your PC and Homebridge arnt trying to connect at the same time!)

    upload_2020-4-13_18-45-39.png
     
    jboer, Apr 13, 2020
    #3
    shindig likes this.
  4. shindig

    shindig

    Joined:
    Sep 6, 2019
    Messages:
    8
    Likes Received:
    1
    Hey thanks for your quick response jboer. I have just tried to directly connect to the serial server address by changing to the CNI and putting in its ip address and the assigned port number and still no luck. When i have the serial device set as tcp server, the error comes up that it cannot find it. When I change the settings on it to tcp client, the cbus utility does the search but says "0 units found". I looks at the cgate log and it has this listed in it as below

    20200413-205540 742 //TOPOLOGY1/NET0 - Network created type=CNI address=192.168.1.229:7108
    20200413-205542 911 //TOPOLOGY1/NET0 - Can't open: C-Bus interface (port failure (Connection refused: connect)):192.168.1.229:7108


    I am not sure how else i can give access to the cbus utility to communicate with the serial device. maybe i need to somehow give it the admin user/ password to allow the cbus utlity to be able to communicate with it

    In terms of telnet into the serial device, i am unsure how to do this as i have never done it before. I have briefly looked at the cgate manual and has telnet up and running but i am not sure what command i need to give to allow cgate the access to the serial server ip address

    Captu22re.PNG Capture11.PNG Captur1e.PNG
     
    shindig, Apr 13, 2020
    #4
  5. shindig

    jboer

    Joined:
    Apr 27, 2012
    Messages:
    458
    Likes Received:
    35
    Location:
    Sydney
    If you run telnet from your (Windows cmd prompt, not cgate) cmd window so : telnet 192.168.1.229 7108

    Does it connect and you get a blank screen/get some C-bus commands coming through? Or do you get a connection refused?

    Just make sure you have closed all your virtual com software and services that might be still holding the connection.
     
    jboer, Apr 13, 2020
    #5
  6. shindig

    shindig

    Joined:
    Sep 6, 2019
    Messages:
    8
    Likes Received:
    1
    yes it does connect when I run telnet 192.168.1.229 7108 if the usr-iot device is set to tcp server. If it is set to tcp client, then I get a connection failed. Once the connection is established, I only get a blank screen and i am not able to type anything as far as i can tell
     
    shindig, Apr 13, 2020
    #6
  7. shindig

    jboer

    Joined:
    Apr 27, 2012
    Messages:
    458
    Likes Received:
    35
    Location:
    Sydney
    That is good, it should work then.

    If you press one of the C-Bus buttons in your house do you get anything?

    Im wondering if your cable between the Serial Server and the PC interface isnt correct.
     
    jboer, Apr 13, 2020
    #7
  8. shindig

    shindig

    Joined:
    Sep 6, 2019
    Messages:
    8
    Likes Received:
    1
    no change on the telnet page when I turn any lights on or off.

    I have just been using a basic serial to serial cable that i found laying around the house. There has been mention about using ftdi chipset rs232 to usb cables in the forums, I was wondering do I need to consider a some newer specific rs232 to rs232 cable as well with certain criteria?
     
    shindig, Apr 13, 2020
    #8
  9. shindig

    jboer

    Joined:
    Apr 27, 2012
    Messages:
    458
    Likes Received:
    35
    Location:
    Sydney
    It may depend on the chipset within the Serial Server and what it uses. However I would still expect to see something when you press your C-Bus buttons, even the non-FTDI adaptors give a connection, its just that the data is garbled.

    I would be seeing if you can confirm your serial server is working with something else. When you use your PC to connect to your PC Interface with a USB adaptor do you use the same cable? I would bell out the cable too... I cant remember if you need a straight through or null modem cable... I think straight through but I may be wrong
     
    jboer, Apr 13, 2020
    #9
  10. shindig

    shindig

    Joined:
    Sep 6, 2019
    Messages:
    8
    Likes Received:
    1
    yep fair enough will troubleshoot with a another pc connected directly to the pc interface via a usb to rs232 cable and see if everything is working. Thankyou again for your time. I will poke around over the next few days and post the update
     
    shindig, Apr 13, 2020
    #10
    jboer likes this.
  11. shindig

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    422
    Likes Received:
    50
    Location:
    Perth
    Homebridge reads your XML file to get it’s connection details, you will have to edit the correct com port into the XML without changing any of the formatting or other parameters and this is not something I would recommend doing unless you are very sure and if u get something wrong it could send commands to the network that screws up firmware on units (Long, painful, expensive story behind how I know this).
     
    chromus, Apr 14, 2020
    #11
  12. shindig

    shindig

    Joined:
    Sep 6, 2019
    Messages:
    8
    Likes Received:
    1
    Hey, just updating here again regarding this. So I got a FTDI usb to serial cable and connected it to the 5500PC and connected that to a windows laptop and the connection to the cbus network was successful with me being able to load my xml file and have it scan the units etc properly. So I am wondering if I need a different serial cable (maybe a null modem type?) to connect the usr-iot device to play nicely with cbus toolkit

    Anyway, I tried then to edit my current homebridge setup which is on a docker on a synology nas to add a couple of the lights from cbus to it as per Darryls useful youtube video and written instructions, but I am not having any luck. The homebridge log says

    4/27/2020, 5:00:20 AM] [CBus] Initializing homebridge-cbus.CBus platform...
    2020-04-27T05:00:20.899Z cbus:client Opening connection to C-Gate…
    [4/27/2020, 5:00:20 AM] Loading 0 accessories...

    My homebridge config file is

    "platform": "homebridge-cbus.CBus",
    "name": "CBus",
    "client_ip_address": "192.168.1.61",
    "client_controlport": 20023,
    "client_cbusname": "SUGARGUM",
    "client_network": 254,
    "client_application": 56,
    "client_debug": true,
    "platform_export": "my-platform.json",
    "accessories": [
    {
    "type": "light",
    "id": "075",
    "name": "Games Balcony High"
    },
    {
    "type": "light",
    "id": "076",
    "name": "Games Balcony Low"
    }


    the ip address of the laptop is 192.168.1.61 and i edited the access.txt file in the cgate config folder on the laptop to add remote 192.168.1.220 Program to it (this is the ip address of the synology)

    I also edited the c-gateconfig.txt to add SUGARGUM to project.default= and project.start=

    The other thing that i noticed was that the homebridge setup wasn't letting me save the config file without putting " " on either side of the ID number of the accessories. Perhaps that's the reason they aren't loading?

    Sorry again for multiple questions and thanks in advance
     
    shindig, Apr 27, 2020
    #12
  13. shindig

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    422
    Likes Received:
    50
    Location:
    Perth
    Install Homebridge Config UI X it parses the json for u and can correct errors from a nice smart browser interface
     
    chromus, Apr 27, 2020
    #13
  14. shindig

    shindig

    Joined:
    Sep 6, 2019
    Messages:
    8
    Likes Received:
    1
    Hi again chromus, yes I have done that and fixed the error with the config file. It was the extra 0 that I was putting in front of the "id" that was the issue. Unfortunately, still having the same issue of the homebridge not discovering the 2 accessories I had used in the config for its trial. Any other suggestions?
     
    shindig, Apr 27, 2020
    #14
  15. shindig

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    422
    Likes Received:
    50
    Location:
    Perth
    Forgive me for missing something, (I'm on strong meds for a medical condition), Homebridge doesn't "discover" anything for itself. There is an interrogation of the xml file which outputs to the my-platform file (it never works quite right for me).

    Because I'm having trouble understanding I have included some of my code from my config.json, so you can see how mine is written and maybe you can then play spot the difference and work from there.

    Code:
    {
        "bridge": {
            "name": "My Home",
            "username": "DC:22:3D:E3:CE:30",
            "port": 51826,
            "pin": "REDACTED"
        },
        "description": "This is the My home HomeKit API configuration file.",
        "platforms": [
            {
                "platform": "homebridge-cbus.CBus",
                "name": "CBus",
                "client_ip_address": "127.0.0.1",
                "client_controlport": 20023,
                "client_cbusname": "REDACTED",
                "client_network": 254,
                "client_application": 56,
                "client_debug": true,
                "platform_export": "/home/pi/my-platform.json",
                "accessories": [
                    {
    
    Code:
    {
                        "type": "light",
                        "id": 24,
                        "name": "OutLaundry Light",
                        "enabled": true
                    },
                    {
                        "type": "fan",
                        "id": 25,
                        "name": "Laundry Fan",
                        "enabled": true
                    },
    
    Edit: Just checking - you are restarting your homebridge between change and test aren't u?
     
    chromus, Apr 28, 2020
    #15
  16. shindig

    chromus

    Joined:
    Jan 27, 2014
    Messages:
    422
    Likes Received:
    50
    Location:
    Perth
    Something just came to me, the names made me think -> are these NORMAL items you are calling or SCENES?

    The High / Low in the description made me wonder....

    Scenes are not in the same Application group as NORMAL and you will need to specify the application number for them

    This is for my temp probes so you will need to change to the Scenes application number
    Code:
    {
                        "type": "temperature",
                        "id": 0,
                        "application": 228,
                        "channel": 2,
                        "name": "Bed 2 Temperature"
                    },
    
     
    chromus, Apr 28, 2020
    #16
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.