Busylite
Python command line tool to interact with the Kuando Busylight. This is a work in progress and real rough... so use at your own risk!
Drawing a lot of inspirtion from these sources:
- cython-hidapi
- js-busylight
- BusyLight Specs
Install
Install via PyPi:
pip install busylite
CLI
After installing, A quick way to get up a running is with the inlcuded CLI:
busycli --help
Server App
There is also an included Flask App, to accept HTTP POST requests. Start the server:
busycli serve localhost 5000 -u spam -p eggs
And then make a POST:
curl -u spam:eggs -X POST -i http://localhost:5000/send/done
Setup
Needed to get the produt and vendor ID. Easist way to grab this was to lsusb before and after plugging in the busylight:
- Vendor: 27bb
- Product: 3bcd
- ModelName: BusyLight UC Omega
Non-Root Access
Need to add a udev rule:
echo "SUBSYSTEM==\"usb\", ATTRS{idVendor}==\"27bb\", ATTRS{idProduct}==\"3bcd\", GROUP=\"$(whoami)\", OWNER=\"$(whoami)\", MODE=\"0664\"" | sudo tee -a /etc/udev/rules.d/30-busylight.rules
Test out the rules:
sudo udevadm test /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5/2-1.5.2
Where the syspath parameter was pulled from the output of:
udevadm info -a -p $(udevadm info -q path -n /dev/bus/usb/002/010)
where the dev path was pulled from lsusb.
Dependencies
Need to install some things and setup an environment:
sudo apt install libusb-1.0-0-dev libudev-dev
Writing to HID
Mimicking the methodology here buffer is constructed like:
- Init as
[0,16,0,0,0,0,0,0,128] - Add fifty zeros
[0]*50 - Append this to end:
[255, 255, 255, 255, 6, 147]
Buffer positions:
- red : 3
- green : 4
- blue : 5
- sound : 8
Color Values
- Red: 0-255
- Green: 0-255
- Blue: 0-255
Sound Values:
- OpenOffice : 136
- Quiet : 144
- Funky : 152
- FairyTale : 160
- KuandoTrain : 168
- TelephoneNordic : 176
- TelephoneOriginal : 184
- TelephonePickMeUp : 192
- Buzz : 216
Volume is controlled by adding 1 to each tone: 0=MUTE, 7=MAX
The last two entries in the buffer are a checksum on the buffer:
checksum = sum(self.buffer[0:63])
self.buffer[63] = (checksum >> 8) & 0xffff
self.buffer[64] = checksum % 256
Metadata
Release files for busylite 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| busylite-0.1.1.tar.gz | 6.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| busylite-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.2 kB
Release files / busylite-0.1.1.tar.gz
| Download URL | busylite-0.1.1.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
33b9b7479ea46a62b8d99869ca276bd3d030f99404081baac34dfb712a0b9308
|
|
BLAKE2b-256 checksum How to use checksums |
b99209a70491174afb8efaf6ee550f33394ba354800a1ca618893fd86b97277f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
|
Release files / busylite-0.1.1-py3-none-any.whl
| Download URL | busylite-0.1.1-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
042864bb5f32afa19b2ffccfd6946a92294ba3b4e7b0c7f0686e6c103a6b86cf
|
|
BLAKE2b-256 checksum How to use checksums |
f1d9d8494495f396f697df6f0db94e2f00b1562563ea53cf1a841a8bd7270b60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
|