Skip to content

Linux non root access

Ricardo De Peña edited this page Dec 20, 2016 · 2 revisions

If you are in Linux and your are using node-hid by passing the "forceNodeHid": true option, you will notice that you will not be able to connect to the controller unless you are root. This can be mitigated by providing a udev rule file for that controller.

I followed node-hid's docs and made rule files for the Dual Shock 3 and DualShock 4 controllers that have been tested in Ubuntu and Antergos:

DualShock 3

SUBSYSTEM=="input", GROUP="input", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0268", MODE:="666", GROUP="plugdev"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0664", GROUP="plugdev"

DualShock 4

SUBSYSTEM=="input", GROUP="input", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="05c4", MODE:="666", GROUP="plugdev"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0664", GROUP="plugdev"

Step by step

  • Create either 61-dualshock3.rules or 41-dualshock4.rules in /etc/udev/rules.d/
  • Reload the rules sudo udevadm control --reload-rules
  • Now disconnect/connect the controller
Clone this wiki locally