Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get status change #7

Closed
tvillingett opened this issue Mar 5, 2016 · 19 comments
Closed

Cannot get status change #7

tvillingett opened this issue Mar 5, 2016 · 19 comments

Comments

@tvillingett
Copy link

I have set up two persons iphones with IP-addresses that works when I ping them from another computer on the same local network.
The status newer changes in the Eve app. what can I do to debug?

@PeteLawrence
Copy link
Owner

Can you ping them from the device running Homebridge?

@tvillingett
Copy link
Author

I tried that now, and yes I can ping them.

@oberstmueller
Copy link

The Pi need Sudo to Ping.You can fix it with "sudo chmod u+s /bin/ping". Then ping and homebridge-people should work.

@armins2k
Copy link

armins2k commented Mar 6, 2016

Hi,
I have the same problem. I can ping my phone from my Pi and the people plugin loads fine on homebridge start, but the Home app doesn't see my phone.
Anything else I can do to troubleshoot?

Thanks!

@tvillingett
Copy link
Author

Not in my install, ping works fine. I tried the suggested chmod also, but still "NO" as status only. Can it be something about writing the persistant file?

@PeteLawrence
Copy link
Owner

@tvillingett: Assuming that you're using the latest version from npm (npm update -g homebridge-people), the plugin will use the standard homebridge persist folder so permissions shouldn't be an issue. Could you paste the output from ls -la /home/pi/.homebridge/persist where '/home/pi' is the home directory of the user that you're running and I'll take a look.

@PeteLawrence
Copy link
Owner

@armins2k: Are you saying that the Home app doesn't show your phone at all, or that it doesn't show it as being online?

@tvillingett
Copy link
Author

Seems like it don't write anything:

pi@thethingbox ~/.homebridge/persist $ ls -la
total 36
drwxr-xr-x 2 pi pi  4096 Mar  3 20:21 .
drwxr-xr-x 4 pi pi  4096 Mar  6 13:18 ..
-rw-r--r-- 1 pi pi   705 Mar  6 19:13 AccessoryInfo.CC243FE4DF34.json
-rw-r--r-- 1 pi pi 23624 Mar  6 21:24 IdentifierCache.CC243FE4DF34.json

@tvillingett
Copy link
Author

I copied the settings to home/.homebridge and run the homebridge again as root, but no success.

@armins2k
Copy link

armins2k commented Mar 6, 2016

Home app shows my phone but it's always non active. Checked the IP address couple of times, also my config file seems fine.

@PeteLawrence
Copy link
Owner

You could try adding the following after ping.sys.probe(target, function(isAlive){ within index.js, followed by a restart of homebridge.

this.log('ping', isAlive);

If you see 'true' in the output it's an issue with the ping, otherwise it's a problem writing the seen file.

@tvillingett
Copy link
Author

If found the problem: the configuration file does not use the keyword target it uses ip.

The settings example should be updated. It works for me now when I changed this.
I debugged it with this.log and got undefined on the IP adress, so I looked for the references - which was none to target :)

Example of configuration:

{
    "accessory": "people",
    "name": "People",
    "people": [
        {
            "name": "Anders Iphone",
            "ip": "172.16.4.133"
        },
        {
            "name": "PS4",
            "ip": "172.16.4.151"
        }
    ],
    "threshold": 15
}

@PeteLawrence
Copy link
Owner

Ah ok, glad you got it working. I renamed 'ip' to 'target' towards the end of last week but hadn't got around to pushing it to npm. I assumed everyone would find the plugin via npm and use the old config keys that are documented on npm still, rather than the new ones documented on Github.

I'll go push a new version to npm now so that the documentation is in sync with Github.

Thanks for trying out the plugin!

@PeteLawrence
Copy link
Owner

Changes released in 6e0bb33

@armins2k
Copy link

armins2k commented Mar 7, 2016

okay, mine wasn't the 'IP' 'target' problem. Just made the suggested change to the index.js file and now I see 'true' in the output and its working in Home app.
So can I leave the index file like that or is the problem still not solved??
Sorry but I'm not an expert ;)
Thanks for the help!!

@maciej-wilczynski
Copy link

I have a solution, homebridge-people uses ping@0.1.10 which is old version of package. The workaround is simple:
edit file node_modules/ping/lib/ping-sys.js and replace 30 line to:
ls = cp.spawn('/bin/ping, ['-n', '-w', '2', '-c', '1', addr]);

or wait for homebridge-people update

@alexbaldwin
Copy link

@wiqert was that the only change? I am not able to get this plugin working correctly at all.

@maciej-wilczynski
Copy link

Yep, Only this one.

Sent with GitHawk

@i3laze
Copy link

i3laze commented Jan 24, 2019

I have a solution, homebridge-people uses ping@0.1.10 which is old version of package. The workaround is simple:
edit file node_modules/ping/lib/ping-sys.js and replace 30 line to:
ls = cp.spawn('/bin/ping, ['-n', '-w', '2', '-c', '1', addr]);

or wait for homebridge-people update

@wiqert Thanks! That fixed my HomeBridge running in Docker (oznu/docker-homebridge).

But.. you missed ' . Correct line 30 would be:
ls = cp.spawn('/bin/ping', ['-n', '-w', '2', '-c', '1', addr]);

I suggest this workaround to be pulled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants
@alexbaldwin @maciej-wilczynski @PeteLawrence @tvillingett @i3laze @armins2k @oberstmueller and others