Closed moozer closed 6 years ago
Could you try to see if your busylight is listed when doing require('node-hid').devices() ?
Doing require('node-hid').devices()
gives me an error related to node-hid not being installed - and since there are issues with npm not being in debian 9, I left it at that for now.
I have however solved my issue, it two problems combined. Permission and poor understanding of javascript :-)
I suspected the latter which is why I requested a simple test program. Brushing up on my javascript, I made a test program. It is included below for reference.
The other part is a permissions issue
# ls -al /dev/hidraw0
crw------- 1 root root 248, 0 Dec 14 23:08 /dev/hidraw0
which I read as not being allowed to talk directly with the device. I'm using Debian and my guess is that I must tweak a udev rule somewhere. When I log in as root, It works.
--
# cat test.js
var busylight = require('busylight')
console.log( busylight.devices( true ) )
d = busylight.get()
d.debug = true
d.on('disconnected', function(err) {
console.log(err);
});
d.on('connected', function() {
console.log( "connected" )
d.ring('Funky').blink(['red', 'yellow', 'blue', 'green'], 150);
});
Great you figured it out, and thanks a lot for reporting back ;)
I seeing the "not responding" issue like in #9.
Could you supply a simple test.js, that works for you?
The device:
My test program
the output below