Asus TFTP Flash

From DD-WRT Wiki

Revision as of 03:38, 17 September 2009 by Alvin (Talk | contribs)
Jump to: navigation, search

For the Asus WL-500 series a few extra steps are available/needed when you do the initial flashing of your Asus WL-500 series router, compared to the general TFTP flash procedure.

To avoid confusing the general TFTP flashing procedure of some other routers - which have fewer steps than for the Asus WL-500 series - this Asus specific TFTP Flashing page has been made.


Contents

TFTP tools

With TFTP, all of the information about the transfer is specified during the initial command/setup; there is very little client/server interaction compared with standard FTP.

Windows

You can use a command line client, its quite easy really - or you can choose to use a GUI version. Different windows TFTP options are listed below.


  • WinXP - Command Line TFTP:
tftp client is enabled in the default installation of WinXP
  • Vista/Win7 - Command Line TFTP:
You need to enable it in Control Panel -> Programs and Features ->
Windows Features -> check mark : TFTP Client
Quick user guide:
- The Server/IP address is that of the router being flashed.
- Leave the Password blank.
- Navigate and select the firmware you wish to flash.
- Set retries to 10.
  • No-nonsens open source TFTP tool, Tftpd32 includes TFTP client as well as DHCP, TFTP, SNTP and Syslog servers

Linux

  • Ubuntu: install TFTP client with command sudo apt-get install tftp
  • or install ATFTP, which supports autocompletion and history, with sudo aptitude install atftp

Mac OS X

  • OS X ships with a command-line TFTP client.


Commandline - Asus WL-500 series example

These steps are the same for :

  • WL-500g
  • WL-500g Deluxe
  • WL-500g Premium v1 & v2
  • WL-500W


Requirements:


Principle steps:

a) set PC to static IP: 192.168.1.2 (guide)
b) set router in recover-mode and load wl500g-clear-nvram.trx
c) set router in recover-mode and load wl500g-recover.trx
d) set router in recover-mode and load dd-wrt-v24_mini_asus.trx file
e) from with-in dd-wrt-mini web-GUI load any suitable dd-wrt-v24_mega_generic.bin file shown on Supported Hardware list.


Detailed step-by-step guide:

Preparations

  • Step 1: Copy the four files mentioned above to a folder on your pc. Could be c:\dd-wrt
  • Step 2: Make sure you have a TFTP client available on you pc.
  • Step 3: Connect your computer via Ethernet cable to a LAN port on the router
  • Step 4: Set your PC to static IP 192.168.1.2 (guide)
  • Step 5: Turn off the firewall on your PC - you need the TFTP program to be able to connect out through the firewall area to the router.
  • Step 6: Open a command prompt window, and go to the folder with the four files. Command could be cd \dd-wrt


Set router in recover-mode and load wl500g-clear-nvram.trx

  • Step 7: Unplug the power cord from the router
  • Step 8: Wait 20 seconds
  • Step 9: Press and hold the reset button on the back of the router - Note that the reset button is recessed and you need a pen or paper clip to press it in. The button protruding from the back is the EZ Setup, which is not what you want to press.
  • Step 10: While holding the reset button, plug the power cord into the router. Continue to hold the reset button until the power light starts flashing. Let go of the reset button
  • Step 11: Use tftp to transfer wl500g-clear-nvram.trx to the router. The commands are as follows:
in Windows:
tftp -i 192.168.1.1 put wl500g-clear-nvram.trx 
on a Linux pc:
user@box:$ tftp 192.168.1.1
> mode binary
> put wl500g-clear-nvram.trx
  • Step 12: Tftp should report a successful file transfer in 7-15 seconds. This means the file is transfered to RAM.
  • Step 13: Wait 5 minutes for the file to be stored to FlashRAM. Then unplug the power from the router. Saving from RAM to FlashRAM takes 2-3 minutes, but if you unplug the power from your router too soon, its likely that you will brick your router. So give it the 5 minutes!


Set router in recover-mode and load wl500g-recover.trx

  • Step 14: Unplug the router, wait 20 seconds. Hold the reset button and plug the power cord into the router, continuing to hold the reset button until the power light flashes. Release the reset button.
  • Step 15: Use tftp to transfer wl500g-recover.trx to the router. Same method as above, just change the file name.
tftp -i 192.168.1.1 put wl500g-recover.trx 
  • Step 16: Wait 5 minutes after tftp reports a successful file transfer before unplugging the router.


Set router in recover-mode and load dd-wrt-v24_mini_asus.trx file

  • Step 17: Unplug the router, wait 20 seconds. Hold the reset button and plug the power cord into the router, continuing to hold the reset button until the power light flashes. Release the reset button.
  • Step 18: Use tftp to transfer the DD-WRT firmware .trx file to the router. MAKE SURE YOU USE THE CORRECT FILE. It should be called something like dd-wrt.v**_asus.trx - Do not upload a .bin file yet.
tftp -i 192.168.1.1 put dd-wrt-v24_mini_asus.trx 
  • Step 19: Wait 5 minutes after tftp reports a successful file transfer before unplugging the router. Unplug the power cord from the router, wait 20 seconds, and plug the power cord back into the router.


Load any suitable dd-wrt-v24_mega_generic.bin file

  • Step 20: From with-in DD-WRT Mini web-GUI load the dd-wrt-v24_xxxx.bin file
Open a web browser to 192.168.1.1 (set your preferred root user name and password)
Click tab Administration -> Firmware Upgrade 
at "After flashing, reset to" select "Reset to Default settings"
at "Please select a file to upgrade" point to the  dd-wrt-v24_mega_generic.bin file
Click Upgrade
Wait until the router reboots on it own. Recommended: DO NOT TOUCH YOUR COMPUTER UNTIL ROUTER HAS REBOOTED. And under NO circumstances move the web browser away from the upgrade process, or you could brick your router. This whole process takes five to ten minutes, so go get some coffee - or go kiss your girlfriend/wife.

From Linux using ATFTP

The procedure was devised by mixing the guide above, the details provided on the OpenWRT wiki entry about the WL-500G and the detailed page about the WL-500G's recovery mode. This entry could do with some more formatting too.
You will need most of the files noted above: wl500g-clear-nvram.trx, wl500g-recover.trx, and the DD-WRT files for this router: dd-wrt.v24_mini_asus.trx and dd-wrt.v24_std_generic.bin.
Some of these steps are very probably unnecessary, but this is the procedure that worked for me so I am sharing it with you.
We will use the tftp method, using atftp to connect (on a Debian based system, yes that's Ubuntu, you can simply use sudo aptitude install atftp). This probably works from Apple OS X as well, as the OpenWRT page states that its tftp works since OS X 10.5, but I have no way of knowing. Axx 00:59, 12 May 2009 (CEST)

  • Reset router to factory defaults from the router's regular webinterface.
  • Use arp to discover the router's MAC address:
$ arp
  • And set the MAC address to its IP address:
$ arp -s 192.168.1.1 aa:bb:cc:dd:ee:ff
  • Set the PC to have a static IP address of 192.168.1.10, subnet: 255.255.255.0 gateway: 192.168.1.1 primary dns: 192.168.1.1. Turn off your firewall, moblock etc.
  • Enter the directory in which you saved all needed files, something like: /home/user/AsusWL500G
$ cd /home/user/AsusWL500G
  • Get your router in restore mode by unplugging it, waiting about 20 seconds, and holding down the reboot button WHILE you plug the power back in. The power LED will flash slowly indicating the router is in recovery mode.
  • Start atftp:
$ atftp 192.168.1.1
  • then do the following to set atftp in the right mode.
tftp> mode octet
tftp> timeout 1
tftp> trace
tftp> connect 192.168.1.1
  • 'Now comes the tricky bit'. Do:
tftp> get ASUSSPACELINKaaaa /dev/null
yes/no: say yes
  • and put (send) the wl500g-clear-nvram.trx file to clear the router's memory properly:
tftp> put wl500g-clear-nvram.trx ASUSSPACELINK
Atftp will acknowledge this by printing messages on screen such as
sent DATA <block: 5246, size: 512>
received ACK <block: 5246>
sent DATA <block: 5247, size: 512>
received ACK <block: 5247>
sent DATA <block: 5248, size: 512>
received ACK <block: 5248>
and then going back to the prompt.
  • Once the file transfer is done, wait 5 minutes for the file to be stored to FlashRAM. Then unplug the power from the router. Saving from RAM to FlashRAM takes 2-3 minutes, but if you unplug the power from your router too soon, its likely that you will brick your router. So give it the 5 minutes! I've read that when the power LED stops flashing the router has done its thing but better be safe, so just wait a bit more.
  • Set the router in restore mode again (unplug, wait 20 seconds and plug back in while holding down reset button).
  • Do the same thing in order to send the wl500g-recover.trx file:
tftp> get ASUSSPACELINKaaaa /dev/null
tftp> put wl500g-recover.trx ASUSSPACELINK
  • Wait 5 minutes again. Unplug and get router back into restore mode, same way as previously.
  • Send the dd-wrt.v24_mini_asus.trx file:
tftp> get ASUSSPACELINKaaaa /dev/null
tftp> put dd-wrt.v24_mini_asus.trx ASUSSPACELINK
  • Wait 5 minutes again.
  • This time, unplug, wait the usual 20 seconds and replug normally.
  • Now, we upload a suitable dd-wrt-v24_xxxx.bin file from the webinterface
Open your preferred web browser to 192.168.1.1 (set your root user name and password, make it hard to guess)
Click tab Administration -> Firmware Upgrade
at "After flashing, reset to" select "Reset to Default settings"
at "Please select a file to upgrade" point to the dd-wrt-v24_xxxx.bin file
Click Upgrade
  • Wait for the router to reboots on it own. Recommended: DO NOT TOUCH YOUR COMPUTER UNTIL ROUTER HAS REBOOTED. And under NO circumstances move the web browser away from the upgrade process, or you could brick your router. This whole process takes some five minutes, so go get some coffee, make some cupnoodles - or go kiss your girlfriend/wife/boyfriend/husband.
  • It will come back on its own. Congrats, you've made it. :)


Links