國立交通大學 電機與控制工程學系 碩 士 論 文 數位家庭門禁管理與 WiFi 娛樂 的設計與實現,使用 ARM-Based 平台 The design and Implementation of the Entrance System and WiFi-Entertainment in Digital Home Using ARM-based Platform 研 究 生:黃俊傑 指導教授:吳炳飛 教授 中 華 民 國 九 十 四 年 二 月
數位家庭門禁管理與 WiFi 娛樂 的設計與實現,使用 ARM-Based 平台 學生:黃俊傑 指導教授:吳炳飛 教授 國立交通大學電機與控制工程學系碩士班 摘 要 在數位家庭時代的來臨,必定有一個足以保護居家財產安全的數位大門,而本 論文便是以此概念來設計與實現,一個兼容於現在一般家庭的門禁系統。另一方面, 為了數位家庭的來臨,本論文亦加入無線且數位的娛樂,提供無線數位音樂廣播, 與家庭數位照片相簿的無線瀏覽。 在系統的實現方面,本論文使用 ARM-based 為硬體平台,以 Linux 為作業系統, 並整合了無線網路 IEEE802.
The design and Implementation of the Entrance System and WiFi-Entertainment in Digital Home Using ARM-based Platform Student:Chun-Chieh Huang Advisor:Prof. Bing-Fei Wu Department of Electrical and Control Engineering National Chiao Tung University ABSTRACT In the trend of digital home, it shall have an intelligent and securely digital door for protecting the personal property and security. With this concept, this thesis proposes an intelligent entrance system in a house.
ACKNOWLEDGEMENTS 這篇論文能夠順利的完成,首先要感謝的是我的指導教授 吳炳飛教授。在交大 的這兩年,吳教授給了我很好的研究環境,以及廣泛電機領域的資源,並且在適時 地給我指導,讓我受益良多,因此增廣不少知識,亦激發出創造力與實作能力,才 能順利完成此論文。 再來是感謝所有 LAB615 實驗室的同學,志旭學長、子萱、小熊、皓昱、宗堯、 映伶、元馨,平日的相處,以及吃飯時間一起悠閒的用餐,都使得我的碩士生涯增 加不少樂趣;課業、計畫案、專業知識的討論與切磋,也讓我的專業知識能更上一 層樓。還有要感謝已經畢業的同學,Sunteen、信元、鐵男、榮煌、祺文、螞蟻,在 在的讓我在交大這兩年留下很多記憶,研究不再枯燥乏味。 另外要感謝我的家人,在這兩年的求學中,他們一直在背後支持著我,關心著 我,讓我感到家中的溫暖。 最後要特別感謝我的愛人張雅婷,在我求學的這兩年,你一直在支持著我,就 算受盡委屈,卻是默默承受,沒有給我一絲的壓力。你是我最重要的精神支柱,亦 是我的避風港。雅婷,我愛你。 僅以本論文 獻給我的愛人,以及我的家人。 3
Table of contents 中文摘要…………………………………………………………………………………………………1 ABTRACT................................................................................................................................................2 ACKNOWLEDGMENTS……………………………………………………………………………...3 TABLE OF CONTENTS……………………………………………………………………………….4 FIGURE LIST…………………………………………………………………………………………..7 TABLE LIST…………………………………………………………………………………………....9 CHAPTER 1 INTRODUCTION ............................................................................
3-1 OVERVIEW............................................................................................................................27 3-1-1 Software Overview..........................................................................................................27 3-1-2 Development Flow..........................................................................................................28 3-2 LINUX KERNEL AND DRIVERS ..........................................................................
5-2 FUTURE WORK .....................................................................................................................76 CHAPTER 6 REFERENCE...........................................................................................................
Figure List FIGURE 1. THE SYSTEM OVERVIEW ......................................................................................................... 11 FIGURE 2. THE OVERVIEW OF THE ENTRANCE SYSTEM...........................................................................13 FIGURE 3. THE STATE DIAGRAM OF THE TWO-TIER IDENTIFICATION ......................................................14 FIGURE 4. THE ALARM OF THE TWO-TIER IDENTIFICATION FUNCTION ...................................................
FIGURE 37. UNICAST ...............................................................................................................................60 FIGURE 38. DSS PLAYLIST CONTROL ......................................................................................................61 FIGURE 39. DSS MP3 BROADCAST .........................................................................................................62 FIGURE 40. WEB CAM WORKING FLOW .........................................................
Table List TABLE 1. VIDEO_CAPABILITY STRUCTURE FIELDS ...................................................................................36 TABLE 2. VIDEO_CHANNEL STRUCTURE FIELDS ......................................................................................37 TABLE 3. VIDEO_MBUF STRUCTURE FIELDS ............................................................................................38 TABLE 4. SDL_INIT FLAGS .......................................................................................
Chapter 1 Introduction The door has been used for thousand years. However, the door evolution was almost in variedly material, ex. the wood door and iron door. The criminal can easily destroy the door or the door lock to entry the house, even the iron door was used in every family. In Taipei (2002), the criminal breaks into a home to steal the property and steal the motorcycles were 89 percent among in thirty thousand cases of criminals stealth in one year.
entertainment with MP3 broadcasting and home gallery. It would be discussed as following sections. 1-1 System Overview Figure 1 shows the overview of the system. The system is an ARM-based platform which had two primary functions, one is an intelligent entrance system and the other is a WiFi entertainment system.
using portable devices. 1-2 The Scenarios The scenarios are shown as following: 1. The families want to open the door to into the house. The families first need enter the password via keypad, and then using the RFID tag[3] (card) near to the RFID reader[4], if identifications are successes, the door would then be opened. 2. The criminal attempt to make a mark on the door. The camera can grab the images from the door outside for motion detection function which then detects the variation of images.
pass the keypad identification. 6. Using WiFi entertainments. If the entrance system is closed by the occupants, than they can use the PDA to play a broadcasting music or viewing the home photos album from WiFi entertainment system. 1-3 Entrance System 1-3-1 Overview Figure 2 shows the overview of the entrance system.
include an RFID reader and keypad whose placement is shown in Figure 2. A user entries the password via keypad for first identification, then second identification is using RFID tags to approach the RFID reader. If the identifications are success then the door would open. The simple state diagram was shown as following. Error Error Keypad enter identification Ok: Door_open() RFID Tag identification Figure 3.
copying key to open the door. 2. When the identification failed three times. If the tag reader program sensed the tag and checked the tag was error three times, or if the password reader program read the keypad and checked the tag was error three times, than the alarm would be invoked. The state diagram was shown in Figure 4. This fundamental is to avoid that the criminals testing the illegal tags or enter passwords many times to attempt to into the house.
the member data for verifying the door opening conditions. 1-3-7 Remote Monitor Function The member of family can use the browser for watching outside of the entrance via internet any time. The entrance system has a web page for providing images from door outside immediately; hence families can watch it any time. 1-4 The WiFi Entertainment System 1-4-1 Overview Figure 5 shows the architecture of the WiFi entertainment system. Media Database E IEE b .
MP3 broadcasting that were described as follows. 1-4-2 Home Gallery The home gallery is the collection of home digital picture which was obtained from home digital camera. The families can use the browser to see the digital photo in home or internet, and can manage it, such as uploading new photos or deleting existing photos. 1-4-3 MP3 broadcasting The MP3 was broadcasted by one user, then the music were broadcasting everywhere in home.
Chapter 2 Implementation of Hardware 2-1 Hardware Overview PCM-7130 Audio Display And Touch screen Speaker DI/DO Flash Disk USB GPIO RS232 StorageARM SA-1110 SA-1111 PC Webcam M318B RFID reader PS2 KeyPad PCMCIA Wireless Card Figure 6. Hardware Overview 2-2 Arm-based Platform 2-2-1 Overview Figure 7 shows the appearance of Arm-based platform, its name is PCM-7130 embedded system which was produced by ADVANTECH[5].
Figure 7. PCM-7130 Embedded System The introduction and features of PCM-7130 were shows as Chapter 5 . 2-2-2 PCM-7130 SBC Figure 8 shows the appearance of PCM-7130 SBC. There are many IOs in the PCM-7130 SBC; in this thesis, the applied IOs are, USB Host, PS/2, Ethernet, RS232, General Purpose Input Output (GPIO), DI/DO, Audio, Touch screen, and LCD. In 2-2-4 System I/O would explain what these IO do.
Figure 8. PCM-7130 SBC The features of PCM-7130 SBC are: CPU SA-1110 Companion Chip SA-1111 SDRAM 64MB Flash 32MB Audio AC'97 audio interface Buzzer for alarm SM Bus Interface Embedded Linux X Embedded Linux kernel V.2.4.18 or above X The Figure 9 shows the block diagram of PCM-7130 SBC.
Figure 9. The Block Diagram of PCM-7130 SBC 2-2-3 System Display The system display includes LCD display and touch panel. The LCD display can show: 1. The image streams which are grabbed from the USB camera for the monitoring situation from door outside by user. 2. The graphic user interface (GUI) for setting up the system options. In addition, the touch panel is an input interface for user who can input the commands via the touch panel for controlling the system.
they are the bridge of various devices which described in 2-3. What devices would connect with the IO and what the devices can be used that would be explained as following in brief: USB Host: This is USB 1.1 version on the SBC, connecting two kinds of devices: USB camera and USB flash disk. PS/2: The PS/2 connects with keypad module for entering the password by the users. Ethernet: For internet connection, and could be connected with home network. The spec. is 10Mb.
computers that can make use of it. The appearance of RFID module included three parts in this thesis. They are RFID board, an antenna and RFID tag. The following figures show the appearance of RFID module. Figure 10. The Appearance of RFID module 1. RFID board: The RFID board would read the RFID tag, into digital information to host via RS232. The specifications of RFID board in this thesis shows as following: Frequency : 13.
3. Tag: The tag is compliant with the ISO/IEC 15693 standard. With a user memory of 2k bits, organized in 64 blocks. The specifications of tag are: Supported Standard ISO 15693-2,-3 Recommended Operating frequency 13.56 MHz Factory programmed Read Only Number (UID) 64 bits Memory (user programmable) 2k bits organized in 64 x 32-bit blocks Data retention time (at +55°C) > 10 years Operating temperature -25°C to +70°C The application of RFID was, reads the UID of tag and identifies it.
The following figure shows the appearances. Figure 12. The Appearance of USB Device 2-3-4 PCMCIA Wireless Card The DWL-650H Wireless LAN (WLAN) PC Card is a direct-sequence (DS) product. DS is a spread spectrum network operating between 2.4 and 2.5 GHz. The DWL-650H WLAN adapter allows PC Card equipped host systems to configure, connect to and establish a wireless network. The appearance of DWL-650H was shown as following: Figure 13.
Low-power operation for battery-powered devices with PC Card slots. Standard NDIS (Network Driver Interface Specification) drivers. Card and Socket Services support. WEP 40- and 128-bit data security. Power management (Continuously Aware Mode (CAM) and Power Save Polling (PSP)). In ESS (802.11 Station) mode, the adapter connects to an access point (AP). In ESS mode, the adapter can roam freely between access point cells in the network or transmit and receive across subnets.
Chapter 3 Implementation of Software 3-1 Overview 3-1-1 Software Overview Notification to Cell Phone Two-tier Identification WiFi Media Streaming Remote Monitor Remote Management Application Layer Motion Detection Reading Image PHP Applications HTTP Server Images Auto Recording Library Layer Video4Linux API SDL DSS/Perl PHP/MySQL JPEG Embedded Linux Kernel OS Layer Driver Layer USB Camera Driver Hardware Layer M318B Webcam Wireless Card Driver PCM-7130 Drivers USB Flash Disk RFID M
developing times and program size of the applications, and be easily for source management. At last, the top layer is application layer which include all of applications in this thesis, and it would be discussed in later chapters.
Windows or minicom in Linux. The execution flow could be consequently observed from the kernel booting up messages by RS232 terminal which was communicated with the console port on PCM-7130, if the result was subsequently success, then the developing loop would end, if not, then the source code need to be modified or fixed. After the modification was done then go to the compilation step. The other was application loop.
z make zImage: Use this command in Linux (the commands in this section was executed in Linux, except downloading commands) to compile the kernel that would consequently generate ‘kernel.img’ in the /$KernelPath/arch/arm/boot path. Maintaining the root file system – Ramdisk z The ADVANTECH had provided an existing ramdisk, named by ramdisk.gz, therefore, the existing ramdisk only need to maintain not create it. z gunzip ramdisk.gz: Use gunzip to uncompress it.
3-2-2 NFS (Network File System) The NFS was developed to allow machines to mount a disk partition on a remote machine as if it were on a local hard drive. This allows fast and seamless sharing of files across a network. The installation steps involved are: Setting up NFS server in Linux z rpm –ivh nfs-utils-1.0.1-3.9.rpm: Use this command to install.
Figure 16. Place of a Device Driver in Linux Figure 16 shows the place of a device driver in Linux relative to the device: User program or utility: A user program, or utility, makes calls on the kernel but never directly calls a device driver. Kernel: The kernel runs in supervisor mode and does not communicate with a device except through calls to a device driver. Device driver: A device driver communicates with a device by reading and writing through a bus to peripheral device registers.
ex. family member data, home photos… etc. 3-3-1 Thttpd, PHP and MySQL Thttpd[8] is an HTTP server, it has the feature as simple, small, portable and fast, and it is suitable in embedded system. PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. And PHP is a server-side scripting language whose primary purpose is to generate HTML content.
Figure 17 shows the functional block and dataflow of the web server. The functional block has three layers: the bottom layer is embedded Linux which includes driver, kernel and some API; the upper layer is a web server which has three items that are Thttpd, PHP and MySQL; the top layer is a user browser, it may be any web browser, including I.E. or web browser of cell phone.
Figure 18. The Functional Block of Camera Applications Figure 18 shows the functional block of USB camera Applications. This figure has three modes (layers), the bottom mode to up mode are kernel mode, driver mode and application mode respectively. The kernel mode is Linux kernel, the driver mode is the USB driver of M318B camera[9], and the application mode include photo grab, photo display, motion detection and top applications notification to cell phone and alarm.
Figure 19 shows the flow chat of photos grabbing, it has five steps, using the Video4Linux was described as following: Open the video device: The hardware devices in Linux would be the files, the video device would be the ‘/dev/video0’ file when the driver started as explained in 3-2-3 .
Set the channel of video device The VIDIOCGCHAN ioctl allows a user to ask about video channels. The M318B has a single camera input. The corresponding VIDIOCSCHAN ioctl allows a user to change channel and to request the norm is changed for example to switch between a PAL or an NTSC format camera. The following C code shows the usage of VIDIOCGCHAN and IDIOCSCHAN. the VIDIOCGCHAN ioctl was call fist to get the videochan structure then using the IDIOCSCHAN ioctl to set the video channel.
if (ioctl (fd, VIDIOCGMBUF, &videombuf) < 0) { perror (" init VIDIOCGMBUF FAILED\n"); } pFramebuffer = (unsigned char *) mmap (0, videombuf.size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); Using VIDIOCGMBUF ioctl to get the structure of videombuf whose structure contents are the following figure, then using the mmap for mapping the video space to processor’s address space. size The number of bytes to map frames The number of frames offsets The offset of each frame Table 3.
Figure 20. mmap interface grabs diagram 1. Get video_mbuf Getting the capabilities of mmap interface is the first thing before using it that was discussed as above. 2. Use mmap() Use the mmap for mapping the video device frames buffers to the kernel buffer which is a big buffer containing video frames, the process address buffer can therefore read the images directly. 3.
CAPTURE CAPTURE CAPTURE CAPTURE frame 1 frame 2 frame 3 frame 4 Process frame 2 Process frame 1 SYNC frame 1 CAPTURE frame 1 SYNC frame 2 CAPTURE frame 2 CAPTURE frame 4 SYNC frame 4 CAPTURE frame 3 SYNC frame 3 Process frame 4 Process frame 3 Figure 21. Reading Image Loop Figure 21 shows the reading image loop.
Figure 22. SDL interface flow chat Displaying the images on the screen (LCD display) is the first thing to do after the image was read. The displaying tools is applied with SDL[11] (Simple DirectMedia Layer) interface (APIs) which is shown in Figure 22, SDL is a cross-platform multimedia library designed to provide low-level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer.
Start Initial SDL Subsystem Update Image on Screen Setup Video Mode Shut Down SDL End Figure 23. SDL usage of displaying on the screen Figure 238 shows the flow chat of SDL displaying image on the screen, it has four steps which were described as below: Initial SDL subsystem SDL composes of eight subsystems - Audio, CDROM, Event Handling, File I/O, Joystick Handling, Threading, Timers and Video. Before you can use any of these subsystems they must be initialized by calling SDL_init.
SDL_INIT_EVENTTHREAD Initializes the event thread. Table 4. SDL_Init flags Setup Video Mode Use SDL_SetVideoMode to set up a video mode with the specified width, height and bits-per-pixel. The following C code shows the usage of SDL_SetVideoMode, which would return a pointer of SDL_Surface structure, the image can then be filled into the pointer pscreen->pixels.
the usage of SDL_UpdateRect as following: SDL_UpdateRect (pscreen, 0, 0, 0, 0); Shut down SDL Use SDL_Quit to shut down SDL. SDL_Quit (); 3-4-4 Motion Detection The motion detection is referenced with PHPMotionDetect[12], the motion detection is on, if the grabbed image is different than the previous image. Then some applications in top layer would be issued if the motion detection is on, ex. auto recorder, notification.
MAD = 1 N ∑∑ S ( x, y ) − S 1 y 2 ( x, y ) x The x, y are the row and column which is a pointer of dot in the image, the N is total dots in the image, the S1 and S2 are image1 and image2, therefore the MAD is the sum of the difference of every dot in image to divide the total dots in the image. The motion detection occurs with four frames around, if the 12 images grabbed in 1 second by M318B, the motion detection then occurs 3 times per second. (The M318B grabs 11 images per sec.) .
detected than the state changes to state 1. 3-4-5 Image Auto Recording The motion images would be recorded to the remote server, when the motion detection occurred. The reason of recording motion images to the remote server is to prevent the inventors break down the system. Figure 26. Conceptual Client/Server Model Figure 26 presents a simple client/server model.
client. Server Response Commands Client Request Commands LOGIN TYPE PASSWORD Image types: JPG, YUV, AVI … OK SIZE ERROR Massage STREAMING BYE QUIT Table 6 Client/Server Commands Server Response Commands z LOGIN, PASSWORD: These commands are for identifying the login user. If login user was wrong, then the server would break the connection. z OK: Responses the client request command was okay. z ERROR Massage: Responses the client request command was error, and the reason.
Linux PCM-7130 Linux PCM-7130 Record Server Record Client Record Server Record Client Request Response AMING Request cmd: STRE Response data: OK Request Response Record Data Record Data Figure 27. The Commands Communication The following Figure 27 illustrates the communication of the server and the client with the commands. The request/response commands are the communication system in this client/server model.
Figure 28 illustrates the record client (PCM-7130) and a record server (Linux) using the TCP/IP protocol stack. The client and server each interact with a protocol in the socket layer of the stack. The procedure of the client images saving to record server when auto recode is issued. 1.
FFmpeg make the jpeg stream to video file with 3gp format for suiting in cell phone. Using the following execution to encode jpeg stream to 3gp video format: ffmpeg –r 11 –i /jpeg_src_dir/%05img.jpg –vcodec mpeg4 /ftp_dir/name.3gp The options: z -r rate: set the frame rate z -i filename: input file name z -vcodec codec: force video codec z last parameter: output file name 3gp is the third generation video standard. It is a file format specially developed for hird generation mobile devices.
PCM-7130 then sent the SMS to cell phone. TwSMS is a SMS sending company in TW. It provides many methods for sending SMS to cell phone by user. Those methods are web interface, mail to SMS and API interface which includes PHP, perl, Java, JSP and ASP. The PCM-7130 used the PHP to send the SMS to cell phone via TwSMS in this thesis. SMS Platform Send SMS 4. PCM-7130 PHP Script TW-SMS 3. 2. HTTP HTTP TCP/IP TCP/IP Low layer Low layer 1.
1. Execute PHP script for sending SMS via HTTP: The PHP script (sms.php) uses HTTP protocol to send the SMS data to 2. TwSMS http server. Execute the php script: z php sms.php: This command would invoke the php to execute the content of sms.php. 3. TwSMS receives the SMS from PCM-7130 via internet: TwSMS may receive the PCM-7130 SMS data if step 2 had been success. 4.
Figure 31. SMS Sending Flow with TwSMS TwSMS provided applications and browser interface for transfering the SMS data to TwSMS, the PCM-7130 used API mode in this thesis. The SMS data was in the input queue first after the SMS data arrived in TwSMS, the TwSMS service platform was then reading the queue and transferring to output queue or in data base if error to sent, if success the SMS would be send to cell phone by operator.
It is simply to control the keypad, just only use ‘read’ system call, the subsequently section therefore only discusses how to control the RFID module. 3-5-2 Controlling the RFID Module To control the RFID module, a user needs to use the following commands to RFID reader. 1. Read a block: Request: 0x1B, ‘r’, block number Response: 0x1B, data byte-count, RspData 0x1B, 0x05, “Fail!” EX: Request: 0x1B, ‘r’, 0x01 Response: 0x1B, 0x05, 0x00, 0x01, 0x02, 0x03, 0x04 2.
0x1B, ‘B’, 0x06 (57600bps) 0x1B, ‘B’, 0x07 (115200bps) Waiting 1 second…. Response: 0x1B, 0x03, “Ok!” EX: Request: 0x1B, ‘B’, 0x06 (change Baud-Rate 57600 bps) Waiting 1 second…. Response: 0x1B, 0x03, “Ok!” The identification with RFID tag can be read the UID and identify it or wrote the identification massages in the tag block then identify with the block read. The UID identify was used in PCM-7130, because the UID is the unique code with the tag in the factory programmed that had more security.
The UID and password are saved in MySQL, so, it need to read before identification loop. The section 3-5-3 would describe in more detail. 3. Two-tier identification loop The double is the keypad password and RFID tag, the state diagram shows as following: Error > 2: Alarm() Error > 2: Alarm() Ok: Door_open() Keypad password identification RFID Tag identification Error < 3 Error < 3 Figure 34.
Field Type ID tinyint(1) Name varchar(20) Password varchar(20) UID varchar(20) State tinyint(1) Table 7. the member table content ID: The id is sequence number which can use in relation with other tables in MySQL. Name: The name of family members. Password: The password is the entry password. For keypad password identification which needs to read this password for comparing the password by the user enters. UID: The UID is the entry tag’s UID.
application execute the php script to get the ‘member’ table in MySQL, then parser the table to obtain the UID, password, and state.
enumerated array. The results $title[$I] and $row[$I] in above php script code are the field and data of field in the ‘Member’ table in MySQL, it can then be used for two-tier identification function. 3-6 WiFi Audio Broadcast Using a streaming server to broadcast the WiFi audio which was applied in this thesis, the streaming server was used the Darwin streaming server (DSS) of Apple[15], it need Perl parser for execution, and the wireless device also need to install in PCM-7130.
Darwin Streaming Server supports both multicast (broadcast) and unicast network transport to deliver streaming media. The multicast transport was used in this thesis: 1. Multicast: Figure 36. Muticast In a multicast, a single stream is shared among the clients (see illustration). Each client "tunes in" to the stream much as a radio tunes in to an FM broadcast. This technique reduces network congestion. The backbone was wireless 802.11b in this thesis. 2. Unicast: Figure 37.
illustration). Many clients connected via unicast to a stream in a local network can result in heavy network traffic. The multicast was therefore used in MP3 broadcasting. The following figure presents the sequence diagram of the DSS playlist control. PC PCM-7130 Browser DSS MP3Broadcaster Login to DSS Identify user result reply Edit the play list result reply Broadcast play List call MP3 broadcasting result reply Figure 38.
DSS and data flow. PDA PCM -7130 M usic Player DSS:M P3Broadcaster M edia request streaming W iFi broadcast play back M edia request streaming W iFi broadcast play back M edia request streaming W iFi broadcast play back . . . . . . . . . Figure 39.
1. /etc/pcmcia/config: Add the following context to /etc/pcmcia/config, the cardmgr references this file to install the driver for DWL-650H. card "D-Link DWL-650H" version "D-Link Corporation", "D-Link DWL-650H 11Mbps WLANAdapter" bind "orinoco_cs" 2. /etc/pcmcia/network.opts: Add the following context to /etc/pcmcia/network.opts, this file is setting the network configuration. The ‘case "$ADDRESS"’ is the MAC address of wireless card, it sets to *.*.*.* which means general case, but the wireless.
The wireless function would be working when the cardmgr identified the DWL-650H and set the all necessary parameters after restarted PCM-7130. 3-7 PHP Applications 3-7-1 MySQL Management - PHPMyAdmin phpMyAdmin[16] can manage a whole MySQL server using the browser.
User Browser Data Requires Web Page Image SimplePHP WebCam Thttpd Web Server Grab image function Embedded Linux Figure 40. Web Cam Working Flow The user connects to SimplePHPWebCam by browser, the web server then invokes the PHP to parser the SimplePHPWebCam, the grab photo function was executed by php script, and it generates an image file for SimplePHPWebCam, PHP consequently sends a web page including an image to user.
Chapter 4 Experimental Results 4-1 System Appearance Figure 41. The System Appearance The above figure (Figure 41) shows the system appearance, the PCM-7130 is an ARM-based embedded system. A keypad and RFID reader is the two-tier identification function and the RFID tag is for entrance. The USB camera is used to image grabbing and the USB flash disk is used to image storage. A speaker can alarm when necessary. Figure 42.
PCMCIA wiresless card, USB connector, PS2 connector for keypad, Ethernet connector for local network (connect to internet via router in this experimental), console connector for a console computer and a RFID reader connection via the connector. 4-2 Entrance System 4-2-1 Grabbing Images and Showing Figure 43. Grabbing Images and Showing on Screen The above figure present the image grabs from a USB camera and shows on the screen. The speed of showing images was between 11 and 13 frames per second.
Figure 45. Show the Images When Motion Detected The image size is 320x240 showing in figure 44, and the display rate is 11~13 frame per sec. 4-2-2 Two-tier identification PCM-7130 RFID Reader USB camera RFID Antana Keypad Figure 46. Appearance of Two-tier Identification Figure 46 shows the appeaeance of two-tier identification.
Figure 47. The Demo of Two-tier Identification Figure 47 shows the demo of two-tier identification, first, input the password via keypad, and second use tag via RDIF antenna. Figure 48. The door open signal Figure 48 shows the door open signal, this LED is on if the door has been open, the LED was used for simulating the door open signal was issued. In the real case, it can control an electronic lock.
4-2-3 Auto Recoding Figure 49. Recoding Server Message Figure 49 shows the recoding server message, the sever receive the jpeg streams to ‘./temp1/’, when the client transmission finished, the connection would be down, the server than applies the ‘ffmpeg’ to encode the jpeg stream to a ‘3gp’ file in /home/gene which is a FTP directory with user ‘gene’. The server provides a FTP server and HTTP file server for users downloading. The users can download the recorded file via a browser or FTP client.
Figure 50 shows the remote monitor by cell phone, the man uses the cell phone to watch the images which was grabs from PCM-7130 embedded system. The following three figures present a cell phone downloading the recorded video form HTTP file server website and playing the recorded video. Figure 51. Cell Phone Connects to HFS Figure 52.
Figure 53. Cell Phone Plays the Record Video 4-3 WiFi Broadcast 4-3-1 Configuration of PDA Wireless Network Figure 54. PDA Wireless Configuration Figure 54 shows the wireless options of PDA, the SSID must be ‘cssplab’, mode must be Ad-Hoc and Channel must set to 1 for connecting to PCM-7130 wireless network.
Figure 55. PDA Wireless Networking IP Configuration Figure 55 shows the IP configuration of PDA wireless network. The IP domain is ‘192.168.0.’ that was same with PCM-7130 wireless networking. The default gateway needs to set the PCM-7130 wireless IP for Ad-Hoc networking. The following figure shows the PDA connects to MP3 broadcaster server. The URL is http://192.168.0.2:8000/MP3test. Figure 56.
Figure 57. Playing the Broadcasting Music via PDA Figure 57 presents the PDA plays the broadcasting music. The PDA would play the broadcasting music when the ‘play’ button was pressed. 4-4 Summary The system RAM of embedded system is 64MB in this thesis. The Linux kernel and ramdisk (root file system) used 21 MB of system RAM when the embedded system started, therefore the free system memory is 43MB.
Webpage —PHP Administrator 4500 60 Table 8. The System Resource Usage of Entrance System Table 8 show the system resource usage of entrance system, the total memory usage is 20MB. The system then has 20MB free memory for Linux kernel working. The CPU usage is over 100% that would be solved by below methods: 1.
Chapter 5 Conclusion and Future Work 5-1 Conclusion This thesis presents a design and implementation of hardware and software to solve a security less problem with traditional door in home, and provide a WiFi entertainment. The hardware implementation develops an embedded system and integrates the RFID module, camera, storage and a wireless card that is stand-alone system. The software implementation develops an entrance system and WiFi entertainment to provide the security and entertainment in home.
1. The encryption type of RFID. 2. Reduce the system source usage of MySQL. 3. Friendly GUI and easily setup. 4. Bigger images size grabbing and higher frame rate. 5. Hardware video encoding to replace the software JPEG encoding. 6. Video WiFi streaming.
Chapter 6 Reference [1] http://www.RFID.org [2] http://www.wi-fi.org [3] http://www.ti.com/tiris/default.htm?DCMP=TIHomeTracking&HQS=Other +OT+home_tirfid [4] http://www.smtco.com.tw/big5/RFID_index.htm [5] http://www.advantech.com/ [6] http://www.php.com/ [7] http://www.mysql.com/ [8] http://www.acme.com/software/thttpd/ [9] http://mxhaard.free.fr/index.html [10] http://linux.bytesex.org/v4l2/API.html [11] http://www.libsdl.org/index.php [12] http://phpmotiondetect.sourceforge.net/ [13] http://www.cs.ccu.