sandeepmistry / node-powermate

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

Using any of the commands raises featureReport error #6

Closed alcor closed 9 years ago

alcor commented 9 years ago

I've got code that works flawlessly when run on a mac, but fails when run on an Intel edison (3.10.17-poky-edison+)

commands like: powermate.setBrightness(0, function() {});

yield:

*/home/root/node_modules/node-powermate/powermate.js:55 this._hidDevice.sendFeatureReport(featureReport);

could not send feature report to device*

Any suggestions?

This is an awesome library, btw :) I'm using it to make a bunch of wireless music control knobs for my house.

14 - 1

N

sandeepmistry commented 9 years ago

@alcor cool project!

Does lsusb work on your edison? I get the following error:

root@edison-arduino-breakout:~# lsusb
unable to initialize libusb: -99

Which version are you running? I'm running:

root@edison-arduino-breakout:~# configure_edison --version
120

on my Arduino breakout.

@rexstjohn any ideas on this?

sandeepmistry commented 9 years ago

@alcor I got this working!

I'm running the following kernel:

uname -a
Linux edison-arduino-breakout 3.10.17-poky-edison+ #1 SMP PREEMPT Fri Jan 30 14:16:35 CET 2015 i686 GNU/Linux

Had to switch the SW1 switch on my Edison Arduino breakout towards the USB A port to get USB host mode working (cc: @rexstjohn).

root@edison-arduino-breakout:~/node# node
> var PowerMate = require('node-powermate');
undefined
> var powermate = new PowerMate();
undefined
> powermate.setBrightness(0, function() {});
undefined
> powermate.setBrightness(255, function() {});
undefined
alcor commented 9 years ago

I'm using a mini breakout board, but the usb host stuff looks to be all set up (all other commands work great). Here is the output from the various commands:

root@edison-bgv:~/automaton# lsusb
Bus 001 Device 002: ID 077d:0410 Griffin Technology PowerMate
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

root@edison-bgv:~/automaton# node
> var PowerMate = require('node-powermate');
undefined
> var powermate = new PowerMate();
undefined
> powermate.setBrightness(0, function() {});
could not send feature report to device
> powermate.setBrightness(255, function() {});
could not send feature report to device
> 

root@edison-bgv:~/automaton# uname -a
Linux edison-bgv 3.10.17-poky-edison+ #1 SMP PREEMPT Tue Oct 14 15:19:49 CEST 2014 i686 GNU/Linux
sandeepmistry commented 9 years ago

@alcor i'm guessing it's either a firmware or power issue.

Can you please upgrade to version 120, I used these instructions: https://learn.sparkfun.com/tutorials/edison-getting-started-guide#updating-the-firmware-image

What are you using to power it?

alcor commented 9 years ago

Updated. Ran into the same problem... BUT I also went and bought a new powermate and it works!

It appears only to happen for the old version of the powermate. (one I bought about 10 years ago). I swapped it with the one on my iMac, and it caused the same problem there. Maybe the protocols were slightly different on that old variant?

Is that something you'd care about? I'm going to use the old one on my work computer, so this will no longer block me. Thank you :)

sandeepmistry commented 9 years ago

@alcor good find!

Here's what the OS X "System Information" app shows for my Powermate:

Griffin PowerMate:

  Product ID:   0x0410
  Vendor ID:    0x077d
  Version:  4.00
  Speed:    Up to 1.5 Mb/sec
  Manufacturer: Griffin Technology, Inc.
  Location ID:  0xfa130000 / 6
  Current Available (mA):   500
  Current Required (mA):    100

I think I also purchased about 10 years ago.

I have a PDF for protocol version 1.2 and 2.0, I can email you them if you want. The brightness command looks the same.

If you have time and are interested in supporting the older model a pull request would be great.

alcor commented 9 years ago

Interesting that the version is so different! Please send over the protocol if you could? I may take a crack at it (I may also just buy more new ones :)

  Product ID:   0x0410
  Vendor ID:    0x077d
  Version:  1.09
  Speed:    Up to 1.5 Mb/sec
  Manufacturer: Griffin Technology, Inc.
  Location ID:  0x14500000 / 9
  Current Available (mA):   500
  Current Required (mA):    100
sandeepmistry commented 9 years ago

What's your email address? Or you can email me, mine is on my Github profile page ...