blink1 path empty when connected to some hubs
See original GitHub issueI recently upgraded to 0.5.2 and my blink1 is no longer found on the HUB its plugged into. It works when plugged directly into the computer as the path for the device is found. blink1control2 finds, and is able to control the blink1 just fine on said HUB. I can provide any other technical details if asked. Thanks 😃
`➜ src node test-blink1.js blink(1) devices found: [ { vendorId: 10168, productId: 493, path: ‘’, serialNumber: ‘200065C4’, manufacturer: ‘ThingM’, product: ‘blink(1) mk2’, release: 2, interface: -1 } ]
/Users/dan/work/slack-notifier/node_modules/node-hid/nodehid.js:28 this._raw = new (Function.prototype.bind.apply(binding.HID, ^
Error: cannot open device with vendor id 0x27b8 and product id 0x1ed at Error (native) at new HID (/Users/dan/work/slack-notifier/node_modules/node-hid/nodehid.js:28:14) at Object.<anonymous> (/Users/dan/work/slack-notifier/node_modules/node-hid/src/test-blink1.js:21:17) at Module._compile (module.js:570:32) at Object.Module._extensions…js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.runMain (module.js:604:10) at run (bootstrap_node.js:394:7) `
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (4 by maintainers)
Looks like you have 4 hubs in between the host and the blink(1) (Some are built-in or if you have a >4 port USB hub, that can actually count as two). This is close to the maximum of 5 hubs. (for @todbot: also see this by pluggable).
From looking at commit https://github.com/signal11/hidapi/commit/59a076705b1bc5316fb4513fc28033b662a23675, hidapi is using the OS X standard IORegistryEntryGetPath() and passing the recommended
io_string_t
type for path. Andio_string_t
is defined as 512 characters long.On my system, when I daisychain hubs, I can only get up to 3 external hubs (If I try any more I get “AppleUSBHostPort::setPortLocation: Hub count exceeded” errors in dmesg) and the resulting path is 460 characters long. I’m not sure of the naming of the elements in
IORegistryEntryGetPath
but it seems like it could get longer than 512. So this almost seems like it could be a bug in Mac OS X.As a workaround, I would say reduce the number of USB hubs used with hidapi / node-hid projects. This isn’t a really node-hid issue but rather a hidapi one. I think we should open up an issue there. I’m still doing some tests to see if I can characterize it a bit more before I open up a hidapi issue.
I’ll leave this issue open for now as a reminder to me.
Indeed. It would appear that one of the hubs I have has two built into it.