Open troywweber7 opened 7 years ago
I should note that the blinkstick initially operates perfectly fine for up to 15 minutes or more, but then one of these errors will occur, and from that point forward unless you unplug/re-plug the device and re-instantiate the node.js driver, it will continue to give that error.
Also important to note is that I'm running two blinksticks at once. One will get the LIBUSB_TRANSFER_TIMED_OUT
error, and the other will get the LIBUSB_TRANSFER_STALL
error.
I rearranged my code, and it does seem that even if these errors occur, I can still send a command to clear the leds shortly after... which may be sufficient of a solution. I would still love to know more, though.
The problem seems MOST prevalent when one is trying to run multiple blinksticks at a time on one usb hub using the setColors command to produce animations. It does occur even when only one is running, but far less frequently.
I've further narrowed it down to occurring only when I run the code from the beaglebone. Does not appear to happen on my laptop (with or without a usb hub).
If this helps anyone ... I had to rewrite from :
const leds = [0,1,2,3,4,5,6,7]
const allLeds_old = async (color) => {
const resultArray = leds.map( async index => (
setColorAsync(`#${color}`, { channel, index })
))
await Promise.all(resultArray)
...
to:
const allLeds = async (color) => {
for (var index = 0; index < 8; index++) {
const r = await setColorAsync(`#${color}`, { channel, index })
console.log(r)
}
}
Now everything works without the above messages.
I believe this error is coming from the usb library used by blinkstick, however, I was wondering if anyone else has run into this issue and has suggestions on how to prevent the error from occurring. I am suspicious that it has to do with sending commands too closely (although I'm properly using the callback on the
setColors
command). Has anyone experienced this? Is there any other information I can provide to receive help debugging this?