hacking the USB i-buddy

No Comments

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:

  1. Scan the usb busses for something with vendorid=0x1130 and prodid=0x0002 - thats the ibuddy
  2. The first thing to send to it is the setup packet -
    1. (0x22, 0x09, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00)

  3. the header for the data packet is
    1. (0x55, 0x53, 0x42, 0x43, 0x00, 0x40, 0x02)

  4. onto the header append another byte of the following format XBGRUDLR  where:
    1. X = heart LED (1 = on, 0 = off)

    2. B G R are the bits for the 3 leds in the head but inverted, i.e. 0 = on, 1 = off

    3. U D are the wing positions, toggle between them to flap

    4. L R are used to twitch it left and right, only enable 1 at a time

  5. 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 :)

Be the first to write a comment!