บทความที่ได้รับความนิยม

วันพฤหัสบดีที่ 27 พฤศจิกายน พ.ศ. 2557

Security Monitoring by Simple Webcam with OpenWrt (Part 2)

Step 2 - 1 : Add Device drivers for USB interface, USB flash-drive, and USB webcam into OpenWrt 

In previous tutorial, I showed how to communicate to the router. But it is not safety enough since there is no password yet. So, anybody can access to this system. What I need is to set a password. Once there is the password, telnet cannot be longer used and putty tool will be used to take over this task.

1. in telnet, types passwd, then put your new password and retype to confirm. Exit from telnet by typing exit 




2. On terminal of Ubuntu laptop, install putty tool by typing  sudo apt-get install putty

3. After stalling, type putty , the configuration window will be showed as figure below. Set IP address = 191.168.1.1 and Port = 22, then press Open button.





4. If there is a putty security alert, press accept button.






5. It asks you to input the login and password. After filling out, the OpenWrt welcome page is shown.




6. Type vi /etc/config/network to use the editor of linux which is vi to edit the file "network" in folder /etc/config/. Figure below shows the original content of network file.



7. Change IP of WL500gpV2 router to be 192.168.2.1 



8. type exit to quite putty 

9. plug out the adapter of WL500gpV2 router and wait ~20 second, then plug in again.

10. connect router by using putty, but set IP = 192.168.2.1

11. connect WAN port of WL500gpV2 router with the LAN  can to the another router which is being connect with internet network. This is the reason of changing the IP of WL500gpV2 router to be 192.168.2.1, as the another router connected with internet is normally configured with  192.168.1.1 

12. Test the router WL500gpV2 if it is able to connect to internet by typing 
ping www.google.com . Figure below show the successful case.





Please wait for the end part of the step 2 in next post.

วันอาทิตย์ที่ 23 พฤศจิกายน พ.ศ. 2557

Smart Farm by Wireless Sensor Network and TinyOS (Part 1)

Project Description

The system I am going to demonstrate here is Smart Farm System. Its overview is shown as figure below. First, wireless sensor nodes read the 3 climate data which are temperature, humidity and light density from the sensor and also read the on/off status of water pump controller connected to the IO pin of the node. After reading data, the node send these values to the base station (BS) node which acts as a gateway to forward the data to the Router. Then the scripts written and installed in router respond to convert the raw data obtained from the gateway to the suitable form and then put them to Database. The web server and PHP module which have been installed in router provides the ability in designing web user interface. There are three interfaces in this system: the climate report interface which retrieve the current climate data from Database to show the farmer, the climate analysis interface that provides the useful statistic climate information to help the farmer to make a decision in managing the farm. The last interface, pump control, provides the way to the farmer for turning on/off the water pump.




Postcondition
1.Farmer can use browser to view :
1.1. Climate Report.
1.2. Climate Analysis
1.3. Water Pump On/Off status.
2.Farmer can use browser to on/off water pump.

More tutorials for this system are coming soon.

Security Monitoring by Simple Webcam with OpenWrt (Part 1)

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
  1. Laptop running Ubuntu OS
  2. ASUS WL-500gP V2 Router
  3. Simple Webcam 
  4. USB flashdrive
  5. 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.












First, I have to build a firmware from a source by referring this Link http://wiki.openwrt.org/doc/howto/buildroot .
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.