Wait For Device
Introduction
w4d is a small command line program which waits for a device to be available and then exits
The idea is that you run this in your for example rc.local script before you start a program like Motion which will fail if the USB camera is not yet found by the system.
Detailed Description
The w4d (wait for device) tool simply waits for a device to become available and then exits.
In Linux when you modprobe the usb-devices everything will be scanned in an async manor, so you need to fiddle around with sleeps and such before you call a program like Motion.
w4d prevents this. It will check for a device to become available and then exit. After that you can let your startupscripts start motion for example.
Attached Files
The project is hosted at the authors website
http://www.vanheusden.com/w4d/
Installation
make
make install
Users Guide
Enter:
w4d -h
to see a list of options.
Example usage:
w4d -d /dev/video0 -i 250 -n 10
check 4 times a second for 2.5 seconds if device /dev/video0 comes available.