T'other day I bought one of these (it fits my gadget needs by having blinking lights AND being USB enabled) I-buddy msn notifier. It arrived yesterday and in fine Tom-Style I binned the instructions and plugged it in.
Â After the usual cocking about with XP it started working, all emoticons in my msn chats were triggering it (annoyingly even the ones in peoples names :/ ). Half hour later I was bored with it.
Â "hmm, wonder if i can get this working in my NSLU2.." he thinks.
So I fired up the ole' XP virtual machine that I use for this sort of thing and installed usbsnoop. 10 minutes of msn conversations seemed to generate enough usb packet data to do the trick :)
Â The protocol is stupidly simple, its using the USB HID stuffÂ but seems to respond to data packets without having all the HID stuff set up.
Heres how it works:
- Scan the usb busses for something with vendorid=0x1130 and prodid=0x0002 - thats the ibuddy
- The first thing to send to it is the setup packet -
- (0x22, 0x09, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00)
- the header for the data packet is
- (0x55, 0x53, 0x42, 0x43, 0x00, 0x40, 0x02)
- onto the header append another byte of the following format XBGRUDLRÂ where:
- XÂ = heart LED (1 = on, 0 = off)
- B G R are theÂ bits for the 3 leds in the head but inverted, i.e. 0 = on, 1 = off
- U D are the wing positions, toggle between them to flap
- L R are used to twitch it left and right, only enable 1 at a time
- Thats it! Things toggled on stay on until turned off. To clear it all send 0xff
This works wonderfully with libusb and python, thanks to Scott Weston for publishing the USB rocket launcher python scripts, from which I borrows the USBDevice classes and bastardized for my own use.
Example script is here, currently it flashes the head blue. Note it requires Python, pyusb and libusb to be installed first.
Â I'm planning on using this to alert me when torrents are complete, email notifications etc.
Do with it what you will :)