USBmicro

Your source for USB electrical device interface products.

  • Home
  • Services
    • Design
    • Contact USBmicro
  • Where to buy…

Linux code for U401 (Make Magazine Blog)

usb_motion_page

Today on the Make blog was a posting (it was from the Make forum) by “pmgeahan”. It talks about the U401 use in Make#16:

Thought others might be interested in this; I built the USB motion detector in MAKE 16. The driver program provided was for Windows and was used to make a presentation work.

In my case, I’m a Linux guy, so I hacked together an executable to drive the detector. Strictly speaking, at least on Ubuntu, there’s already a HID driver for the USBMicro interface, but it doesn’t do anything. This program triggers on the motion and, in this case, takes a photo with your webcam. A security system, if you will.

Anyhow, the program is pretty simple, all told. Couple of caveats: First, this has been tested on an Ubuntu box running 2.6.27-11 only. You need libusb to make this thing work. Also, you need privileges on the USB device. I wasn’t able to find exactly how to make this work on my box (couldn’t figure out which /dev entry to make readable/writable). I chose to run it suid root. I know, not the greatest idea, but it works. If you can figure out what to do, lemme know.

The source code can be downloaded here

I will be exploring more Linux programming.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Documentation

Open all | Close all