Homebridge-config-ui-x: Cannot connect to the server

Created on 6 Sep 2020  ยท  11Comments  ยท  Source: oznu/homebridge-config-ui-x

Describe Your Problem:

I cannot go into "http://192.168..:8581"
Chrome says "192.168.
. refused to connect.".
Safari and Firefox say the same.
And, I am a new to programming.

When I did

sudo npm install -g --unsafe-perm homebridge homebridge-config-ui-x

Mac OS Terminal (w/ SSH) or LXTerminal responded

npm WARN [email protected] requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.

So I installed bufferutil and utf-8-validate via

npm i -g ***

, and the next I installed

npm i -g ws

May these be the problem??

Logs:

I tried

hb-service logs

but Terminal responds

ERROR: Log file does not exist at expected location: /var/lib/homebridge/homebridge.log

Homebridge Config:

{
    "bridge": {
        "name": "Homebridge 4AB5",
        "username": "0E:29:42:28:4A:B5",
        "port": 51171,
        "pin": "249-68-617"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        }
    ]
}

Screenshots:

Environment:

  • Node.js Version: v12.18.3
  • NPM Version: 6.14.8
  • Homebridge Version: 1.1.3
  • Homebridge Config UI X Version: 4.27.1 latest
  • Operating System: Debian 10.4
  • Process Supervisor: hb-service

question

Most helpful comment

Remove the Homebridge service:

sudo hb-service uninstall

Remove nvm, install node as per wiki instructions, then re-run install commands.

If you need help removing nvm, see https://github.com/homebridge/homebridge/wiki/How-To-Fix-Node.js-Install-Issues-On-Linux#step-2-remove-nodejs-and-homebridge

Note: while there is nothing stopping hb-service without with nvm, you need to understand how "nvm" works in a multi-user environment with system services, this is beyond the scope of this project, I only support Node.js installed as per wiki instructions.

hb-service includes it's own command to help you keep Node.js up-to-date: sudo hb-service update-node

Now perfectly working, thank you so much for super quick responses!

All 11 comments

What was the output of sudo hb-service install --user homebridge?

What was the output of sudo hb-service install --user homebridge?

is below,

โ„น Installing Homebridge Service
โ„น Starting Homebridge Service...
โœ” Homebridge Started

Manage Homebridge by going to one of the following in your browser:

Default Username: admin
Default Password: admin

And sudo journalctl -n 500 -u homebridge.service?

-- Logs begin at Sun 2020-09-06 20:02:54 JST, end at Sun 2020-09-06 20:51:37 JST
Sep 06 20:48:58 raspberrypi systemd[1]: homebridge.service: Service RestartSec=3
Sep 06 20:48:58 raspberrypi systemd[1]: homebridge.service: Scheduled restart jo
Sep 06 20:48:58 raspberrypi systemd[1]: Stopped Homebridge.
Sep 06 20:48:58 raspberrypi systemd[1]: Starting Homebridge...
Sep 06 20:48:58 raspberrypi run-parts[6369]: Ensuring /var/lib/homebridge is own
Sep 06 20:48:58 raspberrypi hb-service.js[6374]: /usr/bin/env: node': ใใฎใ‚ˆใ† Sep 06 20:48:58 raspberrypi systemd[1]: Started Homebridge. Sep 06 20:48:58 raspberrypi hb-service.js[6375]: /usr/bin/env:node': ใใฎใ‚ˆใ†
Sep 06 20:48:58 raspberrypi systemd[1]: homebridge.service: Main process exited,
Sep 06 20:48:58 raspberrypi systemd[1]: homebridge.service: Failed with result '
Sep 06 20:49:01 raspberrypi systemd[1]: homebridge.service: Service RestartSec=3
Sep 06 20:49:01 raspberrypi systemd[1]: homebridge.service: Scheduled restart jo
Sep 06 20:49:01 raspberrypi systemd[1]: Stopped Homebridge.
Sep 06 20:49:01 raspberrypi systemd[1]: Starting Homebridge...
Sep 06 20:49:01 raspberrypi run-parts[6376]: Ensuring /var/lib/homebridge is own
Sep 06 20:49:01 raspberrypi hb-service.js[6381]: /usr/bin/env: node': ใใฎใ‚ˆใ† Sep 06 20:49:01 raspberrypi systemd[1]: Started Homebridge. Sep 06 20:49:01 raspberrypi hb-service.js[6382]: /usr/bin/env:node': ใใฎใ‚ˆใ†
Sep 06 20:49:01 raspberrypi systemd[1]: homebridge.service: Main process exited,
Sep 06 20:49:01 raspberrypi systemd[1]: homebridge.service: Failed with result '
Sep 06 20:49:04 raspberrypi systemd[1]: homebridge.service: Service RestartSec=3
Sep 06 20:49:04 raspberrypi systemd[1]: homebridge.service: Scheduled restart jo
lines 1-23

Ok. Now:

sudo systemctl stop homebridge

Then:

sudo hb-service run --allow-root --stdout

pi@raspberrypi:~$ sudo hb-service run --allow-root --stdout
[2020-9-6 20:57:47] [HB Supervisor] Homebridge Storage Path: /var/lib/homebridge
[2020-9-6 20:57:47] [HB Supervisor] Homebridge Config Path: /var/lib/homebridge/config.json
[2020-9-6 20:57:47] [HB Supervisor] OS: Linux 5.4.51-v7+ arm
[2020-9-6 20:57:47] [HB Supervisor] Node.js v12.18.3 /usr/local/nvm/versions/node/v12.18.3/bin/node
[2020-9-6 20:57:47] [HB Supervisor] Homebridge Path: /usr/local/nvm/versions/node/v12.18.3/lib/node_modules/homebridge/bin/homebridge
[2020-9-6 20:57:47] [HB Supervisor] UI Path: /usr/local/nvm/versions/node/v12.18.3/lib/node_modules/homebridge-config-ui-x/dist/bin/standalone.js
[2020-9-6 20:57:47] [HB Supervisor] Starting Homebridge with extra flags: -I
[2020-9-6 20:57:47] [HB Supervisor] Started Homebridge v1.1.3 with PID: 7804
[2020-9-6 20:57:48] Loaded config.json with 0 accessories and 1 platforms.
[2020-9-6 20:57:48] ---
[2020-9-6 20:57:50] Loaded plugin: [email protected]
[2020-9-6 20:57:50] Registering platform 'homebridge-config-ui-x.config'
[2020-9-6 20:57:50] ---
[2020-9-6 20:57:50] Loading 1 platforms...
[2020-9-6 20:57:50] [Config] Initializing config platform...
[2020-9-6 20:57:50] [Config] Running in Service Mode
Setup Payload:
X-HM://0023VSQ09FH6P
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     
โ”‚ 249-68-617 โ”‚     
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

[2020-9-6 20:57:50] Homebridge is running on port 51171.
[2020-9-6 20:57:53] [Config] Homebridge Config UI X v4.27.1 is listening on :: port 8581
[2020-9-6 20:57:54] [Config] Added new user: admin
[2020-9-6 20:57:54] [Config] Username and password have been set to default:
[2020-9-6 20:57:54] [Config] Username: admin
[2020-9-6 20:57:54] [Config] Password: admin

nvm is not setup under the homebridge user.

Remove the Homebridge service:

sudo hb-service uninstall

Remove nvm, install node as per wiki instructions, then re-run install commands.

If you need help removing nvm, see https://github.com/homebridge/homebridge/wiki/How-To-Fix-Node.js-Install-Issues-On-Linux#step-2-remove-nodejs-and-homebridge


Note: while there is nothing stopping hb-service without with nvm, you need to understand how "nvm" works in a multi-user environment with system services, this is beyond the scope of this project, I only support Node.js installed as per wiki instructions.

hb-service includes it's own command to help you keep Node.js up-to-date: sudo hb-service update-node

Thank you so much, I try the above and tell you the result later.

Remove the Homebridge service:

sudo hb-service uninstall

Remove nvm, install node as per wiki instructions, then re-run install commands.

If you need help removing nvm, see https://github.com/homebridge/homebridge/wiki/How-To-Fix-Node.js-Install-Issues-On-Linux#step-2-remove-nodejs-and-homebridge

Note: while there is nothing stopping hb-service without with nvm, you need to understand how "nvm" works in a multi-user environment with system services, this is beyond the scope of this project, I only support Node.js installed as per wiki instructions.

hb-service includes it's own command to help you keep Node.js up-to-date: sudo hb-service update-node

Now perfectly working, thank you so much for super quick responses!

The next release will show this warning when running hb-service install with NVM:

โ„น WARNING: It looks like you are running Node.js via NVM (Node Version Manager).
  Using hb-service with NVM may not work unless you have configured NVM for the
  user this service will run as. See https://git.io/JUZ2g for instructions on how
  to remove NVM, then follow the wiki instructions to install Node.js and Homebridge.
Was this page helpful?
0 / 5 - 0 ratings

Related issues

mafyata picture mafyata  ยท  3Comments

mbierman picture mbierman  ยท  5Comments

chromusphil picture chromusphil  ยท  5Comments

eximiusvir picture eximiusvir  ยท  5Comments

Partizan7676 picture Partizan7676  ยท  4Comments