Project Description
Surveillance system by real-time camera is a very useful. You can build it by your own by implement OpenWrt on ASUS router. This tutorial provides the way of turning your simple webcam to be able to detect the motion in your house when you go outside. It will notify you if detects something.
Hardware Tools
- Laptop running Ubuntu OS
- ASUS WL-500gP V2 Router
- Simple Webcam
- USB flashdrive
- LAN wire
To build this system, there are 4 steps below. I am going to provide the detail for step 1 in this post.
1. Install OpenWrt kernel 2.6 firmware into router.
2. Add Device drivers for USB interface, USB flashdrive, and USB webcam into OpenWrt
3. Add FAT32 filesystem, NTP client and SMTP service into OpenWrt
4. Install motion detection software into OpenWrt.
Step 1: Install OpenWrt kernel 2.6 firmware into router.
Regarding above figure, embedded system consists of three major parts. Bootloader is essential for booting the system. Then, kernel takeovers to manages the system's hardware and provide root file system which is the interface between human and system. In this tutorial, Bootloader is already installed in WL500gpV2 router from factory. What I have to do is to add kernel and Rootfile system into it. That's why I need OpenWrt firmware which provides both two additional parts.
Let start
1. On Ubuntu, run Terminal window and install the essential programs required in building OpenWrt firmware.
2. Make a new directory for keeping Openwrt, then download the source code by using SVN.
3. After finishing download, go to check folder /openwrt/trunk .
4. type make menuconfig , then the configuration window is shown.
In this tutorial I want to use openwrt version 2.6. So, I enter at the Target Sytem option show as above figure. The new window is appeared as figure below. Then, Broadcom BCM947xx/953xx is selected.
5. exit the configuration window and compile source code by typing Make V=99 on laptop terminal. The figure below shows the example of doing so.
6. After compiling is finished, check the folder /openwrt/trunk . There is a folder calleed bin/brcm47xx. Go inside, the firmware is there. Its name is openwrt-brcm47xx-squashfs.trx .
So far, we have a firmware and want to install this firmware to the router.
Let start.
1. on laptop, install tftp by typing sudo apt-get install tptp .
2. disable laptop's network
3. connect the LAN cable from Laptop to WL500gpV2 router.
4. use your pen to press restoration button located at the back of WL500gpV2. Then, plug the adapter power of WL500gpV2. Wait until the led at the front becomes flashing. This status shows us that the router is in factory mode in which its IP is currently 182.168.1.1 .
5. on laptop, typing the command shows as figure below to config laptop's IP to become 192.168.1.5.
6. ping router to check if there is a connection between laptop and router.
7. Go to the folder which keep the OpenWrt firmware, then types the commands show as figure below to transfer firmware image to router.
8. If you have the same messages below. It means the firmware is successfully installed on the router. Wait 2-3 minutes for router's self reset.
9. after finishing step 8, take off the adapter power of router, wait approximately 20 seconds, then plug it again.
10. do the reverse process in step 2 to enable laptop network.
11. type telnet 192.168.1.1 on laptop terminal. Now, we are able to communicate with the router in which OpenWrt is installed.
The detail of step 2: Add Device drivers for USB interface, USB flashdrive, and USB webcam into OpenWrt is coming soon.