I've moved this project to GitLab: https://gitlab.com/ryanmcginger/busylite
And also setup a pypi project: https://pypi.org/project/busylite/
Install via pip and follow on GitLab for updates! Sorry for any trouble this might cause!
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
After installing, A quick way to get up a running is with the inlcuded CLI:
busylight serve 8787
And then from another terminal:
busylight send localip 8787 done
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
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
.
Need to install some things and setup an environment:
sudo apt install libusb-1.0-0-dev libudev-dev
Install with pip:
pip install git+https://github.com/mccarthyryanc/busylight
or, Clone and install:
git clone https://github.com/mccarthyryanc/busylight
cd busylight
python setup.py install
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