{"id":17146555,"url":"https://github.com/mvp/uhidctl","last_synced_at":"2025-08-07T18:51:49.123Z","repository":{"id":84664971,"uuid":"323561817","full_name":"mvp/uhidctl","owner":"mvp","description":"uhidctl - USB HID power relay control","archived":false,"fork":false,"pushed_at":"2023-11-17T22:52:51.000Z","size":15,"stargazers_count":10,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-27T02:43:26.950Z","etag":null,"topics":["control","power","relay","switching","usb"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mvp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-12-22T08:07:59.000Z","updated_at":"2024-05-10T14:39:03.000Z","dependencies_parsed_at":"2023-03-13T00:01:00.305Z","dependency_job_id":null,"html_url":"https://github.com/mvp/uhidctl","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvp%2Fuhidctl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvp%2Fuhidctl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvp%2Fuhidctl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvp%2Fuhidctl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mvp","download_url":"https://codeload.github.com/mvp/uhidctl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248705921,"owners_count":21148618,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["control","power","relay","switching","usb"],"created_at":"2024-10-14T21:08:59.313Z","updated_at":"2025-04-13T11:32:46.199Z","avatar_url":"https://github.com/mvp.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"uhidctl\n=======\n\nuhidctl is utility to control USB HID power relays.\n\nSupported USB relays\n====================\n\nThis utility is designed to work for USB HID power relays which can be found on eBay or Amazon as:\n\n`For Smart Home 5V USB Relay Programmable Computer Control`\n\n\u003cimg src=\"https://bit.ly/3nHaRyD\" width=\"300\" align=\"center\"\u003e\n\nThis utility supports such devices with 1, 2, 4, 8 ports (16 port devices will require patching to work).\nHardware that was tested to work has following characteristics (N is number of ports):\n\n| Property       | Value             |\n|:---------------|:------------------|\n| Manufacturer   | `www.dcttech.com` |\n| Product        | USBRelay{N}       |\n| Vendor ID      | 0x16C0            |\n| Product ID     | 0x05DF            |\n\n\nCompiling\n=========\n\nThis utility was tested to compile and work on Linux (Ubuntu/Debian, Redhat/Fedora/CentOS) and MacOS.\nIt should be possible to compile it for Windows as well - please report if you succeed in doing that.\n\nFirst, you need to install library hidapi:\n\n* Ubuntu: `sudo apt-get install libhidapi-dev`\n* Redhat: `sudo yum install hidapi-devel`\n* MacOS:  `brew install hidapi`\n* Windows: [download hidapi](https://github.com/libusb/hidapi/releases)\n\nTo fetch `uhidctl` source and compile it:\n\n    git clone https://github.com/mvp/uhidctl\n    cd uhidctl\n    make\n\nThis should generate `uhidctl` binary.\n\nYou can install it in your system using:\n\n    sudo make install\n\n\nLinux USB permissions\n=====================\n\nOn Linux, you should configure `udev` USB permissions (otherwise you will have to run it as root using `sudo uhidctl`).\nSimply add following line to file `/etc/udev/rules.d/52-usb.rules`:\n\n    SUBSYSTEM==\"usb\", ATTR{idVendor}==\"16c0\", MODE=\"0666\"\n\nFor your `udev` rule changes to take effect, reboot or run:\n\n    sudo udevadm trigger --attr-match=subsystem=usb\n\n\nUsage\n=====\n\nTo list all compatible relays, run uhidctl without parameters:\n\n    uhidctl\n\nTo control relay state:\n\n    uhidctl -a 1 -p 2\n\nThis means operate on default USB relay, turn power off (`-a 0`, or `-a off`)\non port 2 (`-p 2`). Supported actions are `0`/`1`/`2` (or `off`/`on`/`cycle`).\n`cycle` means turn power off, wait some delay (configurable with `-d`) and turn it back on.\n\nOn Linux, you may have to run it with `sudo`, or to configure `udev` USB permissions.\n\nIf you have more than one USB relay connected, you should choose\nspecific relay to control using option `-l`.\n\n\nCopyright\n=========\n\nCopyright (C) 2017-2020 Vadim Mikhailov\n\nThis file can be distributed under the terms and conditions of the\nGNU General Public License version 2.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvp%2Fuhidctl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmvp%2Fuhidctl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvp%2Fuhidctl/lists"}