{"id":13577316,"url":"https://github.com/todbot/blink1-tool","last_synced_at":"2025-08-10T23:40:53.619Z","repository":{"id":33266981,"uuid":"128492754","full_name":"todbot/blink1-tool","owner":"todbot","description":"Command-line tools and C library for blink(1) USB RGB LED","archived":false,"fork":false,"pushed_at":"2025-03-04T02:21:36.000Z","size":82049,"stargazers_count":87,"open_issues_count":12,"forks_count":17,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-31T07:07:19.137Z","etag":null,"topics":["blink1","hid","led","rgb","usb"],"latest_commit_sha":null,"homepage":"https://blink1.thingm.com/","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/todbot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-07T03:27:42.000Z","updated_at":"2025-03-04T02:21:40.000Z","dependencies_parsed_at":"2024-01-16T20:24:13.201Z","dependency_job_id":"4fafc219-1029-4289-ba89-d0a194e3cf18","html_url":"https://github.com/todbot/blink1-tool","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/todbot%2Fblink1-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/todbot%2Fblink1-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/todbot%2Fblink1-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/todbot%2Fblink1-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/todbot","download_url":"https://codeload.github.com/todbot/blink1-tool/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247622985,"owners_count":20968575,"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":["blink1","hid","led","rgb","usb"],"created_at":"2024-08-01T15:01:20.425Z","updated_at":"2025-04-07T09:18:25.610Z","avatar_url":"https://github.com/todbot.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# Command-line Tools and C library for blink(1) USB RGB LED\n\n[![Build Status linux](https://github.com/todbot/blink1-tool/workflows/linux/badge.svg)](https://github.com/todbot/blink1-tool/actions?query=workflow%3Alinux)\n[![Build Status macos](https://github.com/todbot/blink1-tool/workflows/macos/badge.svg)](https://github.com/todbot/blink1-tool/actions?query=workflow%3Amacos)\n[![Build Status windows](https://github.com/todbot/blink1-tool/workflows/windows/badge.svg)](https://github.com/todbot/blink1-tool/actions?query=workflow%3Awindows)\n\n\nThis is an official collection of C/C++ commandline tools for controlling\nthe [blink1 USB RGB LED](https://blink1.thingm.com/).\n\nThis code lives at https://github.com/todbot/blink1-tool.\n\nFor pre-built binaries, see the [Releases page](https://github.com/todbot/blink1-tool/releases).\n\nThe current tools are:\n\n- `blink1-tool` -- command-line tool for controlling blink(1)\n- `blink1control-tool` -- blink1-tool for use with Blink1Control (uses HTTP REST API)\n- `blink1-tiny-server` -- ([README](server/README.md)) Simple HTTP API server to control blink1, uses blink1-lib\n- `blink1-lib` -- C library for controlling blink(1)\n- `blink1-mini-tool` -- commandline tool using libusb-0.1 and minimal deps\n- `blink1raw` -- small example commandline tool using Linux hidraw\n\nType `make help` for a full list.\n\nAlso see in this directory:\n- `scripts` -- examples shell scripts using blink1-tool\n\n## Supported platforms\n\nSupported platforms for `blink1-tool` and `blink1-lib`:\n\n- Mac OS X 10.6.8, 10.7+\n- Windows XP+ (built with MinGW \u0026 MSYS)\n- Linux (most all, primary development on Ubuntu)\n- FreeBSD 8.2+\n- Raspberry Pi (Raspian)\n- BeagleBone (Ubuntu)\n- OpenWRT / DD-WRT\n- ... just about anything else with Gnu Make \u0026 a C-compiler\n\nIn general, the `blink1-tool` builds as a static binary where possible,\neliminating the need for shared library dependencies on the target.\nHowever, static builds can be problematic for some systems with different\nlibusb implementations, so doing `make EXEFLAGS=` will generally build a non-static version.\n\n## OS-specific Notes\n\n### Linux (including Raspberry Pi)\n\nTo use blink(1) as a non-root user, udev rules must be installed.\nOn Debian-like systems (Ubuntu, Raspian), these udev rules are installed with:\n\n```\nsudo cp 51-blink1.rules /etc/udev/rules.d/51-blink1.rules\nsudo udevadm control --reload\nsudo udevadm trigger\n```\n\n\n### Building from source\n\nIn general you can do:\n\n```\ngit clone https://github.com/todbot/blink1-tool\ncd blink1-tool\nmake\n```\n\nOn Linux you will need to install [some requirements](#linux-debian-flavored-including-raspberry-pi) beforehand.\n\nIf your OS is not detected automatically, you can force it with something like:\n```\nOS=linux make\n```\n\nTo see the supported platforms, please consult the [Makefile](./Makefile)\n\n\n### Build variants\n\nThere are two primary USB libraries that `blink1-tool` can be built for:\n- `USBLIB_TYPE=HIDAPI` -- Uses the feature-rich cross-platform `hidapi` library (default)\n- `USBLIB_TYPE=HIDDATA` -- Uses a simple, cross-platform `hiddata` library (included)\n\nFor Linux, there are to HIDAPI_TYPEs you can choose from:\n- `HIDAPI_TYPE=HIDRAW` -- Uses standard `hidraw` kernel API for HID devices  (default)\n- `HIDAPI_TYPE=LIBUSB` -- Uses lower-level `libusb` commands (good for older Linuxes)\n\nTo compile for a particular `USBLIB_TYPE` or `HIDAPI_TYPE`, specify them when buildling:\n\n```\nHIDAPI_TYPE=LIBUSB make\n```\n\n## OS-specific prerequisites for compiling\n\nIf you have the ability to compile programs on your system,\nyou may already have everything you need to compile `blink1-tool`.\n\n### Linux (Debian-flavored, including Raspberry Pi)\n\n- In a terminal, install pre-reqs and build:\n- `sudo apt-get install libudev-dev pkg-config build-essential`\n- `sudo apt-get install libusb-1.0-0-dev`  (optional, only for libusb variant)\n- `cd blink1-tool`\n- `make`\n- `HIDAPI_TYPE=libusb make` (if you instead you want libusb version)\n\n### FreeBSD\n\n- Install pre-reqs and build:\n- `sudo pkg install gmake gcc git libiconv`\n- `cd blink1-tool`\n- `gmake`\n- `sudo ./blink1-tool --red --flash 3`\n- If you'd like `devd` support, see the `devd-51-blink1.conf` file. \n\n### MacOS\n\n- Xcode\n- In Terminal, setup Xcode and build:\n- `xcode-select --install`\n- `cd blink1-tool`\n- `make`\n\n### Windows\n\n- Install Visual Studio 2017 or 2019\n- Install MSYS2: https://www.msys2.org/\n- In MSYS2 bash shell:\n- `pacman -S base-devel make git zip unzip mingw-w64-x86_64-gcc` \n- `export PATH=${PATH}:/c/msys64/mingw64/bin`\n- `export PATH=${PATH}:\"/c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin\"`\n- `export PATH=${PATH}:'/c/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64'\"`\n- `make`\n\n### Other OSes\n\nSee the blink1-tool/Makefile for details\n\n\n## Using blink1-lib in your C/C++ project\n\nSee Makefile for your platform\n\n\n## Docker and blink(1)\n[this may be out of date after the repo move]\n\nTo build the image from the `Dockerfile`\n\n- `docker build -t robtec/blink1 .`\n\nRunning the container\n\n- `docker run -d --privileged robtec/blink1`\n\nNote the `--privileged` tag, docker needs this to access the hosts USB controllers\n\nDocker resources\n- [Install Guide](https://docs.docker.com/installation/)\n- [Run Command](https://docs.docker.com/engine/reference/run/)\n- [Ubuntu Dockerfile](https://github.com/todbot/blink1-tool/blob/master/Dockerfile-ubuntu)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftodbot%2Fblink1-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftodbot%2Fblink1-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftodbot%2Fblink1-tool/lists"}