homebridge-nest-cam_old icon indicating copy to clipboard operation
homebridge-nest-cam_old copied to clipboard

Cannot connect to Nest API on system startup

Open potmat opened this issue 6 years ago • 4 comments

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.

potmat avatar Mar 21 '18 00:03 potmat

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.

KhaosT avatar Mar 21 '18 03:03 KhaosT

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.

potmat avatar Mar 21 '18 14:03 potmat

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 :)

jvic1234 avatar Feb 19 '19 22:02 jvic1234

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.

coolcsh avatar Apr 05 '20 03:04 coolcsh