A node-hid (USB HID device access library) wrapper for Node-RED
npm install @gdziuba/node-red-usbhidpowershell
git clone https://github.com/gdziuba/node-red-contrib-usbhid.git
`
`powershell
cd node-red-contrib-usbhid
npm install
`
How to Install on Linux
$3
Install libraries for Linux
`sudo apt install libusb-1.0-0 libusb-1.0-0-dev libudev-dev`
The Pd-extended [hid] object allows you to access Human Interface Devices such as mice, keyboards, and joysticks. However, in most Linux distributions, these devices are setup to where they cannot be read/written directly by Pd unless you run it as root.
Running a non-system process as root is considered a security risk, so an alternative is to change the permissions of the input devices so that pd can read/write them.
`
sudo mkdir -p /etc/udev/rules.d
sudo nano /etc/udev/rules.d/85-pure-data.rules
`
Now add the following rules to /etc/udev/rules.d/85-pure-data.rules making sure to updated KERNEL to your hidraw\* device:
`
SUBSYSTEM=="input", GROUP="input", MODE="0777"
SUBSYSTEM=="usb", MODE:="777", GROUP="input"
KERNEL=="hidraw0", MODE="0777", GROUP="input"
`
Make sure no existing rules compete. I found existing file on Raspberry pi that needed updating. I added above code instead of creating a new file
Then create an "input" group and add yourself to it:
`
sudo groupadd -f input
sudo gpasswd -a $USER input
`
Reloads rules:
`
udevadm control --reload-rules
``