Aspire :: Bundles :: iBuddy
This bundle provides a service and a command to control one or more iBuddies connected to the host
The i-Buddy is a small blinking and moving USB figurine initially designed as a MSN live avantar.
This actuator can be used in SOHO (Small Office Home Office) usecases.
The bundle provides
- a org.ow2.aspirerfid.ibuddy.service.IIBuddy service per plugged iBuddy
- a command 'ibuddy' for the Felix shell
Installation
Windows
Uninstall all the iBuddies devices already installed in 'Configuration Panel'>'System'>'Hardware'>'Device Manager'>'HID devices'
- copy the file IBUDDY.INF in the system
- copy libusb0.dll C:/windows/system32/
- copy libusb0.sys C:/windows/system32/drivers/
Install
TBC
Linux
On Fedora 13 64 bits :
- Plug the iBuddy
- Install libusb, libusb-devel (for Fedora), version 0.1
- Compile libusbjava project for your architecture (the libusbjava bundle in the repo is ready for 32 bits)
- You have to patch libusbjava and the iBuddy bundle to let it work correctly (see next section)
- You may need to change the file system.properties, to point /lib64/ instead of /lib/
- Prepare the libusbjava bundle by adding the compiled libusbjava.so in src/main/resources/
- Install and start bundles, the ibuddy may be found (ibuddy list)
You need to be root to access the iBuddy.
Patches for Linux
libusbjava
In order to send data to the iBuddy, it needs to be not used by the kernel, done by usb_detach_kernel_driver_np()
Add a call to it in LibUsbJava.cpp, in function Java_ch_ntb_usb_LibusbJava_usb_1claim_1interface (line 639) :
JNIEXPORT jint JNICALL Java_ch_ntb_usb_LibusbJava_usb_1claim_1interface(JNIEnv *env, jclass obj, jlong dev_handle, jint interface)
{
clearLibusbJavaError(); // Add this
int err = usb_detach_kernel_driver_np((usb_dev_handle *) dev_handle, interface);
if(err < 0)
return err; return usb_claim_interface((usb_dev_handle *) dev_handle, interface);
}
iBuddy bundle
In file org/ow2/aspirerfid/ibuddy/service/IBuddyDescriptor.java : change claimed interface from 0 to 1, line 73
Build
Artifact
Command
The bundle provides a command for the Felix shell
The subcommands are:
ibuddy list : List connected Ibuddys with id
ibuddy <id|*> rotate <interval> <directions: left|right>: rotate every interval (>=200) time(in milliseconde) to the directions (eg : ibuddy 0 rotate 500 left right left)
ibuddy <id|*> flap <intensity> <number of flaps>: flap with specific intensity(>=75) (eg ibuddy 0 flap 75 10)
ibuddy <id|*> head <interval> <colors:none|yellow|blue|white|violet|cyan|green|red> : change head color every interval(in ms) (eg : ibuddy * head 500 yellow red blue)
ibuddy <id|*> heart <interval> <status:on|off> : change heart status every interval (in ms) (eg : ibuddy * head 500 yellow red blue)
ibuddy <id|*> reset : reset the ibuddy (eg : ibuddy * reset)
Remark:
The command can execute in parallel several actions on a set of connected iBuddies
For instance,
ibuddy 0 rotate 1000 left right left right left right flap 75 30 head 1000 red yellow none cyan yellow heart 1000 on off on off on off on off ibuddy 1 rotate 1000 left right left right left right flap 75 30 head 1000 red yellow none cyan yellow heart 1000 on off on off on off onis interpreted as>>iBuddy 0 will excute all those actions in parallel :
ROTATE : [1000, LEFT, RIGHT, LEFT, RIGHT, LEFT, RIGHT]
FLAP : [75, 30]
HEAD : [1000, RED, YELLOW, NONE, CYAN, YELLOW]
HEART : [1000, ON, OFF, ON, OFF, ON, OFF, ON, OFF]>>iBuddy 1 will excute all those actions in parallel :
ROTATE : [1000, LEFT, RIGHT, LEFT, RIGHT, LEFT, RIGHT]
FLAP : [75, 30]
HEAD : [1000, RED, YELLOW, NONE, CYAN, YELLOW]
HEART : [1000, ON, OFF, ON, OFF, ON, OFF, ON]
- The first parameter is the duration in milliseconds of the action
- The second parameter of the FLAP action is the number of times of the wing flapping with a duration indicated in the first argument
Other links