Wireless Router Home Automation
Wireless router flashed with OpenWRT. This project based on TP-LINK TL-WR1043ND wireless router, you can use TL-WR703N or TL-MR3420 if budget is concerned, any other router that support OpenWRT should work as well.
Arduino code, sketch using Ocean Controls KTA223, or any serial device that use the following protocol.
Syntax for receiving message: @aaccpp
Syntax for replying message: #aapp
Installing Serial Driver
Select the correct serial driver for your serial device. I'm using Arduino duemilanove, so SSH to router and enter code below:
opkg install kmod-usb-serial-ftdi
|opkg install kmod-usb-acm|
If you are using PL2303 based USB/serial adapters
|opkg install kmod-usb-serial-pl2303|
If you are using CP201x based USB/serial adapters
|opkg install kmod-usb-serial-cp210x|
|opkg install kmod-usb-serial-ch341|
Plug in Arduino to the USB port of router, make sure the serial device is working with router, and know the port name assigned to the serial device.
|dmesg | grep -i usb|
Arduino sketch from Ocean Controls: KTA223 RelayDuino
Web interface: wireless router home automation v1.zip
- Download the web interface and extract to any folder of computer
- You should see three files and two folders on your computer
- Using WinSCP copy all the files and folders to /www folder of router
- Now your router should have
- You must have enough permission to run the file in /www/cgi-bin folder. So change the luaSerial file permission to 0755.
|chmod 0755 /www/cgi-bin/luaSerial|
Running the program
- Open up a browser and navigate to http://192.168.1.1/main.html (192.168.1.1 is the router IP, you should use your own router IP)
- Click on each images to toggle ON and OFF, images will change accordingly.
- The Tools image & navigator images is not use at the moment.
- The status bar is use to display serial message which reply from Arduino
- The main program split into 3 files for easy understanding (main.html, main.css, main.js)
- When main.html started, it load two external files (main.css & main.js)
- onload (line 9) triggered and execute autoRun() function from main.js
- Update image caption on screen
- Issue runCmd(0) to get status from Arduino then start Timer to query status every 10 seconds
- Update images based on results from Arduino
- Startup process completed. Waiting for user input......
- User click on imageButton, say first image
- Clear old Timer and start a new Timer
- Ajax deal with serialLua
- serialLua reply status (I name it Arduino message) to Ajax
- Display Arduino message on status bar
- Update first imageButton according to Arduino message
I don't have a good solution to clear the serial buffer, I have to use the most stupid way (very shy) to clear the buffer. Refer to code below, I have to issue readSerial() function instead of just using serial:read and serial:flush.
if string.len(serialData)>0 then
if string.len(serialData) == 0 then
|echo '/cgi-bin:root:$p$root' > /etc/httpd.conf; /etc/init.d/uhttpd restart|
- Rewrite web interface
- More control, for example analog control
- Web cam integrated
This is a very preliminary release, please report any bugs you may find to the project.
Sunday, 29 March 2020 22:48
posted by DennisHausa
xe-88.asia – Official XE-88 Online Casino Website http://www.xe-88.asia/ - xe-88.asia – Official XE-88 Online Casino Website>>>
Sunday, 29 March 2020 22:17
posted by DennisHausa
Comments for xe-88.asia http://www.xe-88.asia/comments/feed/ - Comments for xe-88.asia!..
Thursday, 26 March 2020 15:21
posted by ttltsBaw
stendra vs viagra viagra torture story viagra samples sister helps brother out viagra best price for viagra
viagra without a doctor prescription,viagra without a doctor prescription viagra in action buy viagra online forced viagra for her pleasure walgreens viagra substitute
https://pharm-usa-official.com - viagra side effects
Thursday, 13 February 2020 06:50
posted by EleoSquarty
Pinworm Medicine Vermin http://buyciallisonline.com/# - Buy Cialis Fluoxetine 10mg Buy Cialis Propecia Buy Online Reviews
Monday, 10 February 2020 18:22
posted by Stevambums
Keflex Pregancy http://buyciallisonline.com/# - cheapest cialis 20mg Acheter Viagra En Ligne En France cheapest cialis 20mg Cialis Mg Prezzo
Wednesday, 22 January 2020 22:39
posted by MatWeetle
Viagra Ayuda Al Corazon http://cialibuy.com - Cialis Can Amoxicillin Be Taken With Fluconazole Cialis Zithromax Tab
Tuesday, 21 January 2020 20:30
posted by MatWeetle
Free Shipping Amoxicilina Order Amex Overseas http://cialibuy.com - Cialis Cephalexin Interactions With order cialis online Is Amoxicylin Similar To Tetracycline
Wednesday, 15 January 2020 21:09
posted by KelBymn
Kamagra Kautabletten Erfahrungen Cialis Reasonable Drug Discounter
Monday, 13 January 2020 06:41
posted by WilliamVed
Tuesday, 19 March 2013 11:26
posted by Edward COmer
Very interesting. I'll be testing this out with my TL-WR703N