Kurt StephensNerd Up! | ||
Luxeed LED Keyboard Driver for LinuxKurt on Wed, 2008-12-10 07:34.
Hardware ReviewThis is a really cool keyboard, except that the ESC and function keys do not light up and are strangely located and difficult to press. I also don’t understand why the spacebar does not light up; seems like it’s the most important key. The construction is not very good and the feel is a bit mushy. However, this keyboard is fun for hacking and could be really great for user training. Device Driver and Source CodeAfter much troubleshooting, I have created a simple C driver library for the Luxeed deTA 100/200 keyboard using libusb. This driver allows the LEDs under each key to be set from C from most Unix-like operating systems. This is my first attempt at reverse-engineering the protocol of a USB device. Source is located here: http://github.com/kstephens/luxeed/tree/master OverviewThere is a user-space single-threaded, non-blocking I/O daemon using libevent that accepts multiple TCP connections on port 12345 to execute pixel update commands. I’ve been able to get time between frames down to 0.025 seconds. CommandsCommands sent from clients via TCP to the server: set <RED> <GREEN> <BLUE> <KEY>... update wait <SECONDS> get <KEY> Keys can be specified using names (e.g.: “TAB”, “LSHIFT”, “A”), key IDs (e.g. “#20” same as “Y”) or positions relative to the top-left corner (e.g.: “2@1” same as “W”). The “get” command returns the current color of a key. The key colors are atomically uploaded to the keyboard with “update” command. Building and Running the Server> cd luxeed/src > make install-prereqs > make > sudo ./luxeed --server & # start the server Basic CommandsMake the number keys light up blue: > netcat localhost 12345 set 00 00 ff 1 2 3 4 5 6 7 8 9 0 update ^D Simple client that flashes keys:
> sudo ./luxeed --server & # start the server
> cat flash_keys
#!/bin/bash
t=0.5
c="ff ff ff"
c2="00 00 00"
while [ $# -gt 0 ]
do
case "$1"
in
-t)
t="$2"; shift 2
;;
-c)
c="$2"; shift 2
;;
-c2)
c2="$2"; shift 2
;;
*)
break
;;
esac
done
keys="$*"
while true
do
netcat localhost 12345 <<END
set $c $keys
update
wait $t
set $c2 $keys
update
wait $t
END
done
> ./flash_keys ENTER # flash the ENTER key
Since the server can service multiple clients, we can flash multiple keys at different rates and colors using multiple clients: > ./flash_keys -t 0.2 -c 'ff 00 00' TAB & > ./flash_keys ENTER & Maybe it’s time for a demo video. Things left:
There are some I/O throttling issues; sometimes the keyboard disconnects (or requires a power cycle) if data is sent to it too quickly. The only message I could decipher is a bulk keyboard update message of 5 65-byte blocks with an embedded checksum. Maybe there is a smaller differential update payload that will only update specific keys which would be more useful for faster animation. There may be a response message that needs to be read. If you have this keyboard, give it a try! deTA 3.1 FirmwareSubmitted by Kurt on Sun, 2009-03-08 20:12.
Has anyone been able to install the new 3.1 firmware on the deTA? I always get “download error”. I’m using a USB-to-Serial dongle, but I’ve never had any problems with it before. http://luxiium.com/en/bbs/board.php?bo_table=program_down_e&wr_id=16 Their support site is horrific. — Kurt » reply
linuxSubmitted by luxeed nerd (not verified) on Thu, 2009-04-09 21:30.
Can only seem to get the keys to light up with white ff ff ff, any other color i try eg blue 00 00 ff, and they won’t respond or light up. Was thinking of making a gui for this to create an executable file for color templates (and maybe animations) but can’t quite get past the color issue. Ubunto 8.04 desktop » reply
How are you communicating with the server?Submitted by Kurt on Wed, 2009-06-24 17:34.
There were some fixes since your post. » reply
Trying to get this working on OSXSubmitted by Matthew (not verified) on Sun, 2009-11-29 17:39.
I have a Luxeed which I bought with precisely this in mind, however I got the U5 which (as I only discovered after purchasing) doesn’t come with the software to set the colour externally…I’m hoping that under the hood it’s basically the same (it looks identical) and will respond to the same USB calls. Anyway, do you have any tips for getting the server running on OSX? When I enter “make install-prereqs” I get the following error: sudo: apt-get: command not found My C & Unix chops are n00b-level but if I can just get the server responding to TCP I should be able to take it from there… - Matthew » reply
More OSXSubmitted by Matthew (not verified) on Mon, 2009-11-30 10:50.
Hi there, got a little further. Managed (with some effort) to install libusb and libevent from darwinports.com on my mac. I commented out the “sudo apt-get…” line in the Makefile. Finally I ran Make and…I get a ton of errors: cc -g -O2 -Wall -c -o luxeed_device.o luxeed_device.c ... and so on for days. Am I missing something critical from my path? Having searched my computer I’ve found seven different files called USB.h (upper case) – I’m rather confused. Thanks for any help you can give, » reply
U5 like deTA ?Submitted by mherweg (not verified) on Sun, 2009-12-13 15:15.
is this Driver compatible with the Luxeed U5 keyboard ? » reply
|
||
Recent comments
1 year 24 weeks ago
1 year 35 weeks ago
2 years 1 week ago
2 years 17 weeks ago
2 years 51 weeks ago
3 years 11 weeks ago
3 years 14 weeks ago
3 years 14 weeks ago
3 years 14 weeks ago
3 years 14 weeks ago