WikiDevi.Wi-Cat.RU:DD-WRT/Asus TFTP Flash

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.

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


 * Simple Windows GUI TFTP Utility: Windows GUI TFTP Utility
 * Quick user guide:
 * - The Server/IP address is that of the router being flashed. Typically 192.168.1.1
 * - Leave the Password blank.
 * - Navigate and select the firmware file 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, and the commands listed for linux will work

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:
 * connect PC and Router through wired connection!
 * TFTP program
 * File Pack which contains both the wl500g-clear-nvram.trx and wl500g-recover.trx
 * file dd-wrt-v24_mini_asus.trx (file as shown on Supported Hardware - type wl5 to get the list)
 * file dd-wrt-v24_mega_generic.bin (file as shown on Supported Hardware - type wl5 to get the list)

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

(note: to set recover mode, unplug power from router, wait 30 seconds, press and hold reset button, plug in power)
 * 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 upload 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 before unplugging the power!

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 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
 * Step 20: From with-in DD-WRT Mini web-GUI load the dd-wrt-v24_xxxx.bin file
 * Sometimes Chrome seems to have troubles posting data using the web-GUI, in such case the upload does not start at all and browser throws an error. Just switch to IE for a sec.
 * 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, which can be found HERE and include wl500g-clear-nvram.trx and 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 </tt>
 * 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</tt>
 * 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></tt>
 * 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</tt>
 * tftp> put wl500g-recover.trx ASUSSPACELINK</tt>


 * 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 </tt>
 * tftp> put dd-wrt.v24_mini_asus.trx ASUSSPACELINK</tt>


 * 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. :)

How to Install DD-WRT onto an Asus WL-500W Using Ubuntu Linux
This was tested using Ubuntu 8.04 (Hardy Heron) and DD-WRT v24sp1, and a brand new, off-the-shelf Asus WL-500W. You can do the same thing from other Linuxes, adopting as appropriate. You can presumably also do this from Windows, using a TFTP client (not tested).

This is essentially the same as the Linux instructions under Asus WL-500G Deluxe.

Note: Even if you have Windows or some other operating system installed, you can still use these instructions. Create an Ubuntu live-CD, boot up into the live-CD (which will make no permanent changes to your computer), and use these instructions.

Download Files and Software
First, install tftp:



Now, download the files you'll need:
 * Utilities pack which includes wl500g-clear-nvram.trxand wl500g-recover.trx
 * temporary Asus DD-WRT firmware, which must have asus.trx in the file name. For example, I used dd-wrt.v24_mini_asus.trx.  Use the most recent version.
 * final firmware image. For example, I used dd-wrt.v24_std_generic.bin.  Use the most recent version.

Also, print out a copy of these instructions, because you won't have access to the internet from here on out.

Set up Networking
Regardless of which os you use, or the method you use to set the IP address, these are the settings you need:
 * set the (Static) IP address to 192.168.1.2
 * set subnet mask to 255.255.255.0
 * set gateway address to 192.168.1.1

Use one of the following methods ("A" or "B"), depending on whether you are using Ubuntu 8.04 (Hardy) or a later version (Intrepid or Jaunty).

A (For Ubuntu 8.04 Hardy): Turn off wireless networking. On Ubuntu, right-click on the networking icon in the upper right of the screen and uncheck "Enable Wireless."

Set wired networking to a static address of 192.168.1.2. On Ubuntu, left-click on the networking icon in the upper right of the screen and choose "Manual Configuration." Click "Unlock" and enter your password. Click on "Wired Connection," then "Properties." Uncheck the "Enable roaming mode" box. Under "Configuration," choose "Static IP address." Set "IP address" to 192.168.1.2. Set "Subnet mask" to 255.255.255.0. Set "Gateway address" to 192.168.1.1.

Connect an ethernet cable between the WL-500W and your computer.

B (for Ubuntu 8.10 Intrepid or 9.04 Jaunty): Disable Networking in the GUI. On Ubuntu, right-click on the networking icon in the upper right of the screen and uncheck "Enable Networking."

Set your wired networking to static address 192.168.1.2 with the following command, ensuring  'ethx' is replaced with the interface name of your wired network interface.



Connect an ethernet cable between the WL-500W and your computer.

Hard Reset
Do a Hard Reset as follows:
 * Unplug the router's power cord.
 * Wait 20 seconds.
 * Using a paperclip or similar object, press and hold the "RESTORE" button on the back of the router
 * While continuing to press the RESTORE button, plug the router back in.
 * Wait until the power light on the front of the router starts flashing, then release the RESTORE button.

Wait about 30 seconds, then confirm that you are now connected to the router:

You should see a series of lines something like this (the numbers will be different, of course):
 * 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.752 ms

Exit from ping by hitting c.

Clear NVRAM
Open a terminal window and cd to the directory where you downloaded the files. For example, if you saved to the Desktop:



Now use tftp to transfer wl500g-clear-nvram.trx to the router:

tftp should report a successful transfer in 10 seconds or so.

Wait 2-3 minutes.

Transfer wl500g-recover.trx
Do a Hard Reset as described above, then confirm you are connected to the router using ping as described above.

Now use tftp to transfer wl500g-recover.trx to the router:

Again, tftp should report a successful transfer in 10 seconds or so.

Wait 2-3 minutes.

Transfer the Temporary Asus DD-WRT Firmware
Do a Hard Reset as described above, then confirm you are connected to the router using ping as described above.

Now use tftp to transfer the temporary Asus DD-WRT firmware to the router:

Make sure you use the asus.trx file here, and not the bin file.

Once again, tftp should report a successful transfer.

Wait 2-3 minutes.

Links

 * General TFTP flash description