====== Linksys WRT54G, WRT54GL and WRT54GS ====== The original WRT54G was first released in December 2002. The router is considered a home network device supporting, WLAN(//WiFi//), LAN y WAN. It has a 4+1 port network switch (the Internet WAN port is part of the same internal network switch, but on a different VLAN). The devices have two removable antennas connected through Reverse Polarity TNC connectors. The Linksys WRT54G series family is well detailed in [[wp>Linksys WRT54G series]]. ===== Supported Versions ===== The model number shown on the package, the front panel, and the sticker on the underside of the unit is the reference to follow in order to download the right OpenWRT firmware. **Note:** The supported updated version can be found on the [[toh:#linksys|Table of Hardware]] For wireless support on Kernel 2.6 it is recommended to use trunk snapshots or releases newer than and including "Backfire" 10.3. Note - the wireless driver names are different in 2.6 from 2.4. You may need to do: opkg install kmod-b43 wifi detect > /etc/config/wireless in order to get the correct wireless configuration created. ==== Notes on specific WRT54G//x// hardware versions ==== * The Linksys WRT54G ver. 1.1 hardware (4 MB of flash) has trouble with OpenWrt 10.03.1-rc6 and maybe all 10.03 releases as of 2011-12-08. In a test with OpenWrt 10.03.1-rc6, the OS will install but LuCI will be unable to update settings because there isn't enough flash left free. * References: * "Kamikaze, brcm47xx, WRT54G v1.1: jffs2 marker not detected, rootfs_data not mounted", [[https://dev.openwrt.org/ticket/5071]] * "Linksys WRT54G v1.1 default after reboot", [[https://forum.openwrt.org/viewtopic.php?id=28223]] * "config changes aren't permanent", [[https://forum.openwrt.org/viewtopic.php?id=20125]] * The solution is to go back to OpenWrt 8.09 r14511 (code name "kamikaze") -- the link to the Broadcom Linux 2.4 chipset version is [[http://downloads.openwrt.org/kamikaze/8.09/brcm-2.4/openwrt-brcm-2.4-squashfs.trx]]. ===== Specific Configuration ===== ==== Interfaces ==== The default network configuration is: ^ Interface Name ^ Description ^ Default configuration ^ | br-lan | LAN & WiFi | 192.168.1.1/24 | | vlan0 (eth0.0) | LAN ports (1 to 4) | None | | vlan1 (eth0.1) | WAN port | DHCP | | wl0 | WiFi | Disabled | ==== Internal Architecture ==== {{:toh:linksys:wrt54_internal_architecture.png|}} ==== Switch Ports (for VLANs) ==== Numbers 0-3 are Ports 1-4 as labeled on the unit, number 4 is the Internet (WAN) on the unit, 5 is the internal connection to the router itself. Don't be fooled: Port 1 on the unit is number 3 when configuring VLANs. vlan0 = eth0.0, vlan1 = eth0.1 and so on. ^ Port ^ Switch port ^ | Internet (WAN) | 4 | | LAN 1 | 3 | | LAN 2 | 2 | | LAN 3 | 1 | | LAN 4 | 0 | ==== Failsafe mode ==== If you forgot your password, broken one of the startup scripts, firewalled yourself or corrupted the JFFS2 partition, you can get back in by using OpenWrt's failsafe mode. See: [[doc:howto:generic.failsafe]] ==== Buttons ==== The Linksys WRT54G has two buttons. They are Reset and Secure Easy Setup. The buttons can be used with hotplug events. Please see the [[doc:howto:WifiToggle|WiFi toggle]] Wiki page. ^ BUTTON ^ Event ^ | Reset | reset | | Secure Easy Setup | ses | ===== Hardware ===== ==== Opening the case ==== To remove the front cover you simply pop the front of the case off after removing the antennas. Please note that the warranty will be voided. There are two screws holding the PCB to the bottom cover. ==== Serial port ==== The WRT54G/S/L has a 10 pin connection slot on the board called JP1 (JP2 on some v1.1 boards). This slot provides two TTL serial ports at 3.3V. Neither of the ports use hardware flow control, you need to use software flow control instead. Other routers may have similar connections. These two TTL serial ports on the WRT54GL router can be used as standard Serial Ports similar to the serial ports you may have on your PC. In order to do this though you need a line driver chip that can raise the signal levels to RS-232 levels. You can not directly connect a serial port header to the board and expect it to work. That method will only work with devices that can connect to TTL serial ports at 3.3V. Connecting two which have 3.3V directly will work (TX - RX, RX - TX, GND - GND). Standard RS-232 devices cannot be directly connected which accounts for nearly all serial PC devices. Once the modification is made you can have at most two serial ports to use for connecting devices etc. By default, OpenWrt uses the first serial port to access the built-in serial console on the router. You can connect to it at 115200,8,N,1 using a terminal program like Putty, SecureCRT or minicom for example. This is helpful because if you have problems communicating with your router this method will allow you easy access connecting over a serial console. By default this leaves you with one serial port left, however, there is a method to turn the console off giving you access to both ports if you really need them. It isn't recommended but it can be done. ^ Pin 2 ^3.3V ^ Pin 4 ^TX_0 ^ Pin 6 ^RX_0 ^ Pin 8 ^Not connected ^ Pin 10 ^GND | ^ Pin 1 ^3.3V ^ Pin 3 ^TX_1 ^ Pin 5 ^RX_1 ^ Pin 7 ^Not connected ^ Pin 9 ^GND | {{:oldwiki:openwrtdocs:hardware:linksys:wrt54gl_v11_serialport___.jpg}} ==== JTAG ==== The JTAG port is a unpopulated 12-pin header and is located next to the serial port header. A simple unbuffered should work fine. ^ Pin 2 ^GND ^ Pin 4 ^GND ^ Pin 6 ^GND ^ Pin 8 ^GND ^ Pin 10 ^GND ^ Pin 12 ^GND | ^ Pin 1 ^nTRST* ^ Pin 3 ^TDI ^ Pin 5 ^TDO ^ Pin 6 ^TMS ^ Pin 9 ^TDK ^ Pin 11 ^nSRST* | {{:oldwiki:openwrtdocs:hardware:linksys:wrt54gl_v11_jtagport___.jpg}} See [[doc:hardware:port.jtag|here]] for more JTAG details. ==== Photos ==== WRT54GL v1.1 - Serial number: CL7B //Front:// {{:oldwiki:openwrtdocs:hardware:linksys:wrt54gl_v11_front_hires.jpg?600}} //Back:// {{:oldwiki:openwrtdocs:hardware:linksys:wrt54gl_v11_back_hires.jpg?600}} ==== Hardware Mods ==== === Adding an MMC/SD card === The GPIO (General Purpose Input/Output) lines can be used to add a SD card in SPI mode. Please see the [[oldwiki:port.GPIO|GPIO]] page in the oldwiki. To add an SD card with backfire and kernel 2.6 you need the following packages: * kmod-mmc * kmod-mmc-over-gpio * kmod-mmc-spi * kmod-spi-bitbang * kmod-spi-gpio-old Set **enabled** to **1** in /etc/config/mmc_over_gpio and run /etc/init.d/mmc_over_gpio start root@OpenWrt:~# dmesg|tail ... gpio-mmc: MMC-Card "default" attached to GPIO pins di=2, do=4, clk=3, cs=7 mmc_spi spi32766.0: can't change chip-select polarity mmc0: host does not support reading read-only switch. assuming write-enable. mmc0: new SD card on SPI mmcblk0: mmc0:0000 00000 1.88 GiB mmcblk0: p1 mount it with mount /dev/mmcblk0p1 /mnt/ === Power Supply Mods === (Disclaimer: this has only been tested on WRT54G v1.1 and a WRT54GL v2, it should be the same for other models but I can't be certain. If in doubt check voltages with a multimeter.) If you've lost your power brick or want to power the WRT54G from an alternate source its possible to solder power cables directly to the power jack connectors. The WRT54G seems to run on anything from 5 to 12 (maybe more) volts. At 5 volts it needs about 800 milliamps, I had thought it might be possible to run it off USB but USB only (officially) supplies 500 milliamps. However, some USB ports will supply 800 milliamps and a lot of USB mains adaptors (e.g. the one for the Amazon Kindle or iPhone) supply 1 amp. {{:toh:linksys:wrt54g_psumod1.jpg|WRT54G Board with power connector removed and wires attached to positive and ground.}} To connect up an alternative power supply, open up the case and locate the small black connector where the power input goes. You can (as shown in the picture above) desolder the power connector (this took quite a lot of effort and I broke the connector in the process). If you want to keep it just solder to the underside of the board instead, you might need to file away a bit of plastic from the outer casing to make room for the wires. There are 3 legs to the power connector, each just under 1cm long. The one closest towards the front of the router (the LED side) and running across the router is the positive (red wire in the picture). The one in the middle, running from back to front is the ground (black wire in the picture). Just solder a wire to each of these and connect to your power supply of choice. {{:toh:linksys:wrt54g_psumod2.jpg|WRT54G running at 5 volts, 800 milliamps.}} If you want to run the WRT54G from USB, cut up a USB cable and solder the black wire to negative and the red wire to the positive. Or you can run it from a PC power supply by getting a male 4 pin molex hard disk power connector (as found on some PC fans or molex splitter/extension cables). Connect the yellow wire (12 volts) to the positive side and one (or both) of the black wires to the ground. Now connect this to a spare hard disk power connector on a PC power supply and your WRT54G will power up. {{:toh:linksys:wrt54g_psumod3.jpg|Molex connector for running the WRT54G.}} You can also use a 12 volt lead acid battery (e.g. a car battery) to run the WRT54G. These can peak at around 14 volts when fully charged, but this doesn't seem to cause any problems for the router. ===== Installing OpenWrt ===== ==== Using the Linksys web GUI ==== /*READ THE COMMENT*/ /* I've added instructions so that people would flash to brcm-2.4 first before brcm47xx, because applying the boot_wait command IS IMPORTANT. Please do not delete this again. Edit if you wish, but please don't delete the whole darn steps. It wasn't this way a year or two, then I noticed that those steps are missing --- //blindbox 2011/10/18 01:59// */ /*READ THE COMMENT*/ It is possible to install OpenWrt directly with the Linksys web GUI. If you are initially installing OpenWrt use the Linksys web GUI, this is the easiest way. * Download the openwrt-wrt54g-squashfs.bin firmware image from the brcm-2.4 folder to your PC. * You can find that image at: http://downloads.openwrt.org/backfire/10.03.1/brcm-2.4/ * Open http://192.168.1.1/Upgrade.asp in your browser or manually go to http://192.168.1.1 -> Administration -> Firmware Upgrade * Upload openwrt-wrt54g-squashfs.bin * Wait 2 minutes. The router will reboot itself automatically after the upgrade is complete. * Your router should now be telnettable at 192.168.1.1. The web interface ''luci'' is also available at http://192.168.1.1 . Telnet is disabled and ssh is enabled once a password has been set. * Type these commands out in telnet/ssh. This is to ensure that tftp is available, in case your router gets bricked. nvram set boot_wait=on nvram set boot_time=10 nvram commit && reboot * **You're done!** At this point, you are free to continue using brcm-2.4. However, if you wish to use brcm47xx, proceed below. * Download the image openwrt-brcm47xx-squashfs.trx here: http://downloads.openwrt.org/backfire/10.03.1/brcm47xx/ * Upload using luci at System > Flash Firmware * **OR**, you can simply ssh into the router, cd /tmp wget http://downloads.openwrt.org/backfire/10.03.1/brcm47xx/openwrt-brcm47xx-squashfs.trx sysupgrade /tmp/openwrt-brcm47xx-squashfs.trx * Wait for the router to reboot and login! In case you somehow found out that you can't telnet, then ssh should be possible since your previous settings before flashing remained (unless you used ''sysupgrade -n'') ==== Using the TFTP method ==== Right after flashing at your first login to OpenWrt set the following NVRAM parameters to enable tftpd at bootup: nvram set boot_wait=on nvram set boot_time=10 nvram commit && reboot **''NOTE:''** Do not touch any other NVRAM parameters. NVRAM is only used as environment for the bootloader. OpenWrt ignores NVRAM parameters. **''NOTE:''** On WRT54GL (at least), you should probably use 'wait_time' instead of 'boot_time'. Once you have set the NVRAM parameters above it is possible to use a TFTP client to flash OpenWrt. The TFTP method is also **the recommended way to restore the original Linksys firmware or switch to other third-party firmwares.** First download a firmware image file ending in ".bin", e.g. openwrt-wrt54g-squashfs.bin. Then follow the [[doc:howto:generic.flashing.tftp|Generic TFTP flashing instructions]]. ===== Upgrading OpenWrt ===== ==== Using mtd OR sysupgrade ==== If you have already installed OpenWrt and like to reflash for e.g. upgrading to a new OpenWrt version. It is important that you put the firmware image into the ramdisk (/tmp) before you start flashing. cd /tmp/ wget http://downloads.openwrt.org/backfire/10.03.1/brcm47xx/openwrt-brcm47xx-squashfs.trx # The file must be the trx file. mtd write /tmp/openwrt-brcm47xx-squashfs.trx linux && reboot OR cd /tmp/ wget http://downloads.openwrt.org/backfire/10.03.1/brcm47xx/openwrt-brcm47xx-squashfs.trx # The file must be the trx file. sysupgrade /tmp/openwrt-brcm47xx-squashfs.trx Feel free to explore the rest of sysupgrade options by typing 'sysupgrade' in the terminal. ==== Using LuCI ==== - Select Administration in the top right corner - Choose the System > Flash Firmware tab - Click Browse and navigate to the firmware (it must be a //.trx// file) you wish to flash to - Click 'Upload image' - Follow the instructions ==== Upgrading from Tomato ==== The instructions from the [[http://www.polarcloud.com/tomatofaq#installing_another_firmware_or|Tomato upgrade instructions]] are confirmed to work with Backfire (10.03.1-rc4, r24045) ====== Other Info ====== ===== Flashing via JTAG ===== {{page>meta:infobox:unverified&noheader&nofooter&noeditbtn}} is this flash chip detected by hairydairymaid now? DELETEME I successfully bricked my WRT54GL v1.1 and had no other chance as taking JTAG to debrick it. Following the instructions written on the Wiki and [[doc:hardware:port.jtag#using.a.buffered.cable.with.the.de-brick.utility|HairyDairyMaid]], I tried my best - but wrt54g kept saying that he does not know what flash-chip is on my board. After some time of searching with google, I found an solution written by some people from DD-WRT: http://www.dd-wrt.com/phpBB2/viewtopic.php?t=28295. They did not give any evidence for their research, but seems to work - EON EN29LV320B is an AMD 29LV320MB chip.... Hope this helps someone... --OliverSchmidt ===== Kamikaze/White Russian Recovery ===== After successfully running a late model version of Kamikaze. I had some stability issues decided to go with white russian, I downgraded with the web gui to the latest default version of openwrt-brcm-2.4-squashfs.trx and got bricked. These instructions are linux specific, if you are running any other OS your mileage may vary. ==== Enter Failsafe Mode: ==== I was able to get into failsafe mode consistently by hitting the reset button for 2 seconds after the DMZ led lights up. - Power on the WRT. - **Wait for the DMZ light** first (failing to wait for DMZ on before button press would end up completely Linksys-destroying the nvram contents, i.e. **boot wait off** (ouch), 192.168.1.1, SSID linksys). - **Then** press and hold the reset button on the back until the DMZ light blinks. Unit is now available at 192.168.1.1. If, for any reason (like interface configuration being totally messed up), the WRT doesn't show up on that IP in failsafe mode, see section "Last Resort Recovery" below. ==== Get Your Kit in Order: ==== Get the proper code into the tmp directory of your computer, for me this was: | cd /tmp wget http://downloads.openwrt.org/whiterussian/newest/default/openwrt-brcm-2.4-squashfs.trx wget http://downloads.openwrt.org/people/nbd/nvram-clean.sh | ==== Update the OpenWrt Image from Failsafe: ==== Get the code into the tmp directory of the WRT from the failsafe telnet session and then overwrite the firmware with the new image using mtd. '' cd tmp '' ''scp root@192.168.1.2:/tmp/openwrt-brcm-2.4-squashfs.trx ./'' ''mtd -r write openwrt-brcm-2.4-squashfs.trx linux '' I found that the machine would not reboot itself nor would it reboot using /sbin/reboot. I had to unplug to make it reload. Make sure the commands you have previously typed have finished completely before you pull the juice. According to Internet sources your WRT may be fixed at this point. Mine still would not come up, it seems that I had some nvram variables mucked up, so back to failsafe again. ==== Backing up your nvram variables: ==== It is a good idea to save these just in case you need to refer to anything previously set. ''nvram show | grep sort'' I copied the output to my laptop using ''cat > nvram-broke'' and pasting the output of the "nvram show" command to my terminal. make sure you got the code by doing: ''cat nvram-broke'' ==== Running the Clean Up Script: ==== The cleanup script gets your nvram variables back to a sane state and gets rid of anything not used by OpenWrt. | cd /tmp/ scp root@192.168.1.2:/tmp/nvram-clean.sh ./ chmod a+x nvram-clean.sh ./nvram-clean.sh nvram commit | Throw the bones on the floor and reboot. Your WRT should be up and running. ====== Troubleshooting ====== ===== Wireless broken by default because of wrong macaddr: ===== There's something wrong with mac address settings in the default /etc/config/wireless Make sure the mac address line reads the mac you find in /sys/class/ieee80211/phy0/macaddress Ref: https://dev.openwrt.org/ticket/7102 ===== Read only filesystem ===== If the file system stays in read only mode type mtd unlock rootfs_data Put this command in ''/etc/init.d/nvram'' for example, so that it is called on every start up. (Source and details: [[https://forum.openwrt.org/viewtopic.php?id=25063]])