sandeepmistry / node-powermate

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

Error: could not send feature report to device #11

Open rsanchez opened 7 years ago

rsanchez commented 7 years ago

I can't get any of the LED-based methods to work. The .on('buttonDown') and .on('buttonUp') methods work fine, though. I'm using a Raspberry PI with Raspbian Jessie. Node v6.9.5. In an effort to isolate this bug from my own app code, I tried to run the manual-test.js script from this repo and got the same errors I get in my app (tried both with and without sudo):

pi@raspberrypi:/srv/app $ sudo node node_modules/node-powermate/manual-test.js 
/srv/app/node_modules/node-powermate/powermate.js:55
  this._hidDevice.sendFeatureReport(featureReport);
                  ^

Error: could not send feature report to device
    at Error (native)
    at PowerMate._sendCommand (/srv/app/node_modules/node-powermate/powermate.js:55:19)
    at PowerMate.setBrightness (/srv/app/node_modules/node-powermate/powermate.js:67:8)
    at Timeout._onTimeout (/srv/app/node_modules/node-powermate/manual-test.js:19:13)
    at ontimeout (timers.js:365:14)
    at tryOnTimeout (timers.js:237:5)
    at Timer.listOnTimeout (timers.js:207:5)

In my own app, all of the LED-methods (setBrightness, setPulseSpeed, setPulseAwake, setPulseAsleep) trigger this same error.

I DO have the proper udev permissions set for the pi account, as evidenced by the fact that the button functionality works without sudo.

Any ideas? Thank you for building & supporting this library.

sandeepmistry commented 7 years ago

@rsanchez maybe you could try to update the node-hid dependency manually to see if it makes a difference?

miv-ableton commented 6 years ago

I have the same issue. Using node-powermate at head of master, and node-hid 0.7.3. Node version is 10.9.0. This is on MacOS.

  this._hidDevice.sendFeatureReport(featureReport);
                  ^

Error: could not send feature report to device
    at PowerMate._sendCommand (/Users/miv/misc/powermatey/node_modules/node-powermate/powermate.js:55:19)
    at PowerMate.setBrightness (/Users/miv/misc/powermatey/node_modules/node-powermate/powermate.js:67:8)
    at PowerMate.onWheelTurn (/Users/miv/misc/powermatey/index.js:24:6)
    at PowerMate.emit (events.js:182:13)
    at PowerMate._parseRead (/Users/miv/misc/powermatey/node_modules/node-powermate/powermate.js:210:12)