Created
January 23, 2024 14:33
-
-
Save sudhackar/13727248dcfae0098d78187751f09240 to your computer and use it in GitHub Desktop.
DeepCool CH510 Digital - usb write with hid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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