01 March 2013

How To: Use Nano Router To Do Web Dev On The Move

How to use a nano router to run a DHCP server to allow website development testing on wireless devices (e.g. smartphone, tablet) whilst away from a network.

Whilst travelling I often find I need to test a website on a real wireless device. Whilst emulators are available for iPhone Android etc I often find they fall short of the actual experience, and besides, until you've tested it you haven't tested it have you.

The Aim
Open a browser on a tablet or phone and browse to a website running on a server on a laptop whilst  mobile or wireless coverage is unavailable or unreliable e.g. whilst travelling.

The Problem
If there is no reliable network available either wireless LAN or even mobile (which could be used with a Dynamic service like DnsExit.com) then you have no DHCP router to assign IP addresses, so you cannot necessarily browse from one device to the server on another (it's feasible in theory with AP but I've never got it to work).

The Solution
A nano router like TP Link TL-WR702N 

It truly is tiny, smaller than a (computer) mouse. Approx 5.5cm square and 1.75cm deep.
Comes with (short but sufficient) usb and lan cables, and a mains power adapter.

The on-board software (accessible at default un/pw: admin admin) is basic but functional allowing various different modes:
- AP mode.
- Wireless router mode
- Repeater mode
- Bridge mode
- Client mode
Crucially for me DHCP is optional in any of these modes (e.g. not limited to router).

Great as:
- Backup router (doubtless a single point of failure in any home network)
- An access point when there is no wireless (e.g. Hotel having only LAN cable or wireless with single device sign on).

I use it to act as a DHCP in Access Point mode, plugged into my Ethernet port on my computer to provide a wireless AP for phone and tablet when I'm travelling but need inter connectivity for developing websites.

NB: to change the order of network preferences to ensure web requests use the internet connected (WiFi port):
  • Windows: Network preferences, change adapter settings, Advanced, Deselect automatic metric and ensure the one you want to use for internet has the lowest metric number.
  • Mac: change the order of the adapters in Network preferences

You could also upload new firmware (e.g. openwrt) to add additional features.

No comments:

Post a Comment