The Surveillance Computer The Surveillance Computer uses an Asus A7V600 motherboard with an Athlon XP 2700 processor running at 2166.403 MHz. There are 512 MB of memory. There is an ext3 Linux file system. The 4 channel video capture card is based on the bt848 chip. Two 120 gigabyte hard drives are mounted on /dev/hda and /dev/hdb. The partition tables are as follow: Disk /dev/hda: 120.0 GB, 120034123776 bytes 255 heads, 63 sectors/track, 14593 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xa832a832 Device Boot Start End Blocks Id System /dev/hda1 1 1000 8032468+ b W95 FAT32 /dev/hda2 1001 2275 10241437+ 83 Linux /dev/hda3 2276 2339 514080 82 Linux swap /dev/hda4 2340 14593 98430255 5 Extended /dev/hda5 2340 3614 10241406 83 Linux /dev/hda6 3615 4889 10241406 83 Linux /dev/hda7 4890 6164 10241406 83 Linux /dev/hda8 6165 7439 10241406 83 Linux /dev/hda9 7440 8714 10241406 83 Linux /dev/hda10 * 8715 9989 10241406 83 Linux /dev/hda11 9990 11264 10241406 83 Linux /dev/hda12 11265 12539 10241406 83 Linux /dev/hda13 12540 13814 10241406 83 Linux /dev/hda14 13815 14593 6257286 83 Linux Disk /dev/hdb: 120.0 GB, 120034123776 bytes 255 heads, 63 sectors/track, 14593 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x900a900a Device Boot Start End Blocks Id System /dev/hdb1 1 4999 40154436 b W95 FAT32 /dev/hdb2 5000 9999 40162500 83 Linux /dev/hdb3 10000 10001 16065 82 Linux swap /dev/hdb4 10002 14593 36885240 5 Extended /dev/hdb5 10002 12499 20065153+ c W95 FAT32 (LBA) /dev/hdb6 12500 14593 16820023+ 83 Linux Various of the Linux partitions of the primary drive: /dev/hda are occupied with audio files that have been transferred to CDs. These partitions are available for video. The entire sevondary drive: /dev/hdb is for practical purposes empty and can be used to store video if necessary. The active partition is /dev/hda10. Booting is with lilo. The lilo configuration file is as follows: # LILO configuration file # generated by 'liloconfig' # # Start LILO global section boot = /dev/hda message = /boot/boot_message.txt prompt timeout = 150 # Override dangerous defaults that rewrite the partition table: change-rules reset vga = normal # End LILO global section # Linux bootable partition config begins image=/boot/vmlinuz_hda2 root = /dev/hda2 label = Linux2 read-only # Linux bootable partition config ends # Linux bootable partition config begins image = /boot/bzImage root = /dev/hda10 label = Linux10 read-only # Linux bootable partition config ends # Linux bootable partition config begins image = /boot/vmlinuz268 root = /dev/hda11 label = Mandrake read-only # Linux bootable partition config ends # Linux bootable partition config begins image = /boot/vmlinuz2418 root = /dev/hda6 label = Linux6 read-only # Linux bootable partition config ends # Linux bootable partition config begins image = /boot/vmlinuz_hda7 root = /dev/hda7 label = Linux7 read-only # Linux bootable partition config ends # Windows bootable partition config begins other = /dev/hda1 label = Windows table = /dev/hda # Windows bootable partition config ends ========================================== The kernels for booting the various operating systems have been copied to the directory /boot on /dev/hda10 The surveillance system is incorporated into the Linux 2.6.27.7 kernel mounted from a Slackware distribution on /dev/hda2. This 2.6.27.7 version is booted by default 15 seconds after the lilo boot loader is activated. The system rom bios has been set to boot as soon as power is applied. One initiates a surveillance session by calling the Nantucket number: 508-228-3836 on a touch tone phone. After 4 rings, the on site transponder answers with three beeps. One then enters (touchtone) "4" followed by (touchtone) "*". This command powers the computer. In about 75% of attempts the computer then boots. In the remaining 25% of attempts the computer opens the rom-bios dialogue. For a method to correct this failure, see below. On booting, the computer executes the standard routines, including f2sck scanning of the filing system, if indicated. Upon entering run-level 5, the computer executes /etc/rc.d/init.d/functions. This file contains the command /usr0/meyer/PPP/cmd00. As used in the Boston area, this command has the following specifications: date # ifconfig eth0 down ## ifconfig eth0 down cp /dev/null local_address (pppd connect "chat -f /usr0/meyer/PPP/dial_netcom" /dev/ttyS0 38400 -detach crtscts modem defaultroute debug name kbmeyer@ix.netcom.com logfile local_address -vjccomp)& echo Login started sleep 60 cat local_address echo Now uploading local_address ftp ftp-www.earthlink.net The script dial_netcom is as follows: '' ATZ OK ATDT6175004492 CONNECT '' ogin: kbmeyer@ix.netcom.com word: mut11z '' '' as used on Nantucket, this command has the following specifications: date ifconfig eth0 down ## ifconfig eth0 down cp /dev/null local_address (pppd connect "chat -f /usr0/meyer/PPP/dial_netcom_nantucket" /dev/ttyS0 38400 -detach crtscts modem defaultroute debug name kbmeyer@ix.netcom.com logfile local_address -vjccomp)& echo Login started sleep 60 cat local_address echo Now uploading local_address ftp ftp-www.earthlink.net The script dial_netcom_nantucket is as follows: '' ATZ OK ATDT5083321005 CONNECT '' ogin: kbmeyer@ix.netcom.com word: mut11z '' '' The file "local_address" is a temporary file It is cleared with the command "cp /dev/null local_address" at the beginning of the routine and then receives the logfile from the current modem hand-shaking. The file "local address" looks like this: ========================================== Serial connection established. using channel 1 Using interface ppp0 Connect: ppp0 <--> /dev/ttyS0 sent [LCP ConfReq id=0x1 ] rcvd [LCP ConfReq id=0x1 ] sent [LCP ConfAck id=0x1 ] rcvd [LCP ConfAck id=0x1 ] sent [LCP EchoReq id=0x0 magic=0xaa05a0fb] sent [CCP ConfReq id=0x1 ] sent [IPCP ConfReq id=0x1 ] rcvd [LCP EchoRep id=0x0 magic=0x0] rcvd [IPCP ConfReq id=0x1 ] sent [IPCP ConfNak id=0x1 ] rcvd [LCP ProtRej id=0x2 80 fd 01 01 00 0f 1a 04 78 00 18 04 78 00 15 03 2f] Protocol-Reject for 'Compression Control Protocol' (0x80fd) received rcvd [IPCP ConfNak id=0x1 ] sent [IPCP ConfReq id=0x2 ] rcvd [IPCP ConfReq id=0x2 ] sent [IPCP ConfAck id=0x2 ] rcvd [IPCP ConfAck id=0x2 ] Cannot determine ethernet address for proxy ARP local IP address 4.156.93.96 remote IP address 209.247.23.39 Terminating on signal 15 Connect time 18.2 minutes. Sent 17052 bytes, received 22895 bytes. sent [LCP TermReq id=0x2 "User request"] rcvd [LCP TermAck id=0x2] Connection terminated. ================================================ The eighth line from the bottom: "local IP address 4.156.93.96" furnishes the dynamic IP address of the Nantucket machine necessary to establish the computer connection. As soon as the local_address file has been written, it is automatically uploaded by ftp to ftp-www.earthlink.net The login is jochenmeyer; the password is mut12z The uploading is accomplished with the use of a .netrc control file which reads as follows: machine ftp-www.earthlink.net login jochenmeyer passwd mut12z macdef init dir put local_address quit If the uploading is sucessful a pre-exiasting local_address file on ftp-www.earthlink.net will be overwritten. Having transmitted the "local_address" file to the website home.earthlink.net/~jochenmeyer the program proceeds to the login prompt. The modem remains connected and active. Because of the 60 seconds' delay allowed for the modem hand-shaking, at least 4 minutes should be allowed to elapse before attempting to retrieve the local_address file from home.earthlink.net/~jochenmeyer. More time might conceivably be requiired if f2sck file checking is done by the Nantucket machine. The local_address file is retrieved from home.earthlink.net/~jochenmeyer by the following exchange: ftp ftp-www.earthlink.net Connected to ftp-www.earthlink.net. 220 FTP-WWW server ready Name (ftp-www.earthlink.net:meyer): jochenmeyer 331 Password required for jochenmeyer. Password: 230- 230- Your disk quota is: 10.00 megabytes 230- Your disk usage is: 2.63 megabytes (26.28% of quota) 230- 230 User jochenmeyer logged in. Remote system type is UNIX. Using binary mode to transfer files. ftp> dir local_address 200 PORT command successful. 150 Opening ASCII mode data connection for file list. -rw-r--r-- 1 freeuser wwwfree 1433 Jan 30 19:33 local_address 226 Transfer complete. ftp> get local_address local: local_address remote: local_address 200 PORT command successful. 150 Opening BINARY mode data connection for local_address (1433 bytes). 226 Transfer complete. 1433 bytes received in 0.136 secs (10 Kbytes/sec) ftp> quit 221 Goodbye. ====================================== The time stamp on the local_address at the web-site: -rw-r--r-- 1 freeuser wwwfree 1433 Jan 30 19:33 local_address being Greenwich Mean Time, should be five hours ahead of the time that the Nantucket computer booted, less perhaps 3 minutes. In the present example the upload from Nantucket would have taken place at Jan 30 14:33 EST, If the website time-stamp on local_address is old, one infers that instead of booting the Nantucket computer slipped into rom-bios mode and proceeds as follows: Telephone 508-228-3836, and when the transponder answers with 3 beeps, enter "4" followed by "#". This routine turns the power off. About 10 seconds later one repowers, by entring "4" followed by "*". One waits for 4 minutes before making another attempt to retrieve by ftp a currently valid local address file. Next one erases old image files in the directories /usr/local/apache2/htdocs/cam1 /usr/local/apache2/htdocs/cam2 /usr/local/apache2/htdocs/cam3 /usr/local/apache2/htdocs/cam4 This may be done conveniently and safely by using the aliased commands: r11, r22, r33, r44 These commands have been concatenated in /usr0/meyer/trans00 One must then switch to the superuser mode, entering "su", password: wurzel, before activating all four cameras with the command:"motion -s" The "-s" flag prevents the motion daemon from slipping into the background, making it possible to stop the video file generation with control-C, which one should do after about 10 seconds. (If by mistake one fails to use the -s flag, the program will lapse into the background, continue taking pictures and fill up the disc. The wisest move is to exit promptly by typing "shutdown now". This will put Linux into the single user mode.) All images are now to be found in the directories /usr/local/apache2/htdocs/cam1 /usr/local/apache2/htdocs/cam2 /usr/local/apache2/htdocs/cam3 /usr/local/apache2/htdocs/cam4 for the respective cameras. Lists for the four cameras may be viewed with the aliased commands 111,222,333,and 444. The command trans01, executed from the /usr0/meyer home directory, or the comman /usr0/meyer/trans01 from any directory, will copy the last five images from each camera into /usr0/meyer/trans10. One may then download the five last images from /usr0/meyer/trans10, using sftp. Alternatively all the images may be downloaded with sftp from /usr/local/apache2/htdocs/cam1 /usr/local/apache2/htdocs/cam2 /usr/local/apache2/htdocs/cam3 /usr/local/apache2/htdocs/cam4 To stop the computer switch into superuser mode, if not there already, then type "shutdown now" This command will uncouple the modem and open the telephone line. Then dial 508-228-3836, press "4" then press "#" to turn off power to the computer, to the screen, the modem and the cameras. The video program is called "motion". It was written by a Danish programmer and may be downloaded from his website. On this machine it is installed from the directory /usr/local/motion which contains also documentation. Additional documentation is available online. The configuration files are in /usr/local/etc The target files for the images are in /usr/local/apache2/htdocs/cam[1234] Note that for the Nantucket computer, the username is "meyer", the password for "meyer" is "Mut12z". Note the uppercase "M". The password for root and su is wurzel. The Nantucket computer will not accept telnet. It does accept "ssh". It does not accept ftp; but it does accept "sftp". I made no effort to try to ascertain in what directory ftp would search for the .netrc file. I believe I left copies in /root /usr0/meyer /usr0/meyer/PPP and /etc/rc.d/init.d "chat" looks for /usr0/meyer/PPP/dial_netcom and /usr0/meyer/PPP/dial_netcom_nantucket