Page 1 of 2

Can't get Homebridge to auto-load

PostPosted: Tue Sep 13, 2016 4:58 pm
by petematheson
Hiya,

Followed all the steps in your post on how to install / set up Homebridge.

When I run the launchctl command it loads, but no devices show in the HomeKit app.
If I try and re-launch the app it tells me it's already running.
If I stop the app, then manually fire up home kit then the devices report in fine.

There's no log file being created either so I can't see any errors anywhere?

Re: Can't get Homebridge to auto-load

PostPosted: Wed Sep 14, 2016 6:52 am
by durosity
On a complete side note to this Colorado4Wheeler hinted he was going to be writing a HomeBridge plugin for Indigo 7.. might be worth waiting for that since that cannot be long off? :D

Re: Can't get Homebridge to auto-load

PostPosted: Wed Sep 14, 2016 10:31 am
by Different Computers
I'm in the same boat. No errors, but no HomeBridge either.

Re: Can't get Homebridge to auto-load

PostPosted: Thu Sep 15, 2016 12:13 am
by webdeck
petematheson wrote:
Hiya,

Followed all the steps in your post on how to install / set up Homebridge.

When I run the launchctl command it loads, but no devices show in the HomeKit app.
If I try and re-launch the app it tells me it's already running.
If I stop the app, then manually fire up home kit then the devices report in fine.

There's no log file being created either so I can't see any errors anywhere?


If you followed all of the installation instructions, then the log file should be in <your home directory> -> Library -> Logs -> homebridge.log

-Mike

Re: Can't get Homebridge to auto-load

PostPosted: Thu Sep 15, 2016 6:31 am
by Different Computers
isn't it a trick to separate the log entries from the working, manually run instance from the not-working, not running instance?

Re: Can't get Homebridge to auto-load

PostPosted: Thu Sep 15, 2016 8:01 am
by webdeck
Different Computers wrote:
isn't it a trick to separate the log entries from the working, manually run instance from the not-working, not running instance?


Running manually puts the output in the Terminal window, not a log file.

Re: Can't get Homebridge to auto-load

PostPosted: Thu Sep 15, 2016 5:53 pm
by Different Computers
Sooooo this is what my log says. (Apparently my mini has been running for 4+ months)

Code: Select all
[6/5/2016, 11:17:20 AM] Loaded plugin: homebridge-indigo
[6/5/2016, 11:17:21 AM] Registering platform 'homebridge-indigo.Indigo'
[6/5/2016, 11:17:21 AM] ---
[6/5/2016, 11:17:21 AM] Loaded config.json with 0 accessories and 1 platforms.
[6/5/2016, 11:17:21 AM] ---
[6/5/2016, 11:17:21 AM] Loading 1 platforms...
[6/5/2016, 11:17:21 AM] [Two Dog Hill] Initializing Indigo platform...
[6/5/2016, 11:17:21 AM] [Two Dog Hill] Indigo base URL is http://127.0.0.1:8176
[6/5/2016, 11:17:21 AM] [Two Dog Hill] Indigo request: http://127.0.0.1:8176/devices.json/
[6/5/2016, 11:17:21 AM] Loading 0 accessories...
[6/5/2016, 11:17:21 AM] [Two Dog Hill] Indigo request: http://127.0.0.1:8176/devices/Almanac.json

many many many skipped entries....
and it ends with
Code: Select all
[6/5/2016, 11:17:22 AM] [Two Dog Hill] Discovered WUnderground Ten Day Forecast (ID 821705499): Forecast Ten Day
[6/5/2016, 11:17:22 AM] [Two Dog Hill] Ignoring excluded ID 821705499


I note that this looks very different from when I run it manually, where it ends with

Code: Select all
[9/15/2016, 7:51:28 PM] [Two Dog Hill] Initializing platform accessory '⭐️⭐️'...
Scan this code with your HomeKit App on your iOS device to pair with Homebridge:
                       
    ┌────────────┐     
    │ 0#1-##-###│     
    └────────────┘     
                       
[9/15/2016, 7:51:28 PM] Homebridge is running on port 51826.


(code obfuscated with ##'s)

No errors.

Re: Can't get Homebridge to auto-load

PostPosted: Thu Sep 15, 2016 6:21 pm
by Different Computers
OK, I'm a rusty UNIX idiot. Should have tried tail instead of more.

I restarted, and then checked homebridge.log all the way to the end and I got this, inexplicably:
Code: Select all
[6/5/2016, 10:45:26 PM] [Two Dog Hill] Bedroom Lights: executeAction(false)
[6/5/2016, 10:47:40 PM] Got SIGINT, shutting down Homebridge...


So, seems like something is making the SIGINT happen, because I'm not sitting here pressing CTRL-C!

Re: Can't get Homebridge to auto-load

PostPosted: Thu Sep 15, 2016 7:19 pm
by webdeck
Different Computers wrote:
OK, I'm a rusty UNIX idiot. Should have tried tail instead of more.

I restarted, and then checked homebridge.log all the way to the end and I got this, inexplicably:
Code: Select all
[6/5/2016, 10:45:26 PM] [Two Dog Hill] Bedroom Lights: executeAction(false)
[6/5/2016, 10:47:40 PM] Got SIGINT, shutting down Homebridge...


So, seems like something is making the SIGINT happen, because I'm not sitting here pressing CTRL-C!


Go ahead and PM me the entire log file and I'll see if there's any other clues in there.

Re: Can't get Homebridge to auto-load

PostPosted: Thu Sep 15, 2016 9:35 pm
by Different Computers
Just noticed that after the restart, the log is not updating. Last entry still dated back in June.

So it appears that something in launchctl isn't right. I'll revisit that.

Re: Can't get Homebridge to auto-load

PostPosted: Thu Sep 15, 2016 9:36 pm
by webdeck
Different Computers wrote:
Just noticed that after the restart, the log is not updating. Last entry still dated back in June.

So it appears that something in launchctl isn't right. I'll revisit that.


You can also check Console to see if there are any errors there right after you do the launchctl command.

Re: Can't get Homebridge to auto-load

PostPosted: Fri Sep 16, 2016 7:51 am
by Different Computers
It just gets stranger.

tail on the log, still lists 6/5 as the last date it ran, with a SIGINT to end.

But launchctl load -w ~/Library/LaunchAgents/com.webdeck.homebridge.plist gave me "already running".

I unloaded it, no error. reloaded it, no error.

But the log doesn't update.

Re: Can't get Homebridge to auto-load

PostPosted: Fri Sep 16, 2016 8:12 am
by Different Computers
man, I must have been drinking when I tried to make this run at startup.

the launchctl plist still had USERNAME for the user name.

Fixed that.

Still doesn't seem to start up the shell script when I make launchctl load it.. But when I start the shell script manually, now I get

Code: Select all
[9/16/2016, 10:06:22 AM] Homebridge is running on port 51826.
[9/16/2016, 10:07:54 AM] Got SIGINT, shutting down Homebridge...


So it looks like two problems:
1. launchctl still isn't finding the script
2. the script runs, but something sends a SIGINT and shuts the process down as soon as it finishes starting up.

I'll pound on the first problem, but I have no idea how to troubleshoot the latter. And keep in mind, again, HomeBridge runs just fine when I start it in a terminal window!


So for problem 1, should this line in the launchctl plist

Code: Select all
    <string>/Users/USERNAME/runhomebridge</string>

actually be
Code: Select all
    <string>/Users/USERNAME/runhomebridge.sh</string>

?
Because it seems like it's referring to the shell script by file name, and its name is runhomebridge.sh.

Re: Can't get Homebridge to auto-load

PostPosted: Fri Sep 16, 2016 8:16 am
by webdeck
Feel free to pm me the script and launch plist and I can take a look.

Re: Can't get Homebridge to auto-load

PostPosted: Thu Oct 13, 2016 2:19 am
by rvarela
Is this solved in any way? I am having a similar issue, running home bridge -D from terminal loads devices, but using the load procedure does not.
I am keeping a window open by now
Thanks,
Ramiro