无需外加微控制器的无线路由器WiFi遥控小车
这是一个具有摄像功能的Wi-Fi无线遥控小车,设计独特,它使用了一个无线路由器,无需外加微控制器亦可以通过电机驱动器进行遥控小车。
OpenWrt: Control LED manually
Due to the limited GPIO availability on the wireless router, you may want use the router LED pin to provides a few more GPIOs. This describes how to use the LED pin on a wireless router as binary outputs.
Wi-Fi controlled Remote Control Car without microcontroller
This is a Wi-Fi controlled remote control car with camera that can be driven over the internet. The RC car is very unique since it's using a wireless router and eliminate the need of a microcontroller.
Lua_2W_Motor: 2 wheel motor library for Lua running on wireless router
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.
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.
Lua_ShiftOut: A 74HC595 Shift Register Library for Lua
I want to built a wifi car without using micro contoller, due to the limited GPIO availability on the wireless router, a 74HC595 Shift Register is needed to expand its outputs.
This is a 74HC595 Shift Register library for Lua running on wireless router flashed with OpenWRT, it may run in any linux-based embedded system. It can be used to shift out data from either the most (i.e. the leftmost) or least (rightmost) significant bit.
Lua_GPIO: 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
Setting up 3G network on Openwrt Barrier Breaker
opkg update |
Insert 3G dongle and restart router.
Append to following line to /etc/config/network configuration file. Here is the settings for setup Maxis 3G network.
config interface 'wan' |
Restart the router.
Ubidots-Lua: OpenWRT router + 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.
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.
Recover bricked TL-MR3020
If your TL-MR3020 router is bricked with the following symptoms, most likely you can use this method to recover it.
- Ping the router without problem
- Telnet connection failed
- SSH connection failed
Solution:
- Put the router switch to AP mode
- Turn on the router power
- Push and hold the "WPS" button
- When the WPS Led flash slowly, switch on AP mode to 3G mode. The LED should flash quicky.
Now, you can Telnet to router
Erase the root data
Login to the router via telnet and enter the following command. Most likely your router is now recovered.
mtd -r erase rootfs_data |
Continue following procedures if it is still not working.
Copy firmware to router
- Login to router via telnet and change the password in order to enable SSH
passwd |
- Copy the OpenWRT firmware to the router /tmp folder. I personally like and use WinSCP.
Upload the firmware to router
SSH to router and write the firmware to router. Where code.bin is your OpenWRT firmware file.
mtd -r write code.bin firmware |
Reboot the router and your router should be working now. If all the above methods is not working for you, then you should go for Serial Console method to recover the bricked router.
How to increase storage on TP-Link TL-MR3020 with ExtRoot
The TP-Link TL-MR3020 N150 3G/4G Travel Router is a very small device with a size of 74mm x 67mm x 22mm, it has only 4MB flash and 32MB memory. The router have about 428KB (67%) space available after installing OpenWRT Barrier Breaker 14.07, you may encounter shortage of storage when installing certain extensions due to limited of router space.
By employing OpenWrt's extroot, you can expand the storage capacity of your root file system using the additional space of an added storage device.
TP-Link TL-WR1043 V2.1: Upgrade to OpenWRT & DD-WRT and Reverting back to original OEM firmware

I own a TP-Link TL-WR1043 V2.1 wireless router, I would like to test if it is able to run on OpenWRT or DD-WRT. it is first tested on OpenWRT, DD-WRT later, so far it has been working flawlessly for me.
About TP-Link TL-WR1043 V2.1 Wireless Router
TP-Link TL-WR1043 V2.1 is a 300Mbps Wireless N Gigabit Router, it has more memory (64MB) compared with the TL-WR1043 V1.x. Here is the comparison:
HW Version |
CPU |
Ram |
Flash |
Network |
Gigabit |
USB |
Serial |
JTag |
1.x |
Atheros [email protected] |
32MB |
8MB |
4x1 |
Yes |
Yes |
Yes |
Yes |
2.x |
Atheros[email protected] 64MB |
64MB |
8MB |
4x1 |
Yes |
Yes |
Yes |
No |
打造openwrt+NoDogSpladh网站无线广告机
此教程使用一个TP-Link TL-MR3020 3G/4G无线路由器来打造简单的无线广告机。目标是提供一个免费热点(hostpot)让公众无线上纲同时弹出hostpot提供者的广告(称之为Splash page 或者Landing page)。
TP-Link TL-MR3020的厂家固件(Firmware)功能有限,不能安装第三方软件包,因此,固件必须升级至OpenWRT,然后再安装NoDogSplash
虽然这里是使用TP-Link TL-MR3020为教题,一般支持OpenWRT的路由器也是适合的。
Setting up a wireless hotspot using TP-Link TL-MR3020 Wireless N Router

Wireless Router Remote Control Car

This is my first RC car control by an Arduino and a wirless router running OpenWRT. There are many OpenWRT supported routers, I'm using a TP-Link TL-MR3020 3G/4G Wireless N Router for this project since it is very slim, low power consumption and it is cheap.
RC car features
- A webcam, the car can be driven without line of sight
- A horn so that you can honk at people.
- LED Headlights attached to the front of the car
- Two wheel drive motor
- Windows GUI application or web interface
- Future Additions: Control by a smartphone (Android & IOS)
Connect Two Wireless Router Wirelessly ( Bridge ) using TL-MR3020

- Host router configure as Access Point. If you already setup a wireless internet connection in your house, usually your modem is configured as Access Point mode.
- A working OpenWRT on TP-LINK TL-MR3020 Portable 3G/4G Wireless N Router
- Host router IP: 192.168.1.1
- Host router subnet mask: 255.255.255.0 or 255.255.0.0 if you want to access 192.168.0.x from 192.168.1.x
- Host router SSID: ABC
- Client router IP: 192.168.0.1
- Client router subnet mask: 255.255.255.0
TP-LINK TL-MR3020 + OPENWRT + WEBCAM

Prerequisites
- A working OpenWRT on TP-LINK TL-MR3020 Portable 3G/4G Wireless N Router
- Microsoft LifeCam HD-5000 or any other Linux UVC supported cameras
Recover bricked TL-MR3020 Wireless N Router

TP-Link TL-MR3020 restore from OpenWRT to Original Firmware
If you had flashing the TP-Link MR3020 firmware to OpenWRT and now you want to restore it to the original state, here is a guide on how to make it. With this guide you will able to changing between original firmware to different version OpenWRT firmware.
Flashing OpenWRT to TP-Link TL-MR3020 3G/4G Wireless N Router
- CPU Atheros AR9330
- RAM 32MB
- NAND 4MB
- Dimensions 74mm x 67mm x 22mm
- Power consumption 1.25W Max.
USB Audio Adapter work with OpenWRT
- Wireless router flashed with OpenWRT. This project based on TP-LINK TL-WR1043ND wireless router.
- USB audio adapter which supported by Linux. As shown in figure below is the USB sound audio that I'm using.
Wireless Router Home Automation
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) |
Sending Message to Serial Port of Router using Lua
- 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
OpenWRT in Client Mode
TP-LINK TL-WR1043ND Router + Web Cam = IP Cam
- A working OpenWRT on TP-LINK TL-WR1043ND Router
- Web Camera. I'm using Microsoft LifeCam HD-5000
TP-LINK TL-WR1043ND router as a Print Server
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.
TP-LINK TL-WR1043ND router as a Samba File Server
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.
Adding FTP feature to TP-LINK TL-WR1043ND router
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.
TP-LINK TL-WR1043ND Mount with USB Flash Drive
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.
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
Openwrt + PHP on TP-Link TL-WR1043ND Router
This tutorial show you how to install PHP on the TP-Link TL-WR1043ND router.
You can refer to my previous post http://ediy.com.my/index.php/blog/item/2-openwrt-on-tp-link-tl-wr1043nd-router to upgrade firmware to OpenWRT.
Control Arduino with TP-Link TL-WR1043ND Router
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
- Run PuTTy
- Enter 192.168.1.1 for Host Name (this is the default IP for Openwrt set in TL-WR1043ND)
- Change connection type to SSH
- Click on Open button
- Enter your router username (username is root if you didn't change it)
-
Enter your password