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

Stateless Programmable Switch no longer works on node v8.x #464

Closed
ebaauw opened this issue Jun 30, 2017 · 8 comments
Closed

Stateless Programmable Switch no longer works on node v8.x #464

ebaauw opened this issue Jun 30, 2017 · 8 comments

Comments

@ebaauw
Copy link
Contributor

ebaauw commented Jun 30, 2017

I looks like the triggering of the Stateful Programmable Switch through it's Input Event is broken under node v8.x, see ebaauw/homebridge-hue#125. One of my users experienced this on his Raspberry. Reinstalling node v7.x solved it.

I reproduced the issue under macOS 10.12.5, using node v8.1.2 and v8.1.3. Installing node v8 over a working installation/configuration and re-installing home bridge (to force the compilation of dsn-sd agains the new node version) breaks the programmable switch. After re-installing node v6.11.0 (and npm and homebridge to re-compile the dns-sd stuff), the switch works again.

I have no idea what could be causing this, or even where to start looking. Any help is greatly appreciated.

@KhaosT
Copy link
Contributor

KhaosT commented Jun 30, 2017 via email

@ebaauw
Copy link
Contributor Author

ebaauw commented Jul 1, 2017

Thanks, Tian. It might be, I'll try the HomeKit debug profile this weekend.

@ebaauw
Copy link
Contributor Author

ebaauw commented Jul 1, 2017

I got the debug profile working, but homed is generating dozens of messages per second. I think I better setup a test Home with just one or two accessories.

@KhaosT
Copy link
Contributor

KhaosT commented Jul 1, 2017 via email

@ebaauw
Copy link
Contributor Author

ebaauw commented Jul 2, 2017

Yes, it's the same issue, not limited to the Input Event. In the log of DEBUG=* homebridge -D I see

  EventedHTTPServer [::ffff:192.168.xxx.xxx] HTTP connection was closed +1s
  EventedHTTPServer [::ffff:192.168.xxx.xxx] HTTP server was closed +1ms
  EventedHTTPServer [::ffff:192.168.xxx.xxx] Client connection closed +0ms

When I refresh the screen in Eve, the connection is re-estabished, and a press on the Hue dimmer switch is actually registered by HomeKit, but after a few seconds, the same messages appear and the connection is lost again.

I'll close this issue in favour of homebridge/homebridge#1353.

@ebaauw ebaauw closed this as completed Jul 2, 2017
KhaosT added a commit that referenced this issue Jul 2, 2017
@KhaosT
Copy link
Contributor

KhaosT commented Jul 2, 2017

This should be addressed with 0.4.27

I don't know why but Node.js introduced a different property that will close inactive connections. See here

@ebaauw
Copy link
Contributor Author

ebaauw commented Jul 2, 2017

Thanks once again, Tian!

Guess I will need to use keepAliveTimeout in my homebridge-zp plugin as well. It uses http to create a server where it receives the notifications from the Sonos speakers.

@KhaosT
Copy link
Contributor

KhaosT commented Jul 2, 2017

@ebaauw depends on how the client create the connection. There is a bug that causes http server to ignore Connection: keep-alive in the request. If your client does include that when starting HTTP request, once the bug being fixed it should no longer be needed.

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

2 participants