gismo141 / homebridge-server

Server plugin for homebridge
https://gismo141.github.io/configure-your-homebridge-2/
152 stars 20 forks source link

Trying to install homebridge-server #47

Closed juanillo62gm closed 6 years ago

juanillo62gm commented 7 years ago

I installed the plugin with that:

[sudo] npm install homebridge-server@latest -g

and added this code to the config.json in systemd:

{ "bridge": { "name": "HomeBridge", "username": "18:00:27:40:BC:1B", "port": 51825, "pin": "261-12-015" },

    "platforms": [{
                    "platform": "yeelight",
                    "name": "Yeelight"
            },
            {
                    "platform": "Server",
                    "port": 2611,
                    "name": "Homebridge Server",
                    "log": "homebridgelog",
                    "restart": "homebridgerestart"
            }
    ]

}

but I can't access to the localhost:2611

I get that error:

events.js:141 throw er; // Unhandled 'error' event ^

Error: listen EADDRINUSE :::51825 at Object.exports._errnoException (util.js:870:11) at exports._exceptionWithHostPort (util.js:893:20) at Server._listen2 (net.js:1238:14) at listen (net.js:1274:10) at Server.listen (net.js:1370:5) at EventedHTTPServer.listen (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/eventedhttp.js:60:19) at HAPServer.listen (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:158:20) at Bridge.Accessory.publish (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:509:16) at Server._publish (/usr/local/lib/node_modules/homebridge/lib/server.js:114:16) at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:91:10)

Help me please :)

Samfox2 commented 7 years ago

Looks like the port (51825) is already used. Change the port in your config.json snd try again.

juanillo62gm commented 7 years ago

I changed the port and get this error:

/usr/local/lib/node_modules/homebridge/node_modules/mdns/lib/advertisement.js:56 dns_sd.DNSServiceRegister(self.serviceRef, flags, ifaceIdx, name, ^

Error: dns service error: name conflict at Error (native) at new Advertisement (/usr/local/lib/node_modules/homebridge/node_modules/mdns/lib/advertisement.js:56:10) at Object.create [as createAdvertisement] (/usr/local/lib/node_modules/homebridge/node_modules/mdns/lib/advertisement.js:64:10) at Advertiser.startAdvertising (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Advertiser.js:43:30) at Bridge.Accessory._onListening (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:555:20) at emitOne (events.js:77:13) at HAPServer.emit (events.js:169:7) at HAPServer._onListening (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:190:8) at emitOne (events.js:77:13) at EventedHTTPServer.emit (events.js:169:7)

rjmcfadd commented 7 years ago

Just restart whatever computer you have homebridge running off. That error just means that another instance of homebridge is currently running.

juanillo62gm commented 7 years ago

Yes I'm running homebrige with systemd but when I restart the raspberry pi zero w and try to enter on homebridge-server on the IP:2611 do not find the server

gismo141 commented 7 years ago

How have you install homebridge itself?

nguyendj commented 6 years ago

I had the same issue. I installed and run homebridge without errors but still could not access IP:8765 (connection timeout) here my config.json { "bridge": { "name": "Ở nhà", "username": "CC:22:3D:E3:CE:30", "port": 51826, "pin": "031-45-154" }, "platform": [ { "platform": "Server", "port" : 8765, "name" : "Homebridge Server", "log" : "systemd", }, { "platform": "XiaomiMiio", "name" : "XiaomiMiio", "pollChanges" : true, "pollInterval" : 15, "searchInterval":1800 } ], "accessories": [{ "accessory": "homebridge-rpitemp.RpiTemp", "name": "Nhiệt độ Rpi", "tempid": "cpu" }, { "accessory": "Dht", "name": "dht22", "name_temperature": "Nhiệt độ", "name_humidity": "Độ ẩm", "service": "dht22" }, { "accessory": "cec", "name": "TV", "type": "power", "address": 0 } ] }

gismo141 commented 6 years ago

Normally this error occurs, when another instance of homebridge is running on the same machine. This might happen, when a plugin crashes and the scheduler restarts the homebridge.

This problem is hard to identify without having a look at the logs, because nearly every plugin can cause this behavior.

gismo141 commented 6 years ago

@nguyendj you might have an easy fix!

In your config.json you have an error: The section of multiple platforms is called platforms and you are missing the trailing s.