Homebridge PI with CBUS

Discussion in 'Third-Party Solutions' started by discjockeyr, Mar 8, 2021.

  1. discjockeyr

    discjockeyr

    Joined:
    Jan 9, 2007
    Messages:
    59
    Likes Received:
    0
    Hi guys,
    i had configure and working good and stable for some years now the PI with Homebridge and cbus plugin with Homekit. everything is working perfectly. I am trying now to set a new SD card with new raspbian, homebridge and UI interface. i have follow the instructions from here (https://github.com/homebridge/homebridge-raspbian-image/wiki/Getting-Started). i managed to install it and add it to homekit. when i change switch any lights on homekit i can see the change to homebridge UI. that means homebridge is working. what i did not manage is to speak to cbus. I am using the 5500PC rs232 interface for cbus and i have install also ser2sock but something seems that is missing as i cannot speak to cbus. Note that raspbian on my new setup is Buster and on previous working setup is Stretch. i don't know if i have to make something different for Buster.
    here below the homebridge status if somebody can help

    homebridge status
    Initializing HAP-NodeJS v0.9.2...
    [08/03/2021, 11:53:26] Loaded config.json with 0 accessories and 2 platforms.
    [08/03/2021, 11:53:26] Loaded 0 cached accessories from cachedAccessories.
    [08/03/2021, 11:53:26] ---
    [08/03/2021, 11:53:29] Loaded plugin: [email protected]
    [08/03/2021, 11:53:29] Registering platform 'homebridge-cbus.CBus'
    [08/03/2021, 11:53:29] ---
    [08/03/2021, 11:53:29] Loaded plugin: [email protected]
    [08/03/2021, 11:53:29] Registering platform 'homebridge-config-ui-x.config'
    [08/03/2021, 11:53:29] ---
    [08/03/2021, 11:53:29] Loading 2 platforms...
    [08/03/2021, 11:53:29] [CBus] Initializing homebridge-cbus.CBus platform...
    cbus:client Opening connection to C-Gate… +0ms
    [08/03/2021, 11:53:29] [Config] Initializing config platform...
    [08/03/2021, 11:53:29] [Config] Spawning homebridge-config-ui-x with PID 2443
    cbus:client C-Gate connection open. +131ms
    cbus:client Connected to C-Gate server v2.11.4 (build 3251), syntax v1.0 +12ms
    cbus:client Configuring C-Gate session… +1ms
    cbus:client C-Gate session estabished and configured at 20023:127.0.0.1 +5ms
    cbus:platform Loading the accessories list… +0ms
    cbus:platform Registering the accessories list… +363ms
    [08/03/2021, 11:53:30] Initializing platform accessory 'GARAGE'...
    [08/03/2021, 11:53:30] Initializing platform accessory 'PLAYROOM'...
    [08/03/2021, 11:53:30] Initializing platform accessory 'ENTRANCE VERANTA'...
    ..........A LIST WITH MORE ACCESSORY................
    [08/03/2021, 11:53:32] Error: listen EADDRINUSE: address already in use :::51526
    at Server.setupListenHandle [as _listen2] (net.js:1318:16)
    at listenInCluster (net.js:1366:12)
    at Server.listen (net.js:1452:7)
    at EventedHTTPServer.listen (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/util/eventedhttp.ts:155:20)
    at HAPServer.listen (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/HAPServer.ts:316:21)
    at Bridge.Accessory.publish (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/src/lib/Accessory.ts:1230:18)
    at BridgeService.publishBridge (/usr/local/lib/node_modules/homebridge/src/bridgeService.ts:210:17)
    at Server.publishBridge (/usr/local/lib/node_modules/homebridge/src/server.ts:142:24)
    at /usr/local/lib/node_modules/homebridge/src/server.ts:134:24
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    cbus:client rx snippet 343 'Begin XML snippet' +2s
    cbus:client rx snippet 347 '<?xml version="1.0" encoding="utf-8"?>' +3ms
    cbus:client rx snippet 347 '<Installation><OID>0c394f80-6222-1039-8296-c826bd0809fe</OID><DBVersion>2.3</DBVersion><Version>1.0…' +6ms
    cbus:client rx response { commandId: 100, code: 344, matched: false, processed: false, type: 'response', raw: '[100] 344 End XML snippet' } +17ms
    cbus:client matched request '[100] dbgetxml //PICBUS' with response '[100] 344 End XML snippet' (0 pending requests) +2ms
    cbus:platform Successfully fetched 6 applications, 60 groups and 30 units from C-Gate. +4s
    [08/03/2021, 11:53:34] Got SIGTERM, shutting down Homebridge...
    cbus:client sent command '[101] get //PICBUS/254/56/41 level' +3s
    cbus:client rx response { commandId: 101, code: 401, matched: false, processed: false, type: 'response', raw: '[101] 401 Bad object or device ID: //PICBUS/254/56/41 (Object not found)' } +4ms
    cbus:client matched request '[101] get //PICBUS/254/56/41 level' with response '[101] 401 Bad object or device ID: //PICBUS/254/56/41 (Object not found)' (0 pending requests) +1ms
    cbus:client sent command '[102] get //PICBUS/254/56/42 level' +12ms
    cbus:client rx response { commandId: 102, code: 401, matched: false, processed: false, type: 'response', raw: '[102] 401 Bad object or device ID: //PICBUS/254/56/42 (Object not found)' } +3ms
    cbus:client matched request '[102] get //PICBUS/254/56/42 level' with response '[102] 401 Bad object or device ID: //PICBUS/254/56/42 (Object not found)' (0 pending requests) +2ms
    cbus:client sent command '[103] get //PICBUS/254/56/43 level' +3ms
    cbus:client rx response { commandId: 103, code: 401, matched: false, processed: false, type: 'response', raw: '[103] 401 Bad object or device ID: //PICBUS/254/56/43 (Object not found)' } +3ms
    cbus:client matched request '[103] get //PICBUS/254/56/43 level' with response '[103] 401 Bad object or device ID: //PICBUS/254/56/43 (Object not found)' (0 pending requests) +2ms
    cbus:client sent command '[104] get //PICBUS/254/56/44 level' +3ms
    cbus:client rx response { commandId: 104, code: 401, matched: false, processed: false, type: 'response', raw: '[104] 401 Bad object or device ID: //PICBUS/254/56/44 (Object not found)' } +4ms
    cbus:client matched request '[104] get //PICBUS/254/56/44 level' with response '[104] 401 Bad object or device ID: //PICBUS/254/56/44 (Object not found)' (0 pending requests) +1ms
     
    discjockeyr, Mar 8, 2021
    #1
  2. discjockeyr

    DarylMc

    Joined:
    Mar 24, 2006
    Messages:
    1,308
    Likes Received:
    49
    Location:
    Cleveland, QLD, Australia
    Reading your logs the problem is not obvious to me at this time.
    I recommend to start again and use Greig’s instructions and setup script.
    https://github.com/greiginsydney/Homebridge-cbus-installer/blob/master/SETUP.md
    The script is awesome and will help you setup very fast.

    I have a small test network running with the RS232 interface and a USB FTDI adapter for some months now.
    The ser2sock service setup will need the systemd script not the init.d version
    This can be found in the Addicted To Pi instructions
    https://blog.addictedtopi.com/2017/05/21/installing-c-gate-on-a-raspberry-pi/
    I also mentioned here.
    https://github.com/greiginsydney/Homebridge-cbus-installer/issues/9
     
    DarylMc, Mar 8, 2021
    #2
  3. discjockeyr

    JasonY00

    Joined:
    Aug 30, 2012
    Messages:
    129
    Likes Received:
    27
    Location:
    Sydney
    I don't believe that you are connected to the c-bus network. The log says that it is trying to fetch the state of each c-bus accessory at startup as defined in the homebridge config.json file, but it cant find them...

    This is where the "bad object or device ID" statement comes from. Homebridge is trying to "get" the C-Bus state of each accessory but can't.

    Check that you are connected to the C-Bus network first. Try to connect to the remote c-gate on the pi from a windows PC via toolkit. If you can then see the logs etc and can control c-bus, you are connected. If not, the problem is with the RS-232 config in the pi.

    You can define the default network in the cgate config file. Make sure you do this and load it at startup. There are other threads that describe this process.

    Otherwise do what Daryl says and start again with Greig's instructions.

    Cheers

    Jason
     
    JasonY00, Mar 11, 2021
    #3
    DarylMc likes this.
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.