question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Characteristic setValue or updateValue cannot response to Home App

See original GitHub issue

hardware: Raspberry Pi 3B homebridge version: 2.2 nodejs version: 8.1.2 iOS version: 10.3.2

Hello all, I’m trying to integrate our legacy smart lightbulb devices to Homkit using homebridge and serial port. And I’m developing a homebridge plugin to implement it. I have added accessories to bridge successfully and serial port communication is ok between homebridge and devices and Now I meet a problem. When the plugin receive a serial port command, and I will set Characteristic value like following: accessory.getService(Service.Lightbulb).getCharacteristic(Characteristic.On).updateValue(newValue); Alternatively accessory.getService(Service.Lightbulb).getCharacteristic(Characteristic.On).setValue(newValue);

but accessory button in Home App always haven’t response until I change Home App to backgroud or restart Home App. But I noticed that if I click the button in Home App, and call updateValue/setValue by serial port immediately, the accessory button in Home App have response.

I guess that updateValue/setValue haven’t connect EventedHTTPServer and Home App will connect that, and updateValue/setValue calling will send event before Home App disconnect from EventedHTTPServer. But I don’t confirm it.

Does anybody know what’s the reason and how to solve it?

Thank you very much.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

7reactions
KhaosTcommented, Jul 2, 2017

Okay, so in Node.js 8.0, there is a new property introduced on http server which will close inactive connection after a timeout. homebridge 0.4.22 should addressed this problem on Node.js 8.0. Sorry for inconveniences.

1reaction
nicwisecommented, Jun 24, 2017

OK, I’ve found the/my problem. I don’t have a fix tho. At least, not a good one.

It’s Node. 8.1.2 to be exact. Well, thats the version I used to have.

TL;DR:

  • It works in 6.11, but my homebridge-broadlink-rm doesn’t. That needs 7.10
  • It works in 7.10 !! 😃
  • It FAILS in 8.1.2

I run the homebridge-broadlink-rm plugin which need 7.6.0 or better, so I got the latest stable, which appears to show this issue

I went back to 6.10.3, and everything works (I had to disable the broadlink plugin tho 😦 )

My other machine, which is working, is running 4.6.0. I need to upgrade that to 6.10 😃

I then went for the latest in 7.x (for the broadlink one) which WORKS! yay!

So… 8.1.2 bug? I’m not overly familiar with the Node ecosystem, so I don’t know where to look for breaking changes…

I’m also seeing this in the debug, which I assume is 👍

  EventedHTTPServer [::ffff:192.168.1.6] HTTP Response is finished +0ms
[6/25/2017, 9:06:36 AM] [DashSQS] [object Object] receiveMessage response
[6/25/2017, 9:06:37 AM] [DashSQS] [object Object] receiveMessage response
[6/25/2017, 9:06:37 AM] [DashSQS] Path Button: SQS Button state change. New state is false
[6/25/2017, 9:06:37 AM] [DashSQS] Path Button: Set State to false
  EventedHTTPServer [::ffff:192.168.1.53] Sending HTTP event '10.9' with data: {"characteristics":[{"aid":10,"iid":9,"value":false}]} +4s
  EventedHTTPServer [::ffff:192.168.1.6] Sending HTTP event '10.9' with data: {"characteristics":[{"aid":10,"iid":9,"value":false}]} +0ms
[6/25/2017, 9:06:41 AM] [DashSQS] [object Object] receiveMessage response
[6/25/2017, 9:06:41 AM] [DashSQS] Path Button: SQS Button state change. New state is true
[6/25/2017, 9:06:41 AM] [DashSQS] Path Button: Set State to true
  EventedHTTPServer [::ffff:192.168.1.53] Sending HTTP event '10.9' with data: {"characteristics":[{"aid":10,"iid":9,"value":true}]} +4s
  EventedHTTPServer [::ffff:192.168.1.6] Sending HTTP event '10.9' with data: {"characteristics":[{"aid":10,"iid":9,"value":true}]} +0ms
[6/25/2017, 9:06:51 AM] [DashSQS] [object Object] receiveMessage response
[6/25/2017, 9:06:51 AM] [DashSQS] Path Button: SQS Button state change. New state is false
[6/25/2017, 9:06:51 AM] [DashSQS] Path Button: Set State to false
  EventedHTTPServer [::ffff:192.168.1.53] Sending HTTP event '10.9' with data: {"characteristics":[{"aid":10,"iid":9,"value":false}]} +11s
  EventedHTTPServer [::ffff:192.168.1.6] Sending HTTP event '10.9' with data: {"characteristics":[{"aid":10,"iid":9,"value":false}]} +1ms
Read more comments on GitHub >

github_iconTop Results From Across the Web

Characteristic setValue or updateValue cannot response to ...
I guess that updateValue/setValue haven't connect EventedHTTPServer and Home App will connect that, and updateValue/setValue calling will send ...
Read more >
Unable to send data to characteristic - Stack Overflow
So problem is of course in the app. Whats more interesting is that every characteristic has handles , which have each its own...
Read more >
transfer accelerometer data via bluetooth - Arduino Forum
I have an error message : expression cannot be used as a function … about this line : (void updateValue) dataCharacteristic.writeValue("X: " +...
Read more >
ESP32 BLE Server and Client (Bluetooth Low Energy)
Make a BLE (Bluetooth Low Energy) connection between two ESP32 boards. One ESP32 is going to be the server, and the other ESP32...
Read more >
Managing Firewall Threat Defense with Cloud-Delivered Firewall ...
This chapter describes how to manage reusable objects. Introduction to Objects; The Object Manager; AAA Server; Access List; Address Pools; Application Filters ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found