Closed jflkadsjfslkj closed 7 months ago
I am seeing this also. The .get()
works fine, but getting a path does nothing.
I am seeing this also. The
.get()
works fine, but getting a path does nothing.
In Issue #31 somebody tries integer values for the path. I have not tried it yet.
const bl = require('busylight').get(1);
In looking at the code, it expects an options object as the argument for .get(options)
, like this: { "vendorId": 1240, "productId": 63560 }
. When you enumerate the devices, you'll get an array with all of these values, plus more properties.
My guess is that in the hidFinder.js
file, it is filtering out the (valid) results, whereas when you just specify .get()
, the options argument is undefined
and is then replaced with a simple array of valid supported vendorId/productId values (see the supported.json
file.) So you get a null
assignment instead and then nothing works. But that is just my guess from looking at it and I don't have my devices in front of me to test.
In looking at the code, it expects an options object as the argument for
.get(options)
, like this:{ "vendorId": 1240, "productId": 63560 }
Thanks Joseph, it works great now. The documentation incorrectly refers to a path.
var busylight = require('busylight').get(path);
In issue #6 the author replies to a post with a path
var busylight = require('busylight').get('0001:0005:00');
You are correct with the options object as an argument instead of a string path. Just a path key value pair passed as an argument is enough. This works great:
//var busylight1 = require('busylight').get({"vendorId": 10171, "productId": 15306, "path": '/dev/hidraw2'});
var busylight1 = require('busylight').get({"path": '/dev/hidraw2'});
busylight1.blink(['lime', 'black'], 150);
//var busylight2 = require('busylight').get({"vendorId": 10171, "productId": 15306, "path": '/dev/hidraw3'});
var busylight2 = require('busylight').get({"path": '/dev/hidraw3'});
busylight2.blink(['fuchsia', 'black'], 150);
I have multiple busylights attached Raspberry Pi 4 with Raspberry Pi OS Bullseye and Node 18 and I want address them individually and not just the first one found. Addressing the first found works great. The README code var busylight = require('busylight').get(path); does nothing.
Does anyone have multiple busylights working?
Output from the console log above