Sunday, 29 July 2012 11:04

Control Arduino via PHP (EasyPHP)

The Arduino Duemilanove (not Arduino Uno) is control by a computer over the network or internet via PHP. This article assumed that you already install WAMP web server & Arduino driver in your computer.

My Arduino Duemilanove is connecting to the USB port of my computer, the USB serial com port is detected as COM4.

Published in Blog
Sunday, 29 July 2012 10:55

EasyPHP Web Server (WinXP)

WampServer is my favorite personal local web server before my Sony Vios notebook get spoil. Now I switch to EasyPHP due to WampServer is not running on my new Toshiba notebook.

I had do a research before I stick into one particular web server software, here you can get some web server information. After study some post from internet & tested myself. Finally EasyPHP is my choice.

 

EasyPHP is a wonderful WAMP server application. With EasyPHP, you will have PHP,   MySQL , Apache,  PhpMyAdmin, Xdebug on your computer.   

I start using EasyPHP from version 5.3.9. Now it is EASYPHP 12.0 and there is three different PHP version including in EASYPHP 12.0:

Published in Blog
Sunday, 29 July 2012 09:57

Run Android 2.3 on VirtualBox

This guide is based on Android 2.3 (Gingerbread)  & VirtualBox 4.1.8 running on Microsoft Windows XP.

I choose Android 2.3 because I own a Samsung GALAXY Y (S5360) hand phone which preloaded with Android 2.3. I always test the applications on my computer before I download to the hand phone.

Published in Blog

Fun_plug is a collection of applications compiled and packaged by fonz. fun_plug is install on top of D-Link firmware. It is much more powerful than the D-Link original firmware. The following modules is install by default:

  • Lighttpd – a lightweight HTTP server for hosting web pages on the NAS
  • OpenSSH – Secure Shell (which you already used to login to the NAS)
  • Mediatomb – a UPnP media server (alternative to the one provided by Conceptronic)
  • NTP – Network Time Daemon (to synchronize the NAS’ clock with accurate time servers on the Internet)
  • UNFS3 – user-space NFS server (a file server protocol which is often used by computers running Linux)
  • NFS-Utils – NFS server (efficient file transfer and synchronization utility)

This guide is based on fun_plug 0.5 & D-Link DNS-320 ShareCenter and assumes an SATA hard disk is installing to the DNS-320 ShareCenter formatted as ext3.

Published in Blog
This is a guide on how to restore from DD-WRT to the original stock firmware. The router that I'm using is TP-Link TL-WR1043 Ver 1.8. 
 
Download
 
Software required
  • WinSCP is an open source free SFTP client, SCP client, FTPS client and FTP client for Windows. Its main function is file transfer between a local and a remote computer. I use this sofware to transfer files from my WinXP computer to the router.
  • PuTTY is a free implementation of Telnet and SSH for Windows and Unix platforms. I use this software to SSH to router & perform flashing command. 
 
Enable SSH
  1. Open up a browser and navigate to http://192.168.1.1 (you should use your own IP)
  2. Login in to DD-WRT.
  3. Goto Services tab and enable SSH
  4. Goto Administration/Management and enable SSH

Copy firmware file to Router

  1. Unzip the downloaded firmware file to any folder, now you have wr1043nv1_en_3_13_10_up(120210).bin in your computer
  2. Run WinSCP
  3. Transfer wr1043nv1_en_3_13_10_up(120210).bin to /tmp of router
  4. You may want to rename the firmware filename to shorter one, I renamed it to a.bin

Start Flashing
  • Run PuTTY (SSH to router)
  • Enter command as blow

cd /tmp

mtd -r write a.bin linux

The router will reboot upon flashing successfully

Published in Blog
Sunday, 29 July 2012 08:56

DD-WRT on TP-Link TL-WR740N Router

The TP-Link TL-WR740N router use in this tutorial is Ver 4.22. Make sure you download the correct version of firmware. Flashing wrong version firmware will brick the router.

Here is the link. You must download both factory-to-ddwrt.bin & tl-wr740nv4-webflash.bin.


You must upgrade to factory-to-ddwrt.bin before you flash tl-wr740nv4-webflash.bin.

1. Enter 192.168.1.1 from IE to login to the router. Select System Tools then click on Firmware Upgrade.
2. Choose  factory-to-ddwrt.bin which you download to your computer previously.
3. Click Upgrade button to start firmware upgrading.
4. The router will restart automatically after completed upgrade.

Screen shot for upgrade firmware: http://www.divshare.com/download/18183284-fed


5. Login to router again. Now DD-WRT prompt you for changing user name & password.
6. Enter the new router user name & password then click on Change Password button.
7. Enter new user name & password to login to the router.
8. Click on Administration from DD-WRT menu then select Firmware Upgrade.
9. Choose tl-wr740nv4-webflash.bin & click on Upgrade button

The router will upgrade to DD-WRT dated 03-19-12-r18777 which is much more powerful than before.

Published in Blog

The Arduino is plug into the USB port of TP-LINK TL-WR1043ND allow the router to control the Arduino.

After upgrade router firmware to Openwrt, Login to it & change the password in order to enable SSH.

SSH to the Router

  1. Run PuTTy
  2. Enter 192.168.1.1 for Host Name (this is the default IP for Openwrt set in TL-WR1043ND)
  3. Change connection type to SSH
  4. Click on Open button
  5. Enter your router username (username is root if you didn't change it)
  6. Enter your password
Published in Blog
Saturday, 28 July 2012 16:34

HTML Onclick Image Button with CSS

This is a tutorial to show image button on webpage, it use CSS.
See http://www.w3schools.com/css/default.asp for more information.

Below is an example to show two image buttons. <div class="img"> is the CSS, it is not define in this example, but it is working without any CSS style.

</html>
</body>
<div >
<a target="_parent" href="/newWebPage.php"><img src="/images/light_on.png" alt="Light1" /></a>
<a href="javascript:runCmd(1,'a')"><img src="/images/fan_on.png" alt="Fan1" /></a>
</div>

<div >
<a target="_parent" href="/newWebPage.php"><img src="/images/light_off.png" alt="Light2" /></a>
<a href="javascript:runCmd(1,'a')"><img src="/images/fan_off.png" alt="Fan2" /></a>
</div>
</body>
</html>

 

Published in Tutorials
Saturday, 28 July 2012 16:33

HTML Onclick Button Image

There is few ways to show image button on the webpage. Here I use <a.

<a target="_parent" href="/newWebPage.php"><img src="/images/light_on.png" alt="Light" /></a>


Above example shows an image with event. newWebPage.php will open if user click on the image.

  1. target="_parent" means open a new page when user click on the image. See http://www.w3schools.com/tags/att_a_target.asp for more information
  2. href= is the action. It will open newWebPage.php when user click on the image.
  3. img src= show the image on the page. It support many formats such as png, jpg, gif, bmp & others. I often use png & gif (animation) format since both support transparent.
  4. alt= will show the text if the associated image is not exist.

 

Note: IE8 and Google Chrome show output differently. There is a rectangular frame around the image if loaded with IE8, while Google Chrome did not show any frame.

Below example execute a javascript function called runCmd with two parameters:

<a href="javascript:runCmd(1,'a')"><img src="/images/fan_on.png" alt="Fan" /></a>



See http://www.w3schools.com/tags/tag_a.asp for more information on how to use <a

Below example shows four images aligned in horizontally:

<a target="_parent" href="/newWebPage.php"><img src="/images/light_on.png" alt="Light" /></a>
<a href="javascript:runCmd(1,'a')"><img src="/images/fan_on.png" alt="Fan" /></a>
<a target="_parent" href="/newWebPage.php"><img src="/images/light_on.png" alt="Light" /></a>
<a href="javascript:runCmd(1,'a')"><img src="/images/fan_on.png" alt="Fan" /></a>

Published in Tutorials
Thursday, 26 July 2012 23:12

Openwrt on TP-Link TL-WR1043ND Router

OpenWrt is a highly extensible GNU/Linux distribution for embedded devices. After upgrade your router to OpenWRT, your router will become much more powerful (more features) than before.
Published in Blog
Back to Top