Error on startup

Posted on
Sun Nov 13, 2016 9:23 am
farberm offline
Posts: 123
Joined: Feb 24, 2008

Error on startup

Can anyone help with this. Using Node 7.1 and npm 3.10.9. I am getting the following error on startup.


Scan this code with your HomeKit App on your iOS device to pair with Homebridge:

┌────────────┐
│ 031-45-154 │
└────────────┘

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

Error: listen EADDRINUSE :::51826
at Object.exports._errnoException (util.js:1022:11)
at exports._exceptionWithHostPort (util.js:1045:20)
at Server._listen2 (net.js:1262:14)
at listen (net.js:1298:10)
at Server.listen (net.js:1376:9)
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:496:16)
at Server._publish (/usr/local/lib/node_modules/homebridge/lib/server.js:111:16)
at Server.<anonymous> (/usr/local/lib/node_modules/homebridge/lib/server.js:369:14)
at /usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/once.js:15:19
at IndigoPlatform.<anonymous> (/usr/local/lib/node_modules/homebridge-indigo/index.js:215:13)
at /usr/local/lib/node_modules/homebridge-indigo/node_modules/async/lib/async.js:52:16
at /usr/local/lib/node_modules/homebridge-indigo/node_modules/async/lib/async.js:269:32
at /usr/local/lib/node_modules/homebridge-indigo/node_modules/async/lib/async.js:44:16
at /usr/local/lib/node_modules/homebridge-indigo/index.js:240:29
at /usr/local/lib/node_modules/homebridge-indigo/node_modules/async/lib/async.js:52:16
at /usr/local/lib/node_modules/homebridge-indigo/node_modules/async/lib/async.js:269:32
at /usr/local/lib/node_modules/homebridge-indigo/node_modules/async/lib/async.js:44:16
at IndigoPlatform.<anonymous> (/usr/local/lib/node_modules/homebridge-indigo/index.js:288:17)
at IndigoPlatform.<anonymous> (/usr/local/lib/node_modules/homebridge-indigo/index.js:362:17)
at /usr/local/lib/node_modules/homebridge-indigo/node_modules/async/lib/async.js:906:35
at _arrayEach (/usr/local/lib/node_modules/homebridge-indigo/node_modules/async/lib/async.js:85:13)
at Request.<anonymous> (/usr/local/lib/node_modules/homebridge-indigo/node_modules/async/lib/async.js:898:17)
at Request._callback (/usr/local/lib/node_modules/homebridge-indigo/node_modules/async/lib/async.js:44:16)
at Request.self.callback (/usr/local/lib/node_modules/homebridge-indigo/node_modules/request/request.js:373:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)

Posted on
Sun Nov 13, 2016 9:24 am
webdeck offline
Posts: 359
Joined: May 07, 2005

Re: Error on startup

That means you already have an instance running that you need t stop first.

Posted on
Sun Nov 13, 2016 9:26 am
farberm offline
Posts: 123
Joined: Feb 24, 2008

Re: Error on startup

I have rebooted and still get that error. How do I go about doing that?

Posted on
Sun Nov 13, 2016 9:27 am
webdeck offline
Posts: 359
Joined: May 07, 2005

Re: Error on startup

If you used launchctl to automatically start it, then it starts again when you reboot. You can unload the launchctl script to stop it and prevent it from restarting: launchctl unload -w ~/Library/LaunchAgents/com.webdeck.homebridge.plist

Posted on
Sun Nov 13, 2016 9:48 am
farberm offline
Posts: 123
Joined: Feb 24, 2008

Re: Error on startup

I am not using launchct. Just to be sure I entered the command in the terminal and still get the same error

Posted on
Sun Nov 13, 2016 9:52 am
webdeck offline
Posts: 359
Joined: May 07, 2005

Re: Error on startup

This command will tell you what process is using port 51826:

Code: Select all
sudo lsof -i :51826

Posted on
Sun Nov 13, 2016 9:55 am
farberm offline
Posts: 123
Joined: Feb 24, 2008

Re: Error on startup

Response

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
node 543 markfarber 11u IPv6 0xb476f3ed81997703 0t0 TCP *:51826 (LISTEN)
node 543 markfarber 16u IPv6 0xb476f3ed8196e703 0t0 TCP 192.168.1.22:51826->192.168.1.115:54116 (ESTABLISHED)
node 543 markfarber 20u IPv6 0xb476f3ed81997c43 0t0 TCP 192.168.1.22:51826->192.168.1.13:63166 (ESTABLISHED)
node 543 markfarber 24u IPv6 0xb476f3ed8bf34c43 0t0 TCP 192.168.1.22:51826->192.168.1.45:60579 (ESTABLISHED)
node 543 markfarber 28u IPv6 0xb476f3ed8bf44703 0t0 TCP 192.168.1.22:51826->192.168.1.18:62553 (ESTABLISHED)
node 543 markfarber 31u IPv6 0xb476f3ed8bf6a183 0t0 TCP 192.168.1.22:51826->192.168.1.25:49286 (ESTABLISHED)
node 543 markfarber 36u IPv6 0xb476f3ed8bf71703 0t0 TCP 192.168.1.22:51826->192.168.1.24:57787 (ESTABLISHED)

these all look to be other apple devices on the network? iPhones and Apple TV

Posted on
Sun Nov 13, 2016 10:00 am
webdeck offline
Posts: 359
Joined: May 07, 2005

Re: Error on startup

You have homebridge running already. That's what "node" is.

launchctl list | grep homebridge

will probably show it in that list somewhere.

Posted on
Sun Nov 13, 2016 10:03 am
farberm offline
Posts: 123
Joined: Feb 24, 2008

Re: Error on startup

Farber-Media-Center:~ markfarber$ launchctl list | grep homebridge
543 0 com.homebridge.server
Farber-Media-Center:~ markfarber$


Ok so how do I stop the process and the autoload because I am getting errors from my home app that it is not woking

Posted on
Sun Nov 13, 2016 10:05 am
webdeck offline
Posts: 359
Joined: May 07, 2005

Re: Error on startup

Do you remember how you installed it? You must have done something different from the instructions provided because the launchctl command I gave you would have worked if you had installed it according to the instructions in this forum.

Posted on
Sun Nov 13, 2016 10:13 am
farberm offline
Posts: 123
Joined: Feb 24, 2008

Re: Error on startup

I originally installed via your instructions several months ago.

I tried to get auto restart to work according the the forum but never seemed to work.

I then recently updated to nodejs6 and npm3 via the forum instructions to uninstall npm2 and nodejs6 and to rm node_modules command. Then installed npm3 and nodejs6.

Lastly I uninstalled nodejs6 and npm3 and installed using the nodejs7 pkg which installs both nom 3.10.9 and nodejs7. I guess my autolaunch command is not working but not sure why now?

I just restarted and auto launch seems to be working. My only question is where can I locate the autolaunch function and what I really have been trying to do is get autolaunch and auto restart to work on a crash.

Suggestions and thanks for your help.

Posted on
Sun Nov 13, 2016 10:16 am
webdeck offline
Posts: 359
Joined: May 07, 2005

Re: Error on startup

WEll the good news is that you have auto launch working because it was running after a reboot.

You can use spotlight to search for homebridge to try and find where you put the launchctl plist file.

Posted on
Sun Nov 13, 2016 10:29 am
farberm offline
Posts: 123
Joined: Feb 24, 2008

Re: Error on startup

.homebridge is located in my user folder and has folders of accessories and resist and my config.js file.

there is a lanchctl file located in the root/bin folder.

Since auto launch is working that is ok. How do I enable auto restart?

Posted on
Sun Nov 13, 2016 10:40 am
webdeck offline
Posts: 359
Joined: May 07, 2005

Re: Error on startup

They are one in the same. If it is autolaunching it is also auto-restarting.

Posted on
Sun Nov 13, 2016 10:51 am
farberm offline
Posts: 123
Joined: Feb 24, 2008

Re: Error on startup

What terminal command can I use to show me errors and crashes of is there a log

Who is online

Users browsing this forum: No registered users and 2 guests