porsager / busylight

node library for busylight
49 stars 17 forks source link

Device found but no lights.. #6

Closed Kerwood closed 8 years ago

Kerwood commented 8 years ago

Hi again :)..

The Kuando Busy light device is found, but I cant get it to light up.

If i use this code, i can see the device.

var busylights = require('busylight').devices(true);
console.log(busylights)

Outputs:

[ { vendorId: 1240,
    productId: 63560,
    path: '0001:0005:00',
    release: 2,
    interface: 0 } ]

I have tried the following.

var busylight = require('busylight').get('0001:0005:00');
busylight.ring().pulse();
var busylight = require('busylight').get();
busylight.ring().pulse();

But nothing happens... What could be wrong?

Kerwood commented 8 years ago

Update.. If I run the nodejs app with sudo, it works.. Why ?

porsager commented 8 years ago

Hi. You need root permissions to read / write from USB HID devices unless you set up UDEV rules. Something like: SUBSYSTEM=="input", ATTRS{idVendor}=="1240", ATTRS{idProduct}=="63560", MODE="0666"

Kerwood commented 8 years ago

Hmm.. The device permissions is 777 and my user is the owner.. Still it will not light up.

crwxrwxrwx  1 kerwood kerwood 180, 0 Jul 30 13:37 hiddev0
porsager commented 8 years ago

Sorry I missed your reply.

It seems weird that it doesn't work then, but I don't think it's related to this package, so I'm going to close this issue.

If you figure it out I'd love to know though ;)

iilei commented 7 years ago

@Kerwood I came across the same issue. Did you sort it out after all?

edit: I managed it with

echo "SUBSYSTEM==\"usb\", ATTRS{idVendor}==\"$IDVENDOR\", ATTRS{idProduct}==\"$IDPRODUCT\", GROUP=\"plugdev\", OWNER=\"$(whoami)\", MODE=\"0666\"" | sudo tee -a /etc/udev/rules.d/99-hidraw-permissions.rules

where IDVENDOR and IDPRODUCT need to be given. That did the trick for me :)