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.

How to coalesce multiple requests to a device?

See original GitHub issue

Hi there!

I am writing a platform to control a single phisical device with 48 individuals light bulbs (declared as distinct accessories inside the platform). I started from homebridge-samplePlatform.

Everything work as expected when I turn the lights individually by the Home app. But when I activate a scene with more than 10 lights, it hangs the Home app with “no response” statuses. The plugin sends several individual requests (one for each light) at the same time, flooding the device.

Here’s part of the log:

EventedHTTPServer [::ffff:192.168.11.19] HTTP request: /characteristics +5s
  HAPServer [CC:22:3D:E3:CE:31] HAP Request: PUT /characteristics +0ms
  Accessory [Homebridge Mac] Processing characteristic set: [{"aid":10,"iid":9,"value":false},{"aid":11,"iid":9,"value":false},{"aid":3,"iid":9,"value":1},{"aid":2,"iid":9,"value":1},{"aid":12,"iid":9,"value":1},{"aid":14,"iid":9,"value":1},{"aid":13,"iid":9,"value":1},{"aid":9,"iid":9,"value":1},{"aid":8,"iid":9,"value":false},{"aid":7,"iid":9,"value":1},{"aid":4,"iid":9,"value":1},{"aid":5,"iid":9,"value":false},{"aid":6,"iid":9,"value":1},{"aid":15,"iid":9,"value":1}] +2ms

It shows that homebridge receive just one request from HAPServer but split in several individual requests to the device (not in the log).

I guess it should coalesce all these separated requests into a single request to the device but I have no idea how to do that, I mean, which events to implement. Can anybody help me? Examples will be welcome.

Thanks in advance!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ebaauwcommented, Dec 19, 2017

1, 2: I really don’t know - I’ve only ever used homebridge, never native HAP-NodeJS. I do think the Service and Characteristic stuff is HAP-NodeJS, though.

3: My solution consists of the following:

0reactions
stale[bot]commented, Jun 17, 2018

This issue has been automatically marked as stale because it has not had recent activity, and will be closed if no further activity occurs. If this issue was overlooked, forgotten, or should remain open for any other reason, please reply here to call attention to it and remove the stale status. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Coalescing Connections to Improve Network Privacy and ...
Reaping the full benefits of connection coalescing by experimenting with custom priority schemes for requests within the same connection.
Read more >
COALESCE
You can use the COALESCE expression to evaluate records for multiple values and return the first non-NULL value encountered, in the order specified....
Read more >
how can we use Coalesce in python for multiple data frames ...
You can use pandas. DataFrame. combine. This method does what you need: it builds a dataframe taking elements from two dataframes according to ......
Read more >
Updating records using coalesce
The coalesce option allows you to update existing target table records ... You can coalesce on multiple fields to update an existing record....
Read more >
Chapter 36. Configuring ethtool coalesce settings
Using interrupt coalescing, the system collects network packets and generates a single interrupt for multiple packets. This increases the amount of data sent...
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