Lua Socekt must be use in order to call sleep function in milliseconds.
An example to install Lua Socket to OpenWRT
opkg install luasocket
An example to sleep 10 milliseconds
Lua can only sleep/wait in seconds (not milliseconds) without install Lua Socket. Code below shows the sleep funciton.
delay = delay or 1
local time_to = os.time() + delay
while os.time() < time_to do end
Example to sleep 5 seconds
- PHP require to install lighttpd,lighttpd-mod-cgi,lighttpd-mod-fastcgi,php5-cgi,php5-fastcgi,libsqlite3, installation is complicated & consume resources.
- ser2net/socat is very simple but did not support web service.
- Lua comes as a default in openWrt and support web service. The goodies is OpenWRT using Luci for web GUI and LuCI is an embedded rapid application development framework written in Lua.
- Arduino duemilanove connected to a TP-LINK TL-WR1043ND router which flashed with OpenWRT.
- Using 16 Channel Relay Arduino Controller for the Arduino sketch
I use EasyPHP since WampServer is not working on my Toshiba notebook.
I didn't use AppServ for my projects, because the PHP version is either too old or too new that it is not suitable for my website.
Softaculous AMPPS: http://www.ampps.com/
Finally I use AMMPS since EasyPHP did not display pictures for most of the Joomla slide extensions.
- dns320_FW-202 dated 2011/11/23: ftp://ftp.dlink.com/Multimedia/dns320/Firmware/
- You can also download the beta version dated 2012/03/30, but I didn't test it.
- D-LINK DNS-320 ShareCenter.
- A working fun_plug 0.7 installing on D-LINK DNS-320 ShareCenter.
- D-LINK DNS-320 ShareCenter
- Hard Disk Configure as Volume_1: Standard as shown in figure below
If you are using Arduino (or any other TTL device) to control 4 channel relays or more, I would suggest to use ULN2803 Line Driver instead of Transistors or FETs. You can use ULN2003 which is much more cheaper if you plan to use not more than 7 channel relays.
The ULN2803 Integrated Circuit (IC) is a "Eight-way Line Driver". It allows you to interface TTL signals (5v) with higher voltage/current (50V/500ma) loads.
As shown in figure 1 and figure 2, an Arduino is control 8 relays, one using ULN2803 line driver and the other one using transistors, both circuit are equivalent.