FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Can read but not write to device on Linux · Issue #515 · node-hid/node-hid · GitHub

Can read but not write to device on Linux #515

Description

Hello,

I have a Teensy 4.0 connected to my Linux box running PopOS.

First I programmed the Teensy to continuously write to the USB port, and I can read this fine using the following code:

var HID = require('node-hid');
var devices = HID.devices();

var device = new HID.HID('/dev/hidraw5');

device.on("data", function(data) {
  console.log(data.toString())
});

But then I try writing to the Teensy using the following code and I can't get it to work:

var HID = require('node-hid');
var devices = HID.devices();

var device = new HID.HID('/dev/hidraw5');

setInterval(() => {
  device.write([0x00, 0x01, 0x01, 0x05, 0xff, 0xff]);
  console.log("Every second");
}, 1000);

The problem doesn't appear to be my code on the Teensy, because I can write to it fine using either the serial monitor in the Arduino application, or another serial monitor. I just can't write to the Teensy using node-hid.

Any suggestions?
Thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL