------------------------------------------------------------------- DIFFUSE for OpenWRT: Installing Firmware (released 13th April 2012) ------------------------------------------------------------------- This document is part of DIFFUSE for OpenWRT: http://caia.swin.edu.au/urp/diffuse/ http://caia.swin.edu.au/urp/diffuse/openwrt/ It provides instructions for installing the OpenWRT-DIFFUSE firmware on the TP-Link WR-1043ND. For instructions on building firmware, see: http://http://caia.swin.edu.au/urp/diffuse/downloads/DIFFUSE-Build-howto.txt These instructions are specific for the TP-Link WR-1043ND home router. They are fairly general though and you should be able to apply the same process to other routers. Make sure you build the RIGHT firmware for YOUR router! Firmware install instructions for specific routers can be found at the OpenWRT website: http://wiki.openwrt.org/doc/howto/generic.flashing INTRODUCTION ------------ There are several methods for installing new OpenWRT firmware: - via the Web Interface (for stock firmware and for existing OpenWRT) - via 'sysupgrade' for existing OpenWRT installs - with a serial link and tftp (requires serial cable mod) There are two firmware images included in the tar file: - openwrt-ar71xx-generic-tl-wr1043nd-v1-squashfs-factory.bin - openwrt-ar71xx-generic-tl-wr1043nd-v1-squashfs-sysupgrade.bin You can use the sysupgrade image if you have an existing OpenWRT install and want to keep some of your existing configuration. It should be noted that as this firmware is built from a specific trunk revision there might be conflicts if you choose to keep some settings. We recommend not keeping any settings and performing a new install. WEB INTERFACE INSTALL --------------------- Log into the Web Interface (using your existing username and password). Find the option to 'Flash new firmware image'. For existing OpenWRT installations this is under System -> Backup/Flash Firmware. For the stock firmware this is under System Tools -> Flash Firmware. If you have an existing OpenWRT install you can use either the factory or sysupgrade image. For this guide we will use the factory image. Open the factory image and uncheck 'keep settings'. For the stock firmware use the factory image. The interface will check the MD5 hash and ask for confirmation before proceeding. The new firmware will be installed and the router will reboot. Wait a couple of minutes then follow the FIRST BOOT INSTRUCTIONS. SYSUPGRADE INSTALL ------------------ This works for existing OpenWRT installs. - use SCP to transfer the 'sysupgrade' image file into /tmp - Log into the router using SSH - go the the tmp folder ~: cd /tmp - issue the command ~: sysupgrade -v -n openwrt-......-sysupgrade.bin The -n command means that existing configuration files are NOT kept. The router will flash and reboot. Wait a couple of minutes then follow FIRST BOOT INSTRUCTIONS. SERIAL AND TFTP INSTALL ----------------------- This is a slightly more complicated method for installing new firmware, and requires that the router has been modified with a serial port. You will also need to be running a TFTP server that is hosting the firmware images. Again note that these instructions are SPECIFIC FOR THE TP-LINK WR-1043ND router. There is also a greater potential for BRICKING YOUR ROUTER using this method, so try the other methods first. The flashing instructions are taken from Adrian Chad's FreeBSD-wifi-build homepage: - http://code.google.com/p/freebsd-wifi-build/wiki/TpLinkTLWR1043ND It is also worth visiting the OpenWRT page on the subject: - http://wiki.openwrt.org/doc/howto/generic.flashing.tftp We have used this method and can verify that it will work for the WR1043ND. From Adrian's Site: - This needs to be done via a serial console. - The uboot firmware has been heavily modified by tplink; you can't just use a uboot kernel image. It will refuse to uncompress and boot it. - The first 128k of the flash is uboot. Don't overwrite this. - The last 64k of the flash is the radio calibration area. You must not delete this or your radio will not work. - The second-last 64k of the flash is the firmware configuration area. - "ipaddr" is the IP to temporarily assign to the device. "serverip" is the TFTP server. To get into uboot, boot the router and when you see "autoloading.." type in 'tpl' and hit enter. Please connect the Ethernet to the WAN port. setenv ipaddr 192.168.1.10 setenv serverip 192.168.1.16 # This erases the flash between uboot and the firmware configuration area. # Whatever you do, don't mistype this! erase 0xbf020000 +7c0000 # Load the firmware image into RAM tftpboot 0x81000000 TP-WN1043ND.factory.bin # Copy the firmware image from RAM to the flash. Again, don't mess this line up! cp.b 0x81000000 0xbf020000 0x7c0000 # Transfer control to the kernel. bootm 0xbf020000 As you are connected via serial you won't need to telnet in on the first boot up. You will still need to change the password however. FIRST BOOT INSTRUCTIONS ----------------------- You need to telnet into the router and set the root password on first boot-up (if you flashed the firmware from the webUI and left the window open, a change password prompt should appear when the router has reset and the page reloads). Sometimes it can take a while for the Telnet session to start - be patient! - telnet 192.168.1.1 Once logged in, use the 'passwd' command to change the root password. SSH will then be enabled and the Web interface can be accessed with the user 'root' and the password that you set. Telnet is disabled when once the password has been set (you can re-enable telnet by entering failsafe mode, see IF SOMETHING GOES WRONG). IF SOMETHING GOES WRONG ----------------------- Failsafe Mode: If you can't log in using telnet (and you don't know the root password for SSH) you can activate telnet in failsafe mode. - power cycle the router - when the 'sys' light starts flashing, press and hold the QSS button for 60 seconds.(the sys light will flash faster when you do this) - release the button and then try to telnet into the router (192.168.1.1) - run: # mount_root - you can then change the root password using 'passwd' Restore another version of OpenWRT using sysupgrade: If the DIFFUSE firmware (or any other firmware) isn't working out for you, and you can get command line access (but not the WebUI), then use sysupgrade to install a stable version of OpenWRT. E.g: # cd /tmp # wget http://downloads.openwrt.org/backfire/10.03.1/ar71xx/openwrt-ar71xx-tl-wr1043nd-v1-squashfs-sysupgrade.bin # sysupgrade -v -n openwrt-ar71xx-tl-wr1043nd-v1-squashfs-sysupgrade.bin You can also perform the sysupgrade in one go without using wget: # sysupgrade -v -n http://downloads.openwrt.org/backfire/10.03.1/ar71xx/openwrt-ar71xx-tl-wr1043nd-v1-squashfs-sysupgrade.bin Serial Cable: A serial cable can help you access uboot and install new firmware if something goes really wrong and the two methods above don't work. Also if you are completely locked out. If you router lights all continuously blink at the same time when you power it up, a serial cable may not help. CONTRIBUTIONS ------------- We welcome your feedback and contributions! If you have discovered a bug, have a request for a new feature, have produced a code patch or a new classifier model, please contact Nigel Williams (njwilliams@swin.edu.au). CONTACT ------- The DIFFUSE website is: http://www.caia.swin.edu.au/urp/diffuse If you have any questions or want to report any bugs please contact Nigel Williams (njwilliams@swin.edu.au). Centre for Advanced Internet Architectures Swinburne University of Technology Melbourne, Australia CRICOS number 00111D http://www.caia.swin.edu.au