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
Page 1 of 5