ebaauw / homebridge-nb

Homebridge plugin for Nuki Bridge
Apache License 2.0
52 stars 3 forks source link

Bridge doesn't connect due to error: http status 401 Unauthorized #62

Closed al3xzo closed 2 years ago

al3xzo commented 2 years ago
Bildschirmfoto 2022-04-06 um 01 28 09
ebaauw commented 2 years ago

Did you press the button on the bridge?

al3xzo commented 2 years ago

Hello Erik,

Yes I did. I restarted Homebridge several times, waited for the bridge to light up and pressed the button. Then the error message (error 401) occurred.

Best

Alexander Zöchling

Am 06.04.2022 um 07:28 schrieb Erik Baauw @.***>:

 Did you press the button on the bridge?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

ebaauw commented 2 years ago

Is the system clock on the server running Homebridge correct? The Nuki bridge API hashes the token combined with the current time to guard against replay attacks. If the client (Homebridge) and Nuki bridge clocks are out of sync, the bridge won't accept the request.

al3xzo commented 2 years ago

Hello,

you were correct. The container was set to the right time zone, but my server was set incorrectly. I corrected the mistake - nevertheless I couldn’t connect my nuki devices. Now homebridge puts out the following: “error: 0.0.0.0:8080: cannot listen: EADDRINUSE”

Mit freundlichen Grüßen

Alexander Zöchling

Am 06.04.2022 um 12:06 schrieb Erik Baauw @.***>:  Is the system clock on the server running Homebridge correct? The Nuki bridge API hashes the token combined with the current time to guard against replay attacks. If the client (Homebridge) and Nuki bridge clocks are out of sync, the bridge won't accept the request.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

ebaauw commented 2 years ago

EADDRINUSE means that the port cannot be opened, because another process already uses it. This typically happens if you try and start another instance of Homebridge, while it’s already running.