Brandawg93 / homebridge-nest-cam_old

Use your Nest Cam as IP camera in HomeKit.
Apache License 2.0
92 stars 14 forks source link

Cannot connect to Nest API on system startup #24

Open potmat opened 6 years ago

potmat commented 6 years ago

If I have homebridge set to run at system startup, everything except the homebridge-nest-cam plugin works fine, this plugin throws the following error:

[NestCam]Failed to request access token. getaddrinfo EAI_AGAIN webapi.camera.home.nest.com:443

As far as I can tell this is the system making too many simulataneous DNS requests? But it works fine if I start home bridge manually as a service after startup using:

sudo systemctl start homebridge

It does not matter if the account running home bridge on startup is part of the sudo group or not.

KhaosT commented 6 years ago

It looks like this is a network issue. Probably you try to start homebridge before network stack is ready? Try alter the startup sequence and spin up homebridge after network is ready.

potmat commented 6 years ago

Possible but unlikely since I’m also using the homebridge-nest plugin and that one starts up just fine even though it makes lots of API calls.

jvic1234 commented 5 years ago

I am running into the same problem, I reinstalled the entire os, homebridge and everytime I run into the same problem, tried wireless and ethernet, no difference.

put a delay in the systemctl in the config for 30 seconds, but nothing has worked, this plugin is the only one that has this issue, no idea why?

all other plugin with load just fine :)

coolcsh commented 4 years ago

This happens because your homebridge is starting before the network is fully online. If you edit your homebridge.service file for systemd it probably has some lines like this:

[Unit] Description=Node.js HomeKit Server After=syslog.target network-online.target

Change them to instead look like this:

[Unit] Description=Homebridge Wants=network-online.target After=syslog.target network-online.target

Then rerun "sudo systemctl enable homebridge" and then "sudo reboot" and you should be good.