I need a server which is able to setup the Mosquitto MQTT Broker, this server have to be handle MQTT connections with clients and capable to save MQTT data (payload) into database.

The server also act as a File Server and Web Server where I can upload photos via HTTP Post.

After reading some posts and research, it looks like the Synology NAS having all the features for me to setup the said server. Therefore I decided to choose the Synology DS216j NAS for this project.

Published in Blog

This is my experience about how to create webpages & setup my personal website using the CMS (Content Management System) software. My website is 4 years old now, during this time, I learn how to upgrade my website, improve the webpages loading speed, remove virus/malware from website, and a lot more.....SEO, Google Analytic, Google Adsense, Google Captcha, Google PageSpeed Insights, Google Search Console. 

Published in Blog
Saturday, 20 August 2016 17:49

Makeblock 3-in-1 mBot Ranger Robot Kit

Makeblock 3 in 1 mBot Ranger Robot Kit is a three-in-one STEM (Science, Technology, Engineering & Mathematics) Educational robot kit which offers the ability to create a Robot Tank, Three-Wheeled Racing Car and a Self-Balance Car. You can program and control the mBot Ranger via iPad, tablets or laptop.

I get my mBot Ranger Robot Kit from GearBest, the price of the kit is $134.87.

Published in Blog

2 wheel motor library for Lua running on wireless route

This is a motor library for Lua running on wireless router which flashed with OpenWrt firmware. It allows a wireless router control the motors without using micro-controller. This library works on any dual-full-bridge driver such as L298.

Each motor require two GPIOs for controlling, therefore 2 motors will use up 4 GPIOs. Most of the wireless router may not have enough GPIO to control the motors, but you can use other pin on the router such as the LED pin, this require to unload the leds_gpio module.

Published in Blog
Sunday, 20 September 2015 22:15

Compiling OpenWrt from source

Compiling OpenWrt from source

To compile OpenWrt from source, you need a computer running Linux such as Ubuntu. If you are like me and don't have a Linux computer, you can still use your Windows computer to compile OpenWrt.

In order to run Linux on a Windows, you must install virtual machine on you computer. Virtual machines allow you to run any operating system in a window on your desktop, I'm using the free VirtualBox for my case, please read here for details.

Published in Tutorials
Wednesday, 16 September 2015 21:37

Running Ubuntu On Windows

Running Ubuntu On Windows

I'm a Windows user and I always play with Linux on embedded system. Therefore I need a computer which is effective exchange of information between Windows OS & Linux OS.

This article provides information on how to install Ubuntu on Oracle VirtualBox with the following features:

  1. Run both Linux(Ubuntu) and Windows together.
  2. Sharing clipboard content between OS
  3. File sharing between OS
  4. Internet connection sharing
Published in Blog

GPIO Read Write Functions for Lua

This is a very simple GPIO read/write functions for Lua running on linux-based embedded system, it is based on Arduino digital input/output syntax.

Only four functions are available: pinMode, digitalWrite, digitalRead & delay

Update: Added pin_direction_status() function on 16 Oct 2015

Published in Blog

Ubidots real time data monitoring

In my projects I needed a tool to monitor data in real time, the data is captured by a microcontroller and uploaded to the web using a wireless router. Initially I was trying to use yeelink since it is in chinese langguage and yet I'm a Malaysian Chinese.

One month ago, I have tried with Ubidots, there were a few things that caught my eye.

Published in Projects
Sunday, 17 May 2015 10:53

BASH Dropbox Uploader on OpenWRT

BASH Dropbox uploader on OpenWRT

This guide is to provide detailed information on how install BASH Dropbox Uploader to a wireless router flashed with OpenWRT. Dropbox Uploader is a BASH script written by Andred Fabriz that allows you to upload, download, delete files (and more) from Dropbox.

Published in Blog
Sunday, 04 May 2014 20:43

Setup a Raspberry Pi PHP web server

Lighttpd is a lightweight web server, with all the essential functions of a web server, PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language. This is a quide on how to install Lighttpd and PHP on a Raspberry Pi.
 
Prerequisite
Published in Blog
Sunday, 04 May 2014 11:02

Some useful javascript

Some useful javascript
Create an XML HTTP Request (XHR) object
  1. function create_XMLHttpRequest() { //create new XHR object
  2. if (window.XMLHttpRequest)
  3. {// code for IE7+, Firefox, Chrome, Opera, Safari
  4. xmlhttp=new XMLHttpRequest();
  5. } else {// code for IE6, IE5
  6. xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  7. }
  8. return xmlhttp;
  9. }
 
 
Send request to Server and receive response from server
  • Get replay from php web server: serverResponseInfo=httpGetRequest("http://domain/myReply.php")
  • Read content from a text file: serverResponseInfo=httpGetRequest("myTextFile.txt")
  • Read content from a text file: document.getElementById("myDiv").innerHTML=loadXMLDoc("myTextFile.txt");
function httpGetRequest(url)
{
   xmlhttp= create_XMLHttpRequest();
   xmlhttp.open("GET",url,false);
   xmlhttp.send();
   return xmlhttp.responseText;
}
 
 
Check if file exist
  • To check a file if exist in www root directory: fileExists("/settings.xml")
  • To check a file if exist in the current directory: fileExists("settings.xml")
  1. function fileExists(filename) {
  2. xmlhttp= create_XMLHttpRequest(); //create new XHR object
  3. if(!xmlhttp) return false;
  4. try
  5. {
  6. xmlhttp.open("HEAD", filename, false);
  7. xmlhttp.send(null);
  8. return (xmlhttp.status==200) ? true : false;
  9. }
  10. catch(er)
  11. {
  12. return false;
  13. }
  14. }
 
 
Load an XML file using XML HTTP Request
Eg. loadXML("settings.xml")
  1. function loadXML(XML_filename) {
  2. xmlhttp= create_XMLHttpRequest();
  3. xmlhttp.open("GET",XML_filename ,false);
  4. xmlhttp.send();
  5. return xmlhttp.responseXML;
  6. }
 
 
Convert XML to string
  1. function xmlToString(xmlDoc){
  2. if(xmlDoc.xml){
  3. // MSIE
  4. xmlString = xmlDoc.xml;
  5. }else{
  6. xmlString = (new XMLSerializer).serializeToString(xmlDoc);
  7. }
  8. return xmlString;
  9. }
 
 
Create a string based on date
Example of output: 2014_0502
  1. function createString_accordingDate() {
  2. var today = new Date();
  3. var dd = today.getDate();
  4. var mm = today.getMonth()+1;//January is 0!
  5. var yyyy = today.getFullYear();
  6. if(dd<10){dd='0'+dd} ;
  7. if(mm<10){mm='0'+mm};
  8. return (yyyy + "_" + mm + dd);
  9. }
.
Published in Tutorials
 
TPicShow is an image slider VCL that enables you to create amazing splash screens and 176 transitional effects in pure Delphi code.
 
Features:
  1. Image transition can be controlled programmatically
  2. Image can be stretched or centered in the client area of the control
  3. Control can show a background image as centered, stretched, or tiled
  4. Transition process can use a separate thread
  5. New transitional effects can be easily implemented and added.
 
TPicShow's last update is on July 19, 2010 which does not support RAD Studio XE. By creating a package file, you can installing and running TPicShow on RAD Studio XE5 without any problem.
 
Published in Blog
Friday, 27 September 2013 20:40

Arduino BIT manipulations

Code below set third pin to HIGH without changing the state of any of the other pins
bitSet syntax: bitSet(x, n)
  • x: the numeric variable whose bit to set
  • n: which bit to set, starting at 0 for the least-significant (rightmost) bit

//initialized all pins to LOW
byte pinState = B00000000;

//set the third pin high
bitSet(pinState, 2); //pinState = B00000100

 
  
Code below set third pin to LOW without changing the state of any of the other pins
bitClear syntax: bitClear(x, n)
  • x: the numeric variable whose bit to clear
  • n: which bit to clear, starting at 0 for the least-significant (rightmost) bit

//initialized all pins to HIGH
byte pinState = B11111111;

//set the third pin LOW
bitClear(pinState, 2); //pinState = B11111011

 
 
Code below set each pin as LOW or HIGH without changing the state of any of the other pins
bitWrite Syntax: bitWrite(x, n, b)
  • x: the numeric variable to which to write
  • n: which bit of the number to write, starting at 0 for the least-significant (rightmost) bit
  • b: the value to write to the bit (0 or 1)
byte pinState= 0; //initialized all pins to LOW (B00000000)
bitWrite(pinState, 0, HIGH); //set first pin to HIGH, pinState = B00000001
bitWrite(pinState, 3, HIGH); //set third pin to HIGH, pinState = B00001001
bitWrite(pinState, 0, LOW); //set first pin to LOW, pinState = B00001000
 
 
Reads a bit of a number.
bitRead Syntax: bitRead(x, n)
  • x: the number from which to read
  • n: which bit to read, starting at 0 for the least-significant (rightmost) bit

byte pinState = B10101010;
for (int i=0; i<8; i++) {
   theBit = bitRead(pinState, i);
}

 

 

Published in Tutorials
Saturday, 20 July 2013 22:31

DIYLC电子绘图软件

DIYCL V3
DIYLC (DIY Layout Creato)是电子爱好者用来设计电路图的绘图软件,它可以设计原理电路图(Schematic)、洞洞电板路板(Strip board)、面包电路板等(Breadboard)。
 
DIYLC是一个免费与开源软件现在是3.27.0,应该是正式使用版本了。今天试用了这版本,感觉比之前的旧版本好用了许多,很适合初学者,所以决定在此与大家分享一下。
Published in 电子与电脑
Aarduino communicate with Vixen
Vixen is a free and popular light show creator software. With a PC and some hardware, anyone can have a professional-looking lighting display synchronized to music.
 
The latest version is Vixen3, the most attractive feature is supported for preview. Compare to Vixen2, Vixen3 is a bit difficult to use & lack of some features in Vixen2. Please correct me if I'm wrong.
 
This tutorial is based on Vixen2, please download Vixen2 and install it to your computer. Prior to Vixen2, you must have install Microsot.NET Framework 2.0 in your computer.
Published in Blog
Sunday, 10 February 2013 19:03

Develop Android Application without Coding

App Inventor is an application use to develop Android application without programming. Its graphical interface is very similar to Scratch   that allow users to drag and drop visual objects to develop application which runs on many mobile devices.

Google released App Inventor on  December 15, 2010 and terminated as the Google product on August 2011. App Inventor is maintained by Massachusetts Institute of Technology and the code is become "Open Source".
Published in Blog
Sunday, 03 February 2013 18:35

Backing Up Raspberry Pi SD card

  • Insert SD card to computer
  • Launch Win32 Disk Imager
  • Select Device (source) which you want to backup from
  • Under Image File, give it a file name as shown in figure below
Backup Raspberry Pi SD card
 
  • Click Read button to start backing up
  • As shown in figure below, the image file size is equivalent to the size of SD card since I had resized the partition of my SD card
After Backup
Published in Tutorials
Monday, 28 January 2013 23:20

Gambas for Raspberry Pi

Gambas is a BASIC interpreter which is very similar to Visual Basic but running on Linux. Gambas from version 3.2 can run on Raspberry Pi and Gambas3 for Raspberry Pi image file is available here.
 
 
Installation
  • After download the image file (it is zipped), extract it to any location of computer. Now your computer should have an image file named as 2012-07-15-wheezy-gambas3.img
  • Write this img file to SD card using Win32DiskImager as describe in this article
  • Remove the SD card from computer once writing completed
  • Insert the SD card to Raspberry Pi & power on it.
  • Remote access to Raspberry using TightVNC as describe in this article
  • You should see Gambas icon appear on the desktop screen.
  • To start Gambas3, click the first icon at the left bottom screen then select Programming>Gambas3

People find that they are facing 100% CPU usage when using Gambas3, you can use the patch to overcome this problem.

Published in Blog
Sunday, 27 January 2013 22:19

TinyBASIC for Raspberry Pi

TinyBASIC is a simple BASIC interpreter which allow beginners to easily get into programming
 
Installing
You need to install libsdl-gfx1.2-4 package before install TinyBASIC. 
  • SSH to Raspberry Pi and execute command below:
sudo apt-get install libsdl-gfx1.2-4
  • Download TinyBASIC deb file and save it to any location of computer
  • Transfer the downloaded deb file from computer to /tmp folder of Raspberry Pi using WinSCP
  • Execute command below to start install TinyBasic
sudo dpkg -i /tmp/tinybasic_2.1-1_armhf.deb
Published in Blog
Saturday, 19 January 2013 20:28

Virtualbox Raspberry Pi Emulator

Would like to have Raspberry Pi experience before you own one of the boards? This article show you how to use VirtualBox as a emulator of Raspberry Pi
 
 
Prerequisite
VirtualBox running in Ms Windows

Download

  • Download the zip file and extract the included torrent file to any folder
  • Open the torrent file with any torrent client. I'm using flashget to open the torrent file.
  • The download should start.
  • You will have a 658,763KB ova file upon completion of downloading
Published in Blog
Friday, 02 November 2012 23:55

免费屏幕捕获软件--Screenshot Captor

一个非常好用的免费屏幕捕获软件,下载和安装Screenshot Captor后,它必须激活。注册一个免费帐户,你就将会得到一个激活密钥。Screenshot Captor可以使用不同的方式来捕获屏幕,如图下:

Published in 软件
Sunday, 21 October 2012 23:16

多功能格式转换软件--PdfCreator

很多时後,我们要把文件转换成pdf或者jpg以方便email。免费软件PdfCreator可以满足你的需求。虽然软件名称是PdfCreator,但並非只转换pdf。凡是可以在Ms Windows里打印的文件,不管Ms Word, Ms Excel, Ms Power Point,Photoshop,都可以转换成以下格式:

PDF,PNG,JPEG,BMP,PCX,TIFF,PS,EPS,TXT,PSD,PCL,Raw,SVG  

Published in 软件
Tuesday, 25 September 2012 20:53

Wireless Router Home Automation

This project eliminate the use of an expensive Wifi/Network Shield but still able to control home appliances from any where. You may already own a wireless router which support OpenWRT or else you can get a very cheap wireless router such as WR703N for this project.
 
In order to eliminate install many packages on the router, I am using HTML and Javascript for the web interface, while hardware interface is using Lua which is come with OpenWRT. The whole process is just install a serial driver (see step below) to make the instruction simple & keep the router free of resources.
Published in Projects
Friday, 21 September 2012 10:45

Lua sleep function in milliseconds

Lua Socekt must be use in order to call sleep function in milliseconds.

An example to install Lua Socket to OpenWRT

opkg update
opkg install luasocket

 

An example to sleep 10 milliseconds

require "socket"
socket.sleep(0.010)

 

Lua can only sleep/wait in seconds (not milliseconds) without install Lua Socket. Code below shows the sleep funciton.

function delay_s(delay)
   delay = delay or 1
   local time_to = os.time() + delay
   while os.time() < time_to do end
end

 

Example to sleep 5 seconds

delay_s(5)

 

 

Published in Tutorials
Saturday, 08 September 2012 19:20

D-LINK DNS-320 Firmware Upgrade from 2.00 to 2.02

I read a post about the D-LINK DNS-320 firmware version. It shows that there is new version released from D-LINK website. So I decided to give a try.
 
Download
Make sure backup all data before firmware upgrade. After upgrade the firmware, the DNS-320 performance become very slow. I had to re-format the HDD and install software again in order to solve the problem.
Published in Blog
Friday, 07 September 2012 23:01

OpenWRT in Client Mode

Client mode uses its wireless connection as the WAN interface, and shares the internet connection only to the LAN ports. It is not seen as an access point by laptops or other computers scanning for AP's and does not accept wireless connections from client devices.
 
As shown in figure below, the new SSID (wwan) cannot be seen by other client devices nor accept wireless connection from client devices. Therefore the client devices (Notebook3 and Notebook4) must connect to the Wifi router using network cable.
Published in Blog
Sunday, 02 September 2012 17:49

Fun_plug 0.7 on D-LINK DNS-320 ShareCenter

This article provide the step to install fun_plug 0.7 on D-LINK DNS-320 ShareCenter. Fun_plug allows user to start additional programs and tools on the NAS.
 
Pre-installation Requirements
  • D-LINK DNS-320 ShareCenter
  • Hard Disk Configure as Volume_1: Standard as shown in figure below
Published in Blog
This is an article to guide you on how to use a webcam attach to a router and act as an IP camera. At the end of the article, it show you how to adding authentication to the project.
 
 Prerequisites
Published in Blog
Wednesday, 22 August 2012 15:49

OpenWRT in VirtualBox

If you are considering to test OpenWRT without a router or you don’t want to flash the router firmware over and over again. Here is the right place for you.

OpenWRT in VirtualBox is an image file run in VirtualBox. By the time I write this article, the VirtualBox & OpenWRT image version are Ver 4.1.20 and 10.03.1 respectively. 

Published in Blog

Samba is a free software re-implementation of the SMB/CIFS networking protocol, Samba provides file and print services for various Microsoft Windows clients.

First, this assumes that you already have OpenWRT installed. Read this article if you haven't upgrade firmware to OpenWRT.

Second, you must have a working USB flash drive attach to router. Read here for installing USB flash drive.

Published in Blog

FTP is a method of transmitting or recieving files across the Internet and stands for File Transfer Protocol. This article guide you on how to enable FTP  function on the OpenWRT router.

It is assumed that the router is flashed with OpenWRT. See this article if you haven't upgrade firmware to Openwrt.

Published in Blog
The more packages you install on your OpenWRT, the more space you need. It's useful to extend the storage capacity of your USB enabled OpenWRT router.
 
This article explain how to use a flash drive as a storage installing in TP-LINK TL-WR1043ND router. It is assumed that the router is flashed with OpenWRT. See this article if you haven't upgrade firmware to Openwrt.
Published in Blog
Sunday, 19 August 2012 12:13

16 Output Arduino Controller

The is a sketch for Arduino to communicate with computer or embedded device (eg. wireless router) using serial communication.
 
Arduino Duemilanove have 14 digital IO pins (2 digital IO used by serial) and 6 analog IO pins. Here I coded the analog IO as digital IO, so we can easily get 16 digital IO.
Published in Projects
Saturday, 18 August 2012 18:42

WinSCP (Windows Secure CoPy)

WinSCP is an open source free SFTP client, SCP client, FTPS client and FTP client for Windows.

Most people use vi as the text editor during configuration of embedded device. I hate to use vi, in which I have to memorize all the commands. Whereas WinSCP is a GUI (Graphical User Interface) program where you can edit your file like notepad. Additionally you can use WinSCP to download and upload files including settings of permission.

TP_LINK TL-WRT1043ND router and OpenWRT is use in this tutorial.

Published in Blog
Thursday, 16 August 2012 14:40

Integrating PuTTY in WinSCP

Most of the time, I use both WinSCP (Windows Secure CoPy) & PuTTY together, especially when work with Openwrt and DD-Wrt. It is very troublesome to start each program individually. So I decided to integrate PuTTY into WinSCP.

 

WinSCP is an open source free SFTP client, SCP client, FTPS client and FTP client for Windows.

http://winscp.net/

 

PuTTY is a free implementation of Telnet and SSH for Windows and Unix platforms.

http://www.chiark.greenend.org.uk/~sgtatham/putty/

 

I would suggest to download the portable version for both WinSCP & Putty. With the portable version, you can easily copy WinSCP & PuTTY from one computer to another computer without erase the settings.

Here is the link for partable WinSCP & Putty:

http://portableapps.com/news/2012-07-29--winscp-portable-4.3.9-released

Published in Blog

My previous article Control Arduino via PHP (EasyPHP) control Arduino from a computer with web server. Another article Control Arduino with TP-Link TL-WR1043ND Router which the Arduino is connecting to the router, but it is not safely to control over the internet.

 
Now I want to control Arduino without a computer and it is very safely control over the internet. Here is the step.
Published in Blog
Saturday, 11 August 2012 14:02

AppServ Web Server

Before reading this article, you may want to know EasyPHP web server that I setup previously, please refer this page http://diy2u.weebly.com/1/post/2012/07/winxp-easyphp-web-server.html.

 
I'm installing Apserv web server today (11/08/12) due to EasyPHP web server did not display any image slide from my computer.
 
I tested 4 different versions of EasyPHP from EasyPHP-5.3.9 to the latest EASYPHP 12.0, and also tested with different browsers, but I had no luck to make it work. 
 
I confirmed that it is not the Joomla problem, because the same webpages can run on my website (the webpages that you are seeing now). I suspected it must be something wrong with the library settings or the EasyPHP configuration, but I don't want to spend too much of time to figure it out.
Published in Blog
Sunday, 29 July 2012 12:06

Delphi Auto Backup

This is an auto backup and restore program with time schedule. I developed this program in year 2009 for my office.
Software & Components for developing
1. Delphi 7
2. EhLib
3. Zip Master
4. Cool Tray Icon
 
Download
Published in Projects
Sunday, 29 July 2012 11:56

Cheque Printing Software

This is a program for those who want to print a lot of cheques.

Software & Components for Developing

1. Delphi 7
2. Fast Report
3. EhLib
 

Downloads
Source Code: http://www.divshare.com/download/18624628-375
Compiled Executable Files: http://www.divshare.com/download/18625292-ccf
 

How to Install

  1. Download the Compiled Executable Files program & save it to any folder. 
  2. Run ChequeP.exe


How to use

  1. Run Cheque.exe to open main window
  2. Click on New button to prepare first batch of cheque.
  3. Now you can enter cheque particulars from the main window
  4. You can enter as many cheques as you want before print
  5. Click on Print Current button to print selected cheque
  6. Click on Print All button to print all cheques
  7. Click New button again to prepare next batch of cheque, all existing cheque particulars is backup-ed

 

  • Tracking button is use to display all cheque particulars being enter previously. The top empty row is use for filtering
  • Design button is use for cheque print out design
  • Payees button is use to enter payees information so that payees name can be select from main window
Published in Projects
Sunday, 29 July 2012 11:19

Control Serial via PHP

It is simple to control serial via PHP.

<?php
exec("mode com4: BAUD=9600 PARITY=n DATA=8 STOP=1 to=off dtr=off rts=off");
$fp =fopen("com4", "w");
//$fp = fopen('/dev/ttyUSB0','r+'); //use this for Linux
fwrite($fp, "string to send"); //write string to serial
fclose($fp);
?>

Published in Tutorials
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