Notice: Array to string conversion in system/classes/theme.php line 93
hacking the USB i-buddy - IMakeThin.gs

i make things!!

« Notice: Array to string conversion in system/classes/rewriterule.php line 112
Notice: Object of class HabariDateTime could not be converted to int in system/classes/rewriterule.php line 112
Notice: Object of class HabariDateTime could not be converted to int in system/classes/rewriterule.php line 112
Notice: Object of class HabariDateTime could not be converted to int in system/classes/rewriterule.php line 112
Notice: Object of class HabariDateTime could not be converted to int in system/classes/rewriterule.php line 112
http://imakethin.gs/blog/dammit-yes" title="dammit-yes">dammit yes
Notice: Array to string conversion in system/classes/rewriterule.php line 112
Notice: Object of class HabariDateTime could not be converted to int in system/classes/rewriterule.php line 112
Notice: Object of class HabariDateTime could not be converted to int in system/classes/rewriterule.php line 112
Notice: Object of class HabariDateTime could not be converted to int in system/classes/rewriterule.php line 112
Notice: Object of class HabariDateTime could not be converted to int in system/classes/rewriterule.php line 112
Notice: Object of class HabariDateTime could not be converted to int in system/classes/rewriterule.php line 112
Notice: Object of class HabariDateTime could not be converted to int in system/classes/rewriterule.php line 112
Notice: Object of class HabariDateTime could not be converted to int in system/classes/rewriterule.php line 112
Notice: Object of class HabariDateTime could not be converted to int in system/classes/rewriterule.php line 112
http://imakethin.gs/blog/new-toy" title="new-toy">New toy
»

Notice: Array to string conversion in system/classes/rewriterule.php line 112
Notice: Object of class HabariDateTime could not be converted to int in system/classes/rewriterule.php line 112
Notice: Object of class HabariDateTime could not be converted to int in system/classes/rewriterule.php line 112
Notice: Object of class HabariDateTime could not be converted to int in system/classes/rewriterule.php line 112
Notice: Object of class HabariDateTime could not be converted to int in system/classes/rewriterule.php line 112
http://imakethin.gs/blog/hacking-the-usb-i-buddy" title="hacking the USB i-buddy">hacking the USB i-buddy

2007
18
December

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


to hacking the USB i-buddy

Notice: Array to string conversion in system/classes/rewriterule.php line 112
Notice: Object of class HabariDateTime could not be converted to int in system/classes/rewriterule.php line 112
Notice: Object of class HabariDateTime could not be converted to int in system/classes/rewriterule.php line 112
Notice: Object of class HabariDateTime could not be converted to int in system/classes/rewriterule.php line 112
Notice: Object of class HabariDateTime could not be converted to int in system/classes/rewriterule.php line 112
http://imakethin.gs/blog/hacking-the-usb-i-buddy/atom/comments">Feed for this Entry

17 Comments

  • The script is 404 -- would you mind reposting it?

    #19 | Comment by on Jun 19, 2008 07:13pm
  • Certainly, the link is now fixed :)

    #20 | Comment by on Jun 21, 2008 06:42am
  • Thanks for your efforts!

    I got this gadget for free and I think it's cute :) so I like to get it work

    but it seems your script cannot find my ibuddy, it's output is just "Starting search..." and some dots on new lines. Do you know how to solve that?

    thanks!

    #21 | Comment by on Jun 26, 2008 04:14am
  • yup i think i know what that is, when you connect the iBuddy the usbhid driver claims it. To prevent that you need to unload the usbhid driver, start the script, then reload the usbhid driver

    Bear in mind that the usbhid driver controls keyboards and mice, unloading it will kill them! You need to write a short script to do this. Something like

    #!/bin/sh
    rmmod usbhid
    ./ibuddy.py
    insmod usbhid

    Save that to a .sh file, chmod it to allow execution and run. Cant guarantee it will work though

    #22 | Comment by on Jun 26, 2008 04:21am
  • Hi!
    You'll be happy (or indifferent) to know that I used the information you posted here to hack a Java library, available here:
    http://www.jraf.org/static/maven/sites/jlibibuddy/
    So I just wanted to thank you very much cause I couldn't have done it without your work finding the USB protocol! And now I'm having fun playing with the i-Buddy, making it blink, nudge and flap its wings in all sorts of ways;) So thank you!

    #24 | Comment by on Sep 7, 2008 01:43pm
  • So I've tried and tried and tried a bajillion things (including different distros [FC4 and then Ubuntu 8.04]) and the best I can get is:
    "usb.USBError: error sending control message: Broken pipe"
    Anyone have any ideas on this?
    I also decided I might try to sniff it in "normal" operations on Windows using SnoopyPro and MSN Chat, but SnoopyPro refused to log anything beyond the initial bus scan. Any ideas anyone?

    #25 | Comment by on Sep 9, 2008 02:29pm
  • OK, so I've gotten it working. There were some pretty big differences with my i-Buddy:
    1) After getting a USB sniffer working, I found out that the "value" in the control message for mine needed to be set to 200. Additionally, I found that the "setup" control message is unnecessary for mine. You can just send the data messages directly.
    2) What's really strange is that the order and "polarity" of the bits for the data byte are totally different.
    Mine is XGBRDURL. For all the LEDs (including the heart) on = 0 and off = 1. But, for the movements, on = 1 and off = 0

    I've also managed to get a basic Perl version working, but it has some minor issues still. If I get around to fixing it, perhaps I'll post it here.

    #26 | Comment by on Sep 11, 2008 10:49am
  • Thank you for all the work done! :) It was really easy to set up my own version of the software with your example and all information given. To Tom and slikkie: In the given example there is already a way to detach the HID controller, it's in the commented lines (detachKernelDriver).

    #27 | Comment by on Oct 29, 2008 01:43pm
  • Chouette !
    Merci pour les informations, je cherche le code en C.
    Merci

    Cool!
    Thank you for the information, I seek the code in C.
    Thank you

    #28 | Comment by on Nov 14, 2008 09:13am
  • ./ibuddy.py: 1: import: not found
    ./ibuddy.py: 2: import: not found
    ./ibuddy.py: 5: class: not found
    ./ibuddy.py: 6: Syntax error: "(" unexpected

    Pyhton Ok, Libusb Ok et Pyusb Ok !!

    #29 | Comment by on Nov 14, 2008 10:22am
  • Gracias.
    Encontré este sitio http://code.google.com/p/pybuddy/ , pero no descargar fuentes!

    #31 | Comment by on Nov 23, 2008 04:23am
  • oups, j'avais pas vu le lien dans le titre. merci http://2e5e.wordpress.com/2008/11/21/pybuddy-hacking-ambient-devices/

    Vaya, yo no había visto vínculo en el título

    #32 | Comment by on Nov 23, 2008 04:25am
  • Yuhuu. This is great tool to do some status meter with simple python scripts, thanks for that...

    Some points:
    I noticed that my buddy had a product id 0001 not 0002.
    To run with normal user I had to make udev rule:
    SYSFS{idProduct}=="0001", SYSFS{idVendor}=="1130", MODE="666", OWNER="root", GROUP="root"

    #38 | Comment by on Jun 18, 2009 05:53am
  • I recently got a cheap imitation of this from DX (called e-buddy), and started working on this. I have hit a brick wall now as self.dev.handle.controlMsg(0x21, 0x09, self.SETUP, 0x200, 0x01) seems to generate an exception although the device is found fine and enumerates as it should. They also use the control interface (checked with sniffer) but I don't manage to write to it.

    Would appreciate it if you'd get in touch with me ;)

    #68 | Comment by on Jan 10, 2010 05:08pm
  • Nevermind, got it working.
    For people with an ebuddy (DX copy), see http://code.google.com/p/pybuddy-dx/

    #69 | Comment by on Jan 18, 2010 06:12am
  • Hi Petur, Sorry I didnt get back to you, i've been recovering from a broken arm and its been a right pain to type things! Glad you got it working though

    I fixed the problem with detaching the iBuddy from the kernel driver, use the quirks parameter when loading the usbhid module to blacklist the device. Works a treat!

    #72 | Comment by on Jan 21, 2010 12:18pm
  • anyone know if it (i-buddy or e-buddy dx) works on mac osx?

    Thanks

    #74 | Comment by on May 18, 2010 05:53am

Notice: Array to string conversion in system/classes/theme.php line 93
Notice: Array to string conversion in system/classes/theme.php line 93
Notice: Array to string conversion in system/classes/theme.php line 93
About You

Email address is not published

Add to the Discussion