benburkhart1 / lighting-node-pro

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

Need runtime prerequisites #3

Open etrigan63 opened 5 years ago

etrigan63 commented 5 years ago

I cloned the project and attempted to run it from my Arcolinux system and got the following error:

node index.js --fan-count=3 --animation Tracer -p "colors=blue,black"
internal/modules/cjs/loader.js:670
    throw err;
    ^

Error: Cannot find module 'command-line-args'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:668:15)
    at Function.Module._load (internal/modules/cjs/loader.js:591:27)
    at Module.require (internal/modules/cjs/loader.js:723:19)
    at require (internal/modules/cjs/helpers.js:14:16)
    at Object.<anonymous> (/home/guru/Git/lighting-node-pro/index.js:3:21)
    at Module._compile (internal/modules/cjs/loader.js:816:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
    at Module.load (internal/modules/cjs/loader.js:685:32)
    at Function.Module._load (internal/modules/cjs/loader.js:620:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:877:12) 

I am obviously missing some component to enable it to run. What it is, I do not know.

benburkhart1 commented 5 years ago

hey @etrigan63 , you need to type 'npm install' before attempting to run. the dependency you're lacking is 'command-line-args' but it's in the package.json, so you must have not run 'npm install'. Let me know if there's any other issues.

etrigan63 commented 5 years ago

OK, that worked. Next questions: How does one modify the udev rules to allow the user to run the app without sudo? How do you save the settings so that I don't have to leave a terminal running all of the time? When I quit the fans turn off.

benburkhart1 commented 5 years ago

@etrigan63 Try this as a udev rule, I placed mine in /etc/udev/rules.d/85-corsair.rules, but I am using ubuntu and I'm not sure if there's any differences in what you're using:

SUBSYSTEM=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="0c0b", MODE="0666"

As far as "save the settings" goes. This is not possible with these fans, you either are constantly pushing a color or animation, or it's off or in the default "rainbow wave" state. It should be very low CPU, but the process would have to remain running to keep your color/animation scheme. It's the same way in Windows if you sniffed the USB traffic, you'd be constantly seeing it sending. As a workaround, you could always toss it in systemd/sysv init to start at boot.

Hope you find what you're looking for.

etrigan63 commented 5 years ago

Thanks again. The udev rule worked and I have added the node command to my autostart.sh (I use Awesome WM on Arcolinux (Arch)) and hopefully it should launch at next boot. I am still running it out of git folders, perhaps you can suggest a more stable way to deploy it. This is my first experience with node.js and I am not familiar with it.

benburkhart1 commented 5 years ago

I wrote it more as a proof-of-concept more than any sort of serious system service, and because I couldn't stand that it could not be controlled or turned off (from rainbow wave) in Linux, so I think this is as good as it's going to get without someone else contributing some legwork.

I think it'd be great if someone worked through the various models of controllers/fans and unified a display/animation system for it, but I doubt I'd be able to carry that torch.

I'm glad it worked for you though!