Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Error: Cannot write to HID device" #5

Open
Hixie opened this issue Apr 26, 2016 · 3 comments
Open

"Error: Cannot write to HID device" #5

Hixie opened this issue Apr 26, 2016 · 3 comments

Comments

@Hixie
Copy link

Hixie commented Apr 26, 2016

I keep getting the following error during program execution while doing nothing but subscribing to and reading values every few seconds:

events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: Cannot write to HID device
    at Error (native)
    at sendPacket (/home/ianh/node_modules/green-bean/node_modules/gea-adapter-usb/index.js:52:17)
    at Adapter.send (/home/ianh/node_modules/green-bean/node_modules/gea-adapter-usb/index.js:150:9)
    at Adapter.bus.send (/home/ianh/node_modules/green-bean/node_modules/gea-sdk/src/command.js:46:9)
    at null._repeat (/home/ianh/node_modules/green-bean/node_modules/gea-sdk/src/appliance.js:464:13)
    at wrapper [as _onTimeout] (timers.js:275:11)
    at Timer.listOnTimeout (timers.js:92:15)

It's intermittent, I can't tell what's triggering it (if anything).

This is with a GE GDF570SGFWW.

@Hixie
Copy link
Author

Hixie commented Apr 29, 2016

FWIW this only seems to happen if the app is idle for a while. If I just keep probing the doorCount, for example, I don't see a crash.

@Hixie
Copy link
Author

Hixie commented Apr 29, 2016

By "idle" I apparently mean "probing less often than once every 2 seconds". I tried once every 5 seconds and saw the crash.

@Hixie
Copy link
Author

Hixie commented Apr 29, 2016

Actually it seems even probing every 2 seconds, it eventually fails with this error.

Here's a sample app that shows the problem:

require('events').EventEmitter.prototype._maxListeners = 0;
const greenBean = require("green-bean");
greenBean.connect("dishwasher", function(dishwasher) { });

Run that for a few seconds and you get the stack above.

node.js seems to just hang after the error is shown. Timers don't keep going, but it also doesn't return to the command line. Not sure what's up with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant