which distinguish it from other devices. The vendor ID ( Logitech) has to be mentioned in the code. Now you can run the loop. pl program.
Loop.pl. This is a Perl script that runs continuously to check whether the webcam is connected or not. Values for ‘ sleep’ command in the code can be changed to achieve an optimal performance. Thunderbird has to be installed and configured before running this program. The flowchart of the program is shown in Fig. 3.
When the visitor rings the door bell by pressing switch S1, it triggers the monostable circuit and the webcam gets connected to the system. The program control moves inside the if($count2==1) condition in the loop.pl code. Then it starts executing the following programs sequentially:
Webcam.pl. It is a Perl script which acquires the image from the webcam using Streamer tool. The image is stored in your system. The path of
PARTS LIST the image acquired has to be specified in the options of Streamer tool as “streamer –o /path/of/the/image”
The Streamer can be installed from the Internet by using the following command:
Streamer reads audio and video data from ‘/dev/video0’ and ‘/dev/ dsp’ locations. Then it writes the data to the disk. Various output formats are supported. The following instruction in the code captures the image from the webcam and stores it in your PC: where ‘c’ defines the device driver and ‘o’ defines the file destination.
With ‘streamer –h’ executed in the console, the details of Streamer command can be viewed on the PC’S screen.
Listen. pl. This Perl script uses Mplayer tool to play the audio message “Please, may I know your name” to the visitor.
Record.pl. This code records the audio from the visitor using arecord tool. The destination for the audio acquired has to be specified in the options of arecord tool as explained below: where ‘-f’ is the format, ‘-d’ duration of five seconds, ‘D’ device name and ‘/ home/efyindia/documents/audios/ audio_$date.wav’ destination of the file.
The arecord can be installed from the Internet by using the following command:
arecord is a command-line sound file recorder for the ALSA soundcard driver. It supports several file formats and multiple soundcards with multiple devices.
With ‘arecord –h’ executed in the console, more details of arecord command can be viewed on the screen.
Mail_ pic. sh. It is a Shell script which sends an e-mail to the house owner’s e-mail ID using Thunderbird