sandeepmistry / node-powermate

A Node.js library for the Griffin PowerMate
41 stars 25 forks source link

Cannot open device #3

Closed carlbennettnz closed 10 years ago

carlbennettnz commented 10 years ago

When I run new PowerMate() I get the following error from line 36 of powermate.js:

cannot open device with path USB_077d_0410_14530000`

Line 36:

this._hidDevice = new HID.HID(powerMateHIDdevice.path);

console.logging powerMateHIDdevice gives be the following:

{ vendorId: 1917,
  productId: 1040,
  path: 'USB_077d_0410_14530000',
  serialNumber: '',
  manufacturer: 'Griffin Technology, Inc.',
  product: 'Griffin PowerMate',
  release: 1024,
  interface: -1 }

Any idea what’s going wrong?

sandeepmistry commented 10 years ago

@carlbennettnz what OS are you running it on?

carlbennettnz commented 10 years ago

OS X. I tired again however and this time it worked. I had the Griffin PowerMate app open the first time I tried, which was causing the problem. It seems obvious now, but it might be worth mentioning that in the readme.

mattwelch commented 10 years ago

Having the same issue, this time on Raspbian (Debian) on a Raspberry Pi. Here's the failure, along with a console.log:

{ vendorId: 1917,
  productId: 1040,
  path: '0001:0004:00',
  release: 1024,
  interface: 0 }

/home/pi/p/node_modules/node-powermate/powermate.js:34
  this._hidDevice = new HID.HID(powerMateHIDdevice.path);
                    ^
cannot open device with path 0001:0004:00

Any thoughts?

sandeepmistry commented 10 years ago

@mattwelch could any other programs be using it? Have you tried running as root?

If those don't work, we might be to ask the node-hid team.

mattwelch commented 10 years ago

Good call on the root. I tried that, and it worked great. Any idea of what my options are if I don't want to run as root? I think I need to put my and the hid in the same group.

sandeepmistry commented 10 years ago

You could try to chown/chmod the device if it shows up in /dev/...

I'm not sure how USB HID devices work in Linux, but I can take a closer look node-hid if you still need help.

mattwelch commented 10 years ago

For the record, on my platform (Raspbian/Debian) the problem was permissions, which were solved with a udev rule.

sandeepmistry commented 10 years ago

@mattwelch @carlbennettnz can we close this issue or is there something that needs to be added to the read me?

mattwelch commented 10 years ago

I'm fine closing it. Mine is a specific case (Raspbian, though likely the same for Debian/Ubuntu), for which I'd be glad to write up directions to be included.

sandeepmistry commented 10 years ago

@mattwelch it would be great if you could share the udev rule instructions!