benburkhart1 / lighting-node-pro

Interface for Corsair Lighting Node Pro LED controller + Corsair LL fans
MIT License
36 stars 8 forks source link

Made it work in 2020 for the commander pro #6

Open rodrigograca31 opened 4 years ago

rodrigograca31 commented 4 years ago

Steps:

  1. delete package-lock.json and node_modules and run npm install again to install updated dependencies
  2. change the following lines:
diff --git a/lib/commander.js b/lib/commander.js
index e41b6b7..6b2aec3 100644
--- a/lib/commander.js
+++ b/lib/commander.js
@@ -12,7 +12,7 @@ module.exports = class Commander {
         let devices = usb.getDeviceList();

         let foundDevices = devices.filter(d => {
-            return d.deviceDescriptor.idVendor === 0x1b1c && d.deviceDescriptor.idProduct === 0x0c0b;
+            return d.deviceDescriptor.idVendor === 0x1b1c && d.deviceDescriptor.idProduct === 0x0c10;
         });

         let devStrings = foundDevices.map(d => `(Bus ${d.busNumber} Address ${d.deviceAddress})`);
diff --git a/lib/lighting_node_pro.js b/lib/lighting_node_pro.js
index bcd17a2..cdee8f2 100644
--- a/lib/lighting_node_pro.js
+++ b/lib/lighting_node_pro.js
@@ -68,9 +68,10 @@ module.exports = class LightingNodePro {
         }

         console.log("Claiming interface.");
+
         this.iface.claim();

-        this.outEndpoint = this.iface.endpoint(1);
+        this.outEndpoint = this.iface.endpoints[1];
     }
rodrigograca31 commented 4 years ago

@benburkhart1 Should I contribute the changes back or is this a dead project? I loved that it used JS, my favorite language and that allowed me to play with it and make it work.

Im just not sure about that ID..... mine was that one.... I can still contribute the rest of the changes....

rodrigograca31 commented 4 years ago

For those interested here is my fork: https://github.com/rodrigograca31/lighting-node-pro

Also: had to run it using sudo ...

rodrigograca31 commented 4 years ago

Im not sending a PR because Im not sure how that ID thing works. If only my ID was different or what...?

benburkhart1 commented 4 years ago

Hey Rodrigo, your change looks good but you need to make the ID check an OR, not replace what it was before.

On Wed, May 6, 2020 at 10:35 AM Rodrigo Graça notifications@github.com wrote:

Im not sending a PR because Im not sure how that ID thing works. If only my ID was different or what...?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/benburkhart1/lighting-node-pro/issues/6#issuecomment-624787496, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGQXYNGUTMZ63CM25CD4J3RQGNUNANCNFSM4MSKKOBQ .

rodrigograca31 commented 4 years ago

So does that mean both IDs are valid!? Like the company produced devices with both IDs? If thats the case yeah I can change it and send a PR back.

mirsella commented 3 years ago

+1 for deleting package-lock.json, when doing npm install it couldn't compile some usb package binary

benburkhart1 commented 3 years ago

@rodrigograca31 Yes it means both IDs are valid, the old ones do not change, they are programmed into the hardware itself.

benburkhart1 commented 3 years ago

So really the package-lock.json should be committed, I agree it needs to be ran with an updated version of nodejs so proper versions can be selected (it was written against an older version of node)

mirsella commented 3 years ago

@rodrigograca31 return d.deviceDescriptor.idVendor === 0x1b1c && (d.deviceDescriptor.idProduct === 0x0c0b || d.deviceDescriptor.idProduct === 0x0c1a) i've changed this and it work for my controller which isn't 0x0c0b but 0x0c1a, so it work for both normally

rodrigograca31 commented 3 years ago

So it seems theres 3 ids as of now.... 🤔

0x0c0b, 0x0c10, 0x0c1a

Ok, I will send a PR in a few minutes....