todbot / blink1-tool

Command-line tools and C library for blink(1) USB RGB LED
https://blink1.thingm.com/
Other
84 stars 15 forks source link
blink1 hid led rgb usb

Command-line Tools and C library for blink(1) USB RGB LED

Build Status linux Build Status macos Build Status windows

This is an official collection of C/C++ commandline tools for controlling the blink1 USB RGB LED.

This code lives at https://github.com/todbot/blink1-tool.

For pre-built binaries, see the Releases page.

The current tools are:

Type make help for a full list.

Also see in this directory:

Supported platforms

Supported platforms for blink1-tool and blink1-lib:

In general, the blink1-tool builds as a static binary where possible, eliminating the need for shared library dependencies on the target. However, static builds can be problematic for some systems with different libusb implementations, so doing make EXEFLAGS= will generally build a non-static version.

OS-specific Notes

Linux (including Raspberry Pi)

To use blink(1) as a non-root user, udev rules must be installed. On Debian-like systems (Ubuntu, Raspian), these udev rules are installed with:

sudo cp 51-blink1.rules /etc/udev/rules.d/51-blink1.rules
sudo udevadm control --reload
sudo udevadm trigger

Building from source

In general you can do:

git clone https://github.com/todbot/blink1-tool
cd blink1-tool
make

On Linux you will need to install some requirements beforehand.

If your OS is not detected automatically, you can force it with something like:

OS=linux make

To see the supported platforms, please consult the Makefile

Build variants

There are two primary USB libraries that blink1-tool can be built for:

For Linux, there are to HIDAPI_TYPEs you can choose from:

To compile for a particular USBLIB_TYPE or HIDAPI_TYPE, specify them when buildling:

HIDAPI_TYPE=LIBUSB make

OS-specific prerequisites for compiling

If you have the ability to compile programs on your system, you may already have everything you need to compile blink1-tool.

Linux (Debian-flavored, including Raspberry Pi)

FreeBSD

MacOS

Windows

Other OSes

See the blink1-tool/Makefile for details

Using blink1-lib in your C/C++ project

See Makefile for your platform

Docker and blink(1)

[this may be out of date after the repo move]

To build the image from the Dockerfile

Running the container

Note the --privileged tag, docker needs this to access the hosts USB controllers

Docker resources