Skip to content

Instantly share code, notes, and snippets.

@sudhackar
Created January 23, 2024 14:33
Show Gist options
  • Save sudhackar/13727248dcfae0098d78187751f09240 to your computer and use it in GitHub Desktop.
Save sudhackar/13727248dcfae0098d78187751f09240 to your computer and use it in GitHub Desktop.
DeepCool CH510 Digital - usb write with hid
SUBSYSTEM=="input", GROUP="input", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="34d3", ATTRS{idProduct}=="1100", MODE="666", GROUP="plugdev"
KERNEL=="hidraw*", ATTRS{idVendor}=="34d3", ATTRS{idProduct}=="1100", MODE="0666", GROUP="plugdev"
import hid
vid = 0x34d3
pid = 0x1100
# to read/write as a normal user - be in the plugdev rules
# sudo udevadm control --reload-rules
# sudo udevadm trigger
with hid.Device(vid, pid) as h:
msg = "HLXDATA({},{},0,0,{})\r\n".format(100, 69, "C")
h.write(msg.encode("utf-8"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment