Начитал я
тут.

А именно:
Цитата:
OpenWRt can read input from mouse attached, see instructions on H-wrt.com
I connect a PIR motion detector board paralell to mouse button and get
a simple digital input to router. In case of alarm the webcam takes picture.
It took a while to figure out how to use output from
cat /dev/input/event0
I continuously save mouse output to file. And then check if file is empty.
I could not find easier method.
In Ebay bought 5Ч Sensor Melder Module PIR Low Voltage Bewegungsmelder for 12 EUR.
http://cgi.ebay.de/5-Sensor-Melder-M...item3f0c269c6b
opkg install kmod-usb-serial-ftdi kmod-usb-hid
cat /dev/input/event0 | hexdump
cat /dev/input/event0 |hexdump
cat /dev/hiddev0 |hexdump
cat /proc/bus/input/devices
ls /dev/input/ -l
######################################## #
while (true) do
if ps -ef |grep /dev/input/event2 |grep -v grep; then
echo "cat mouse runs"
else echo "starting cat mouse"
cat /dev/input/event2 > /www/test3 &
fi
if [ -s /www/test3 ]; then
echo "alarm"
#/www/webcam/webcamalarm.sh run here code that uploads picture
cat /dev/null > /www/test3
else
echo "quiet"
fi
done
######################################## #
|
Еще можно почитать:
http://www.xard.ru/post/20224/default.asp
http://imobot.ru/index.php?option=co...id=61&Itemid=9
Может есть другой способ?