$arr_19 ), array( 3, false, $arr_20, $arr_24 ), array( 2, false, "\" />", $arr_25 ) ) ); ?> $arr_27 ), array( 3, false, $arr_28, $arr_30 ), array( 2, false, "\" />\n\n", $arr_31 ) ) ); ?> array( 2, false, false, $arr_9 ), array( 4, $arr_10, "if", $arr_245, $arr_248 ), array( 2, false, "\n", $arr_249 ) ) ); ?> rr_466 ), array( 4, $arr_467, "if", $arr_482, $arr_484 ), array( 2, false, "\n", $arr_485 ) ) ); ?> Replacing Tin Soldiers » Linux Magazine
 

Perl script controls toy USB canon

Replacing Tin Soldiers

© Jan-Paul Herr, pixelio.de

Author(s):

Although a USB toy such as a polystyrene rocket launcher only includes a Windows CD, it works fine on Linux with a spot of reverse engineering. With libusb, this doesn't even require compiling a device driver – Perl controls the device from userspace.

Trouble at the office? It doesn't necessarily need to lead to a battle, such as in the video The Great Office War [2] by toy manufacturer Hasbro. Even if you don't have an attack plan, the USB-controlled Rocket Baby rocket launcher (Figure 1), by Chinese manufacturer Cheeky Dream, is a bargain at less than US$ 20. Not only did it cheer up my colleagues at work, it also gave me an opportunity to study the Linux kernel's fairly complex USB subsystem [3].

Opening the box reveals a CD for Windows XP, but no trace of a Linux driver. This seems to have provoked a number of gadget fans in the developer community to investigate the USB protocol the toy uses on Windows with USB sniffers such as USBsniff, to reverse engineer the interfaces, and create bindings for languages such as Python, or even for completely different operating systems [4].

When the toy is plugged into an empty USB slot, the Ubuntu Hardy Heron distribution autodetects it. The kernel messages, which can be read in the /var/log/messages logfile (Figure 2), tell you that the toy rocket launcher is now connected to the Intel-based PC's UHCI controller.

[...]

Read full article as PDF »

Perl.pdf (357.07 kB)

Comments

  • How Do I Install This Special Barcode Reader?

    Great news about that. I would love to have all my computers running Linux, but one thing that is holding me back is a device that I have that earns my family a little money each month from shopping.

    Shopper's Hotline is a survey company that rewards families for using this scanning device to record purchases and transmits the information to the company.

    The first one we had was a normal scanner hooked up to a normal phone line, but now we had to change to one that transmits over the internet using Windows.

    I tried installing the program CD using WINE, program worked fine but it didn't pick up the USB scanner.

    How Do I Install This Special Barcode Reader?
comments powered by Disqus

Direct Download

Read full article as PDF »

Perl.pdf (357.07 kB)

News