Embrava Blynclight Plus with Fedora
Table of Contents
I bought a Blynclight PLUS busylight from Embrava, these are my notes on using it under Fedora Linux.
As always, this gadget needs to work under Linux, specifically Fedora 33. While the vendor only offered software for Windows and MacOS, I found many projects on github, so I went ahead and placed an order, hoping for the best.
udev rule
No matter which software I use to talk to this light, I want any user to be able to control the Blynclight.
My currently used /etc/udev/rules.d/99-blynclight-plus.rules
follows.
You might want to be less strict and set mode 666 to all devices of the vendor (by dropping the , ATTRS{idProduct}=="0010"
).
Or you might want to be more strict on a machine with multiple users where you want to avoid one user trolling another one.
For me, on a single user workstation, 666 for the make and model is tight enough access control for a busylight.
# BlyncLight Plus, BLYNCUSB40S
SUBSYSTEM=="hidraw*", ATTRS{idVendor}=="2c0d", ATTRS{idProduct}=="0010", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2c0d", ATTRS{idProduct}=="0010", MODE="0666"
Using github.com/JnyJny/busylight on F33
Notes
While my first steps with this busylight were with another software (see the section Deprecated, below), I am currently using JnyJny/busylight and am extremely happy with it (even though I have not yet set up any automation).
A light on my desk is only useful if whoever walks in knows what the colours mean. So I printed the vendor supplied Awareness Sign.
But, I have since then used LaTeX to make myself a tetrahedron (aka triangular pyramid) instead, simply because I can™ ;-)
\documentclass[a4paper]{article}
\usepackage{tikz}
\usetikzlibrary{folding}
\begin{document}
\begin{tikzpicture}
\pic [
folding line length=70mm,
transform shape,
face 1={\node[fill=red] {\Large do not disturb};},
face 2={\node[fill=green] {\Large available};},
face 3={\node[fill=blue] {\Large be right back};},
face 4={\node{made with \LaTeX};}
]
{tetrahedron folding};
\end{tikzpicture}
\end{document}
Here’s a rendered PDF of the above LaTeX code.
Installation
This section is about my currently preferred setup.
Since this F33 install is an upgrade of my F32, I already had python3-hidapi
installed from earlier testing.
AFAICT, you do not need the other two …hidapi… packages, but I did not try without them.
Definitely install python3-hidapi with sudo dnf install python3-hidapi
.
[root@workstation ~]# rpm -qa *hidapi*
hidapi-devel-0.9.0-4.fc33.x86_64
python3-hidapi-0.9.0.post2-2.fc33.x86_64
hidapi-0.9.0-4.fc33.x86_64
Since I wanted to also try the webapi, I installed as follows. Check the project page for choosing your install options.
Install the package, incl the webapi, via pip but not system wide;
pcfe@workstation ~ $ python3 -m pip install --user busylight-for-humans[webapi]
My light is recognised just fine.
pcfe@workstation ~ $ busylight list
ID: Device Name
0: Blynclight Plus
These are the udev rules suggested by busylight, note that it supports multiple busylighht vendors.
pcfe@workstation ~ $ busylight udev-rules
KERNEL=="hidraw*", ATTRS{idVendor}=="20a0", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="20a0", MODE="0666"
KERNEL=="hidraw*", ATTRS{idVendor}=="2c0d", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2c0d", MODE="0666"
KERNEL=="hidraw*", ATTRS{idVendor}=="03e5", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="03e5", MODE="0666"
KERNEL=="hidraw*", ATTRS{idVendor}=="27b8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="27b8", MODE="0666"
KERNEL=="hidraw*", ATTRS{idVendor}=="27bb", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="27bb", MODE="0666"
KERNEL=="hidraw*", ATTRS{idVendor}=="04d8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", MODE="0666"
But since I only own one model from one vendor, I kept using the udev rule I had created previously;
[root@workstation ~]# cat /etc/udev/rules.d/99-blynclight-plus.rules
# BlyncLight Plus, BLYNCUSB40S
SUBSYSTEM=="hidraw*", ATTRS{idVendor}=="2c0d", ATTRS{idProduct}=="0010", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2c0d", ATTRS{idProduct}=="0010", MODE="0666"
Remember to udevadm control --reload
if you make changes to the file.
Usage
I just start the API server and for now simply either use curl
or my web browser to set the light.
Reason to use the API server this is that sooner or later I want to try a few clients to change the light based on activity.
Commandline
pcfe@workstation ~ $ busylight --help
Usage: busylight [OPTIONS] COMMAND [ARGS]...
Control USB attached LED lights like a Human™
Make a USB attached LED light turn on, off and blink; all from the comfort
of your very own command-line. If your platform supports HIDAPI (Linux,
MacOS, Windows and probably others), then you can use busylight with
supported lights!
Options:
-l, --light-id INTEGER Which light to operate on, see list output.
[default: 0]
-a, --all Operate on all lights. [default: False]
--install-completion [bash|zsh|fish|powershell|pwsh]
Install completion for the specified shell.
--show-completion [bash|zsh|fish|powershell|pwsh]
Show completion for the specified shell, to
copy it or customize the installation.
--help Show this message and exit.
Commands:
blink Activate the selected light in blink mode.
list List available lights (currently connected).
off Turn selected lights off.
on Turn selected lights on.
serve Start a FastAPI-based service to access lights.
supported List supported LED lights.
udev-rules Generate a Linux udev rules file.
Turning the light red to signal that I am in a meeting and should not be disturbed:
pcfe@workstation ~ $ busylight on red
web API
Remember to check the docs (once you have the FastAPI-based service to access lights running) at http://localhost:8888/docs
Now to try the webapi, in one shell;
pcfe@workstation ~ $ busylight serve
INFO: Started server process [55451]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:8888 (Press CTRL+C to quit)
In another shell;
pcfe@workstation ~ $ curl --silent http://localhost:8888/1/lights | jq
[
{
"light_id": 0,
"name": "Embrava Blynclight Plus",
"info": {
"path": "0003:0007:00",
"vendor_id": 11277,
"product_id": 16,
"serial_number": "",
"release_number": 256,
"manufacturer_string": "",
"product_string": "Blynclight Plus",
"usage_page": 0,
"usage": 0,
"interface_number": 0
}
}
]
Make the light cycle colours rainbow style.
pcfe@workstation ~ $ curl --silent http://localhost:8888/1/light/0/rainbow | jq
{
"light_id": 0,
"action": "effect",
"name": "rainbow"
}
See the docs, especially the api docs, for more options.
To Do
- write a systemd service (or simply an autostart entry) to have the webapi running automatically when I log on.
- find a way to change light status automatically based on the following conditions
- Active calls in work sanctioned tools (BlueJeans and Google Meet), provided the tools can make an API call.
- Calls with my deskphone, provided I find a way to get call status from it.
Deprecated
this section is about earlier testing with a tool I no longer use. It’s in this post purely for archival reasons.
Using github.com/JnyJny/blynclight on F32
On 2020-10-26, I used blynclight while my main workstation was running Fedora 32 x86_64
This worked fine, provided the udev rule was in place.
Kudos to JnyJny for adding the udev-rules command
I installed python3-hidapi from RPM as it is available in the repos. Then I installed blynclight, not system wide, via pip. This was followed by creating a udev rule.
pcfe@workstation ~ $ sudo dnf install python3-hidapi.x86_64
pcfe@workstation ~ $ python3 -m pip install --user blynclight
pcfe@workstation ~ $ blync udev-rules
KERNEL=="hidraw*", ATTRS{idVendor}=="2c0d", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2c0d", MODE="0666"
KERNEL=="hidraw*", ATTRS{idVendor}=="0e53", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0e53", MODE="0666"
pcfe@workstation ~ $ sudo vim /etc/udev/rules.d/99-blynclight.rules
Remember to udevadm control --reload
if you make changes to the file.
Light is recognised just fine.
pcfe@workstation ~ $ blync -a
BlyncLights :1
ID:KEY :VALUE
00:path :0003:000e:00
00:vendor_id :0x2c0d
00:product_id :0x10
00:release_number :0x100
00:product_string :Blynclight Plus
00:usage_page :0x0
00:usage :0x0
00:interface_number:0x0
Turning the light green to signal that I can be interrupted at my desk:
pcfe@workstation ~ $ blync --verbose --GREEN
INFO| Light:0x2c0d:0x0010
INFO| Value:0x000000ff080094ff22
INFO| Red:0x00
INFO| Blue:0x00
INFO| Green:0xff
INFO| Off:0x0
INFO| Dim:0x0
INFO| Flash:0x0
INFO| Speed:0x1
INFO|Repeat:0x0
INFO| Play:0x0
INFO| Music:0x0
INFO| Mute:0x1
INFO|Volume:0x5
See the github repo for more commands.
Note on the Used Fedora Versions
For me that is always the latest release. Thing is that I received my Blinklight 2 days before Fedora 33 became GA, hence the early tests with the light were on F32 and then from 202-10-27 onward on F33, after the usual painless upgrade.
Links
- https://embrava.com/products/blynclight-plus
- https://github.com/JnyJny/busylight
- https://github.com/JnyJny/blynclight
- https://github.com/JnyJny/busylight/issues/5
- https://github.com/JnyJny/blynclight/issues/21
- https://embrava.com/pages/software (the Awareness Sign)
- https://github.com/themoosman/blynclight-api-server