Closed arturoovf closed 2 years ago
From the stack trace you posted, I can see that the error is coming from the OpenRGB SDK, not his plugin, so I won't be able to fix it so that the SSD will work correctly with this plugin. The most I can do is stop it from crashing the plugin. I encourage you to open an issue on the OpenRGB SDK's repo about this error. I'll post a fix for the crash in a bit.
Thank you for your quick response! I will report it to OpenRGB, thank you for fixing the crash!
I think i have fixed the bug in my (very) recent version (openrgb-sdk@0.5.0-beta.2). Could one of you two try it out? The old one is pretty broken, so if it is working it would be a huge improvement to update the package to the newest openrgb-sdk version.
Ok i have found another another bug with the same error message for openrgb version smaller than 0.7, i have fixed it in a an new beta version: openrgb-sdk@0.5.0-beta.3
Thanks for your work on the SDK, @Mola19!
@arturoovf Since I don't have the SSD, it would be great if you could test that. If everything looks good to you, I'll make a release of the plugin that uses the new SDK version, along with the better error handling. Here's how you can update your NAS's version of SDK:
In the terminal, navigate to the install directory of the plugin.
cd /homebridge/node_modules/homebridge-openrgb
Then, run this (using sudo if necessary) to update the version of the SDK that the plugin uses.
npm install openrgb-sdk@0.5.0-beta.3
Finally, restart the Homebridge service and test things out.
I followed instructions and everything is working fine as expected (no errors, s40g control works).
Thank you so much both of you for your work on this, that was a very quick response !
Thank you for testing. I am making a few test and if successful i will release 0.5.0. My suggestion for you would be to require 0.5 or higher, since i have found some fundamental flaws in my earlier implementation.
About how long until you plan to release 0.5.0? If it's pretty soon, I'll just hold off a bit on making a release so that I can go ahead and include 0.5.0 in it.
I hope 1 or 2 days, maybe a week.
Also can I see this issue as closed? I would like to close the one on my repo, but I will use this issue to tell you when I have pushed the new version.
I've posted a release with the latest SDK version, but I'm now having my own issues with Homebridge. It could be unrelated, but I'm going to leave this issue open until I have a chance to investigate.
@Mola19 I've had to rollback the SDK version. Something has changed between versions 0.4.3 and 0.5.0 with the connection logic that is causing it to crash the Homebridge process when attempting to connect to a device that is offline.
Previously, I could handle this by timing out the call to the connect method. Now, the call to connect for offline devices succeeds, and the call to getControllerCount crashes the process with the error: Error: getaddrinfo ENOTFOUND dallas-pc.local at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:67:26)
Here is the relevant code:
const timeout = async () => await new Promise((resolve, reject) => setTimeout(() => reject(), SERVER_CONNECTION_TIMEOUT));
try {
await Promise.race([client.connect(), timeout()]);
} catch (err) {
this.log.warn(`Unable to connect to OpenRGB SDK server at ${serverHost}:${serverPort}`);
return 1;
}
let controllerCount = 0;
try {
controllerCount = await client.getControllerCount(); // *** Crashes here ***
} catch (err) {
this.log.warn(`Unable to enumerate RGB devices on OpenRGB SDK server at ${serverHost}:${serverPort}`);
}
Give me some time. This seems to need a deeper rework of the error handling
Okay i think i have a fix. Could you copy client.js from my repo to your /node_modules/openrgb-sdk/src/ folder
That looks to be working correctly. Nice work. You can go ahead and release that patch, and I'll bump my plugin to use 0.5.1.
done
Great! @arturoovf if you could update the plugin to version 1.2.3 and confirm everything is working for you, I'll close out this issue.
Looks good!! Thank you both so much!
And thank you for taking the time to report the issue you had.
Today OpenRGB container I use got updated and among new things this version have (03 dic build) adds support for an ssd I have (s40g), but it seems that the updated version or the addition of the new device is crashing the homebridge-openrgb plug-in.
Logs:
Plugin Config:
Environment: Unraid 6.10rc2, OpenRGB docker container