WebUSB LED. Hardware, software, and firmware.
A USB-controlled LED designed for the WebUSB API.
Have a WebLight device already?
Launch the web app here:
Check out software/src/weblight-card.html
sudo apt-get install gcc-avr binutils-avr gdb-avr avr-libc avrdude. On OS X, CrossPack works.
sudo apt-get install libusb-devworks on Linux, and
brew install libusb libusb-compatworks on OS X.
sudo apt-get install python-usbon Linux, or
sudo pip install pyusbon other platforms.
sudo udevadm control --reload-rules.
make factoryNow you have a bootloader-ready board with no firmware.
make clean upload
This clones the complete firmware from an existing device. For convenience, a relatively stable version of that complete firmware image is already here in the repository (full-[version].hex). If you overwrite it, we'll assume you know what you're doing.
make create_fullThis clones the firmware of the board you just built.
make clean upload.
Micronucleus done. Thank you!
lsusbyou should see something like
Bus 001 Device 006: ID 1209:a800 InterBiometrics.
sudo pip install pyusb==1.0.0.b2
./commandline/wlctl 800000will give you a medium-brightness red light (it uses CSS-style RGB color format).
--helpfor more options.
The best results are with an ENIG finish 2.0mm thickness PCB. If you're just prototyping, 1.6mm will work, but you'll want to put some thick solder on the USB leads to bulk them up a bit. Even then, the fit in the USB socket will be loose. ENIG takes longer to wear out than regular HASL.
The board measures 12mm x 41.1734mm x 2.0mm.
commandlinedirectory, there is
lswusb, which attempts to parse WebUSB descriptors. This utility will help you when you're developing your own WebUSB-compatible device.
Aren't there already a lot of USB-controlled lights out there? Yes, it's more or less a rite of passage in hobbyist electronics to make some kind of blinking light. The purpose of this project was to design a very simple WebUSB device that might actually be useful.
You said "useful" in the prior answer. Please define that. A WebUSB-enabled light can alert you of interesting things, like a broken continuous build, a service interruption, or yet another crash in the price of bitcoin.
weblight.brd. That one is more compact, but it requires the ProtoProg ISP adapter, rather than the more common AVRISP 6-pin adapter. Both designs use 0805 SMT components. Either board can be ordered from OSH Park or Seeed. Note that if you manufacture with a standard 1.6mm PCB, you'll have to solder the contacts to give them enough thickness to connect. For end-user boards, 2.0mm or 2.4mm will fit better in USB sockets, and ENIG finish will last longer without tarnishing.
I don't want to build a board, but I'd like one. Will you sell me one? I don't have plans to mass-produce boards for sale. But if you're interested in getting one, subscribe to notifications for this issue.
I remember reading something about Origin Trials. What does that have to do with WebUSB? Chrome 61 and beyond ship with WebUSB, so if your users are running up-to-date Chrome, you're all set! But in case you're curious, the Chrome team has a system called Origin Trials for gathering real developer feedback on provisional APIs. Go to https://bit.ly/OriginTrials to learn more.