Differences

This shows you the differences between two versions of the page.

toh:tp-link:tl-mr3020 [2012/10/05 22:56]
mferlitsch
toh:tp-link:tl-mr3020 [2013/04/06 13:08] (current)
ukeer
Line 10: Line 10:
| v1.4 | 2012-01 | Trunk  ([[https://dev.openwrt.org/changeset/29763|r29763]], probably earlier) | AR9331 chipset | | v1.4 | 2012-01 | Trunk  ([[https://dev.openwrt.org/changeset/29763|r29763]], probably earlier) | AR9331 chipset |
| v1.6 | 2012-03 | Trunk  ([[https://dev.openwrt.org/changeset/30753|r30753]], probably earlier) | AR9331 chipset | | v1.6 | 2012-03 | Trunk  ([[https://dev.openwrt.org/changeset/30753|r30753]], probably earlier) | AR9331 chipset |
-| v1.7 | 2012-05 | Trunk  ([[https://dev.openwrt.org/changeset/32786|r32786]]) | AR9331 chipset |+| v1.7 | 2012-05 | 12.09-RC1, Trunk  ([[https://dev.openwrt.org/changeset/32786|r32786]]) | AR9331 chipset
 +| v1.8 | ??      | 12.09-RC1 (tested) | AR9331(-AL1A ?); internal serial port has no pins, only solder-pads (P1 clearly visible |
===== Features ===== ===== Features =====
Line 27: Line 28:
===== Installation ===== ===== Installation =====
-Currently only OpenWRT developer versions support the hardware. Download the lastest trunk snapshot [[http://downloads.openwrt.org/snapshots/trunk/ar71xx/openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin|here]].+Currently the TL-MR3020 is not supported in any stable OpenWrt version, but it is supported in latest snaphots.
-The old link seems not to work any longer. +So you can either download a daily-built snapshot or build your own from sources.
-This seems to be the new link: [[http://downloads.openwrt.org/attitude_adjustment/12.09-beta/ar71xx/generic/openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin|here]].+
-=== Method using web GUI (recommended) ===+  * Download the latest Attitude Adjustment RC1 snapshot from [[http://downloads.openwrt.org/attitude_adjustment/12.09-rc1/ar71xx/generic/openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin|here]] (recommended) 
 +  * Download the lastest trunk snapshot [[http://downloads.openwrt.org/snapshots/trunk/ar71xx/openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin|here]] (risky)
-Connect via ethernet cable, log in to the router's web GUI (default login/password: admin/admin) and overwrite the factory firmware by installing the .bin image like a regular firmware update. Wait for the progress bar to finish twice (the device will reset itself in the process), and [[toh:tp-link:tl-mr3020#basic configuration|proceed with basic configuration]] as with any fresh OpenWRT install.+{{:meta:icons:tango:48px-dialog-warning.svg.png?nolink}} **WARNING**: Snapshot images are always risky. Check the forum discussion for latest opinions on available images.
-Web GUI upload has been confirmed to work with v1.0, v1.4 and v1.6 hardware and requires no serial access unless something goes wrong.+=== Method Using Web GUI (Recommended) === 
 + 
 +Connect to the TL-MR3020 router via Ethernet cable at IP address **192.168.0.254**, log in to the router's web GUI (default login/password: **admin** / **admin**) and overwrite the factory firmware by installing the **openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin** firmware image like a regular firmware update. 
 + 
 +Wait for the progress bar to finish twice (the device will reset itself in the process), and [[toh:tp-link:tl-mr3020#basic configuration|proceed with basic configuration]] as with any fresh OpenWRT install. 
 + 
 +Web GUI upload has been confirmed to work with v1.0, v1.4, v1.6 and v1.7 hardware and requires no serial access unless something goes wrong.
See [[https://forum.openwrt.org/viewtopic.php?pid=154203#p154203|forum]] if you encounter problems. See [[https://forum.openwrt.org/viewtopic.php?pid=154203#p154203|forum]] if you encounter problems.
-=== Manual method using TFTP (experts) === +=== Manual Method Using Serial Console and TFTP (Experts) === 
-Connect the MR3020 via serial and power the MR3020 up. After a 1-2 seconds it shows "Autobooting in 1 seconds", when displaying this enter "tpl" immediately.+ 
 +To install OpenWrt from the U-Boot console, you need to install a TFTP server on your computer (**tftp-hpa** is recommended). 
 + 
 +Then download OpenWrt factory image to /srv/tftp (for example), and execute the TFTP server by typing **tftpd -l -s /srv/tftp**. 
 + 
 + 
 +Connect the TL-MR3020 using a serial console and power up the TL-MR3020. 
 + 
 +After a 1-2 seconds it shows **Autobooting in 1 seconds**, when displaying this enter **tpl** immediately.
-You will get a UBoot-console, it shows "hornet>" and you can enter the following commands there: 
<code> <code>
-setenv ipaddr <device-ip, eg. 192.168.1.4>+Using default environment
-setenv serverip <server-ip, eg. 192.168.1.2>+In:    serial 
 +Out:  serial 
 +Err:  serial 
 +Net:  ag7240_enet_initialize... 
 +No valid address in Flash. Using fixed address 
 +No valid address in Flash. Using fixed address 
 +: cfg1 0x5 cfg2 0x7114 
 +eth0: 00:03:7f:09:0b:ad 
 +ag7240_phy_setup 
 +eth0 up 
 +: cfg1 0xf cfg2 0x7214 
 +eth1: 00:03:7f:09:0b:ad 
 +athrs26_reg_init_lan 
 +ATHRS26: resetting s26 
 +ATHRS26: s26 reset done 
 +ag7240_phy_setup 
 +eth1 up 
 +eth0, eth1 
 +Autobooting in 1 seconds 
 +[type tpl here]</code>
-tftpboot 0x80000000 firmware-image.bin+You will get a U-Boot-console, it shows as **hornet>**, and you must enter the following commands:
-erase 0x9f020000 +0x3c0000+<code>hornet> setenv ipaddr <device-ip, eg. 192.168.1.111> 
 +hornet> setenv serverip <server-ip, eg. 192.168.1.100> 
 +hornet> tftpboot 0x80000000 openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin 
 +eth1 link down 
 +dup 1 speed 100 
 +Using eth0 device 
 +TFTP from server 192.168.1.100; our IP address is 192.168.1.111 
 +Filename 'openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin'. 
 +Load address: 0x80000000 
 +Loading: ################################################################# 
 +        ################################################################# 
 +        ################################################################# 
 +        ################################################################# 
 +        ################################################################# 
 +        ################################################################# 
 +        ################################################################# 
 +        ################################################################# 
 +        ################################################################# 
 +        ################################################################# 
 +        ################################################################# 
 +        ###################################################### 
 +done 
 +Bytes transferred = 3932160 (3c0000 hex) 
 +hornet> erase 0x9f020000 +0x3c0000
-cp.b 0x80000000 0x9f020000 0x3c0000+First 0x2 last 0x3d sector size 0x10000                                                                                                        61 
 +Erased 60 sectors 
 +hornet> cp.b 0x80000000 0x9f020000 0x3c0000 
 +Copy to Flash... write addr: 9f020000
-bootm 0x9f020000+done 
 +hornet> bootm 9f020000
</code> </code>
-=== OEM mass flashing ===+=== OEM Mass Flashing ===
Flashing hundreds of devices using the web interface can be a real pain. You can use this shell script to automate it: Flashing hundreds of devices using the web interface can be a real pain. You can use this shell script to automate it:
Line 89: Line 149:
</code> </code>
-==== Failsafe Mode ==== +===== Failsafe Mode ===== 
-Power the MR3020 on and when the WPS Button starts to blink , push it until it blinks faster; the device is now in Failsafe-Mode+ * Set your computer's IP to 192.168.1.2, subnet 255.255.255.0 
 +  * Connect the TL-MR3020 to your computer via ethernet 
 +  * Power on the TL-MR3020 
 +  * When the WPS Button starts to blink , push it until it blinks faster 
 +  * The device is now in Failsafe-Mode 
 +  * You may access it by using **telnet 192.168.1.1** 
 + 
 +===== Restoring Original Firmware ===== 
 + 
 +Restoring the original firmware follows the usual procedure: 
 + 
 +  * Get original firmware image into /tmp 
 +  * Make sure it's in the correct format 
 +  * Flash with //mtd// 
 +  * Factory reset 
 + 
 +{{:meta:icons:tango:dialog-warning.png?nolink |Warning!}}**WARNING:** The following steps were tested successfully on an **MR-3020 V1.4**. Make sure that the firmware link used in the instructions below **matches your hardware revision** by following the firmware link in the link section below. 
 + 
 +First, set the mode switch to //WISP//. Without it, you might have trouble connecting after the reboot. Connect via ssh/telnet/serial and use the following commands: 
 + 
 +<code># opkg update && opkg install unzip 
 +# cd /tmp 
 +# wget http://www.tp-link.com/Resources/software/TL-MR3020_V1_120320.zip 
 +# unzip TL-MR3020*.zip 
 +# mtd -r write mr3020*up*.bin firmware 
 +</code> 
 + 
 +After a couple of seconds, the router reboots automatically. Reconnect, open [[http://192.168.0.254/|http://192.168.0.254]], log in with //admin// / //admin//, and do a factory reset with //System Tools// / //Factory Defaults//. 
 + 
 +===== Basic Configuration ===== 
 +Since this part is identical to the one recommended for generic devices, see [[doc:howto:basic.config|Basic configuration]].
-==== Flash Layout ====+===== Original Flash Layout =====
Please read the article [[doc:techref:Flash Layout]] for a better understanding. It contains a couple of explanations. Then let's have a quick view at flash layout of this particular device: Please read the article [[doc:techref:Flash Layout]] for a better understanding. It contains a couple of explanations. Then let's have a quick view at flash layout of this particular device:
Line 103: Line 193:
^ filesystem  |  none            |  none              | SquashFS          |  none            |  none        | ^ filesystem  |  none            |  none              | SquashFS          |  none            |  none        |
-ART = Atheros Radio Test - it contains mac addresses and calibration data for the wifi (EEPROM). If it is missing or corrupt, ath9k won't come up anymore.\\ +ART = Atheros Radio Test - it contains RF calibration data for the wifi. If it is missing or corrupt, wireless won't come up anymore.\\
- +
-===== Basic configuration ===== +
-Since this part is identical for all devices, see [[doc:howto:basic.config|Basic configuration]]. +
===== Hardware ===== ===== Hardware =====
-==== Info ==== +==== Opening the Case ====
- +
-  * [[https://gist.github.com/2059480#file_dmesg|dmesg TP-Link TL-MR3020]] +
- +
-=== Opening the case ===+
The case consists of two parts: a white base and a gray lid. The lid has two snap hinges, one right above the mini USB connector and one on the opposite side about 10 mm left of the "TP-LINK" logo. The lid is additionally glued in place on the underside on all four sides. You can try to pry it open with a thin but very stable blade tool. Start above the ethernet port where the case is not glued, and work your way around the glued corner towards the "3G USB" port (no glue there) until you reach the logo side. You should now be able to peek inside the case on the lose corner. The case consists of two parts: a white base and a gray lid. The lid has two snap hinges, one right above the mini USB connector and one on the opposite side about 10 mm left of the "TP-LINK" logo. The lid is additionally glued in place on the underside on all four sides. You can try to pry it open with a thin but very stable blade tool. Start above the ethernet port where the case is not glued, and work your way around the glued corner towards the "3G USB" port (no glue there) until you reach the logo side. You should now be able to peek inside the case on the lose corner.
Line 121: Line 203:
Next proceed along to the LED side, but beware of the fragile light conductors running straight down beneath the clear plastic. They easily bend or break when you push-in your tool too far. Once three sides are open, you can steadily lift the lid until the remaining side breaks lose and neatly frees the second hinge in the process. If you work carefully and manage not to break either one of the two hinges, the gray lid should snap neatly back into place after some manual cleaning with a cutter knife. Next proceed along to the LED side, but beware of the fragile light conductors running straight down beneath the clear plastic. They easily bend or break when you push-in your tool too far. Once three sides are open, you can steadily lift the lid until the remaining side breaks lose and neatly frees the second hinge in the process. If you work carefully and manage not to break either one of the two hinges, the gray lid should snap neatly back into place after some manual cleaning with a cutter knife.
-=== Internal pictures === +==== Internal Pictures ==== 
-{{:toh:tp-link:tl-mr3020_top.jpg?450}} +{{:media:tp-link_mr3020_top-pcb.jpg?450}} 
-{{:toh:tp-link:tl-mr3020_bottom.jpg?450}}+{{:media:tp-link_mr3020_bottom-pcb.jpg?450}} 
 +{{:toh:tp-link:img_20121015_170949.jpg?450}}
-==== Serial ====+==== Hardware summary ==== 
 +|                            ^  IC  ^  Info  ^  Datasheet  ^ 
 +^                  Processor | AR7240 |  | {{:toh:tp-link:atheros.ar7240.pdf|Click}}  | 
 +^                  Flash ROM| Spansion S25FL032P |  | http://www.spansion.com/Support/Datasheets/S25FL032P_00.pdf  |   
 +^                      SDRAM| Windbond W9425G6JH|  | http://www.winbond.com/NR/rdonlyres/11505884-F632-41F9-9438-A3EC025FEAED/0/W9425G6JH.pdf |   
 +^        Chipset (Wi-Fi controller)| AR9331 | 1x1 | http://see.sl088.com/w/images/6/69/AR9331.pdf | 
 + 
 +==== Serial Console ====
== Pinout == == Pinout ==
Line 151: Line 241:
where [device name] is the name of your serial adaptor, usually tty.usbserial* on Mac and ttyUSB* on Linux. To quit screen, press CTRL-a, followed by CTRL-k, followed by y. where [device name] is the name of your serial adaptor, usually tty.usbserial* on Mac and ttyUSB* on Linux. To quit screen, press CTRL-a, followed by CTRL-k, followed by y.
-The password to get into uboot prompt is **tpl**. You must type it quickly while the serial console is displaying+=== U-Boot Bootloader Console === 
 + 
 +The password to get the U-Boot prompt is **tpl**. You must type it quickly while the serial console is displaying:
<code>[...] <code>[...]
ag7240_phy_setup ag7240_phy_setup
Line 159: Line 251:
[type tpl here]</code> [type tpl here]</code>
-uboot takes several commands. Start with **help**.+U-Boot accepts several commands. Type **help** to display the list of available commands. 
 + 
 +<code>hornet> help 
 +?      - alias for 'help' 
 +bootm  - boot application image from memory 
 +cp      - memory copy 
 +erase  - erase FLASH memory 
 +help    - print online help 
 +md      - memory display 
 +mm      - memory modify (auto-incrementing) 
 +mtest  - simple RAM test 
 +mw      - memory write (fill) 
 +nm      - memory modify (constant address) 
 +printenv- print environment variables 
 +progmac - Set ethernet MAC addresses 
 +reset  - Perform RESET of the CPU 
 +setenv  - set environment variables 
 +tftpboot- boot image via network using TFTP protocol 
 +version - print monitor version</code> 
 + 
 +=== Linux Console === 
 + 
 +Once the original firmware has booted up completely, you can press **return** to activate the Linux login prompt.
-Once the original firmware has booted up completely, you can press **return** to activate the Linux login prompt:+The password to get a root Shell access is **5up**:
<code>TL-MR3020 mips #185 Fri Oct 21 16:26:50 CST 2011 (none) <code>TL-MR3020 mips #185 Fri Oct 21 16:26:50 CST 2011 (none)
Line 180: Line 294:
|      5 |              |            |                |                      |            |                |                  | |      5 |              |            |                |                      |            |                |                  |
|      6 |              |            |                |                      |            |                |                  | |      6 |              |            |                |                      |            |                |                  |
-|      7 |               |           |                |                      |            |                |                  | +|      7 | unused Pulled to ground            |   R15        |                |                      |            |                |                  | 
-|      8 |  USB power(?) |           |                 |                      |            |                |                  |+|      8 |  USB power | R112          | 2.8V                |                      |            |                |                  |
|      9 |              |            |                |                      |            |                |                  | |      9 |              |            |                |                      |            |                |                  |
|    10 |              |            |                |                      |            |                |                  | |    10 |              |            |                |                      |            |                |                  |
Line 202: Line 316:
|    27 |  Internet LED |  LED3    |                |                      |            |                |                  | |    27 |  Internet LED |  LED3    |                |                      |            |                |                  |
|    28 |              |            |                |                      |            |                |                  | |    28 |              |            |                |                      |            |                |                  |
-|    29 |               |           |                |                      |            |                |                  |+|    29 | unused Pulled to ground            |     R17      |                |                      |            |                |                  |
To make the GPIOs available via sysfs, the required ones have to be exported to userspace, as it is explained on a page of the [[http://squidge.sourceforge.net/gpio/|Squidge-Project]]. Kernel modules occupying that resource need to be removed before (e.g. "leds-gpio" and "gpio-buttons"). In output-mode, voltage levels of the GPIOs were measured against GND, after the value 1 or 0 had been written to /sys/class/gpio/gpioX/value. In input-mode, the value of the file /sys/class/gpio/gpioX/value was read when the GPIO was floating (initial state), pulled to GND or pulled to Vcc. To make the GPIOs available via sysfs, the required ones have to be exported to userspace, as it is explained on a page of the [[http://squidge.sourceforge.net/gpio/|Squidge-Project]]. Kernel modules occupying that resource need to be removed before (e.g. "leds-gpio" and "gpio-buttons"). In output-mode, voltage levels of the GPIOs were measured against GND, after the value 1 or 0 had been written to /sys/class/gpio/gpioX/value. In input-mode, the value of the file /sys/class/gpio/gpioX/value was read when the GPIO was floating (initial state), pulled to GND or pulled to Vcc.
Line 233: Line 347:
The WPS button is located at the top (illuminated by the WPS LED) and can be easily pressed with a finger. The sliding switch is located at the side and has three positions: 3G, WISP, AP. The WPS button is located at the top (illuminated by the WPS LED) and can be easily pressed with a finger. The sliding switch is located at the side and has three positions: 3G, WISP, AP.
 +===== Hardware Hacks =====
==== External Antenna Hack ==== ==== External Antenna Hack ====
Line 241: Line 356:
If you want to add an external antenna connector or would like to know more about the MR3020 power consumption in different op-states you can find more info [[https://apollo.open-resource.org/lab:argus#modifications|Apollo-NG MR3020 External Antenna Hack]] If you want to add an external antenna connector or would like to know more about the MR3020 power consumption in different op-states you can find more info [[https://apollo.open-resource.org/lab:argus#modifications|Apollo-NG MR3020 External Antenna Hack]]
 +==== Adding I2C Bus ====
 +If you want to add I2C bus to your MR3020, you can use GPIO 7 and 29. Remove R15 and R17, then add pullup between 3.3v and gpio pin.
 +
 +{{:toh:tp-link:img_0229.jpg?600}}
 +
 +{{:toh:tp-link:img_0231.jpg?600}}
 +
 +Next step, add this line
 +<code>
 +i2c-gpio-custom bus0=0,7,29
 +</code>
 +to /etc/modules.d/99-i2c
 +
 +and load i2c-gpio-custom
 +
 +You can find more info in french here http://www.equinoxefr.org/post/2012/11/12/mr3020-et-i2c-avec-les-gpio/
 +
 +==== USB Hub Hack ====
 +
 +You can embedded usb hub to add more peripheral to your best router.
 +
 +I hack a 3$ STOREX usb hub, a 2$ µSD card reader and a 10$ webcam to build a robot with my MR3020.
 +
 +{{:toh:tp-link:img_0221.jpg?600}}
 +
 +
 +More info in french on http://www.equinoxefr.org/post/2012/11/05/projet-de-robot-wifi-torture-dun-routeur-tplink-mr3020/
 +
 +==== GPIO Pinout ====
 +
 +{{:media:tp-link_mr3020_top-pcb-gpio-pins.jpg?400|}}
 +
 +===== USB port and monitoring Serial Console via USB-Serial =====
 +
 +The USB port on the TL-MR3020 is not compatible with USB1 devices (aka full speed) and only works properly with USB2 (aka high speed) devices. You can however plug a USB-Serial adapter as long as you plug that through a <$10 USB2. While you're at it, use another USB port to plug in a USB key and write data there (like serial console logs) so as not to wear out the built in flash.
 +
 +See this page for more tips and how to create a serial console server out of your TL-MR3020:
 +http://marc.merlins.org/perso/linux/post_2012-12-05_Serial-Console-With-WR703N.html
 +
 +===== Boot log =====
 +
 +==== Factory Boot Log ====
-==== Boot log (Factory) ==== 
<code> <code>
U-Boot 1.1.4 (Aug 17 2011 - 09:25:09) U-Boot 1.1.4 (Aug 17 2011 - 09:25:09)
Line 462: Line 618:
</code> </code>
-===== Restoring original firmware =====+==== OpenWrt Boot Log and Info ====
-Restoring the original firmware follows the usual procedure: +  * [[https://gist.github.com/2059480#file_dmesg|dmesg TP-Link TL-MR3020]]
- +
-  * Get original firmware image into /tmp +
-  * Make sure it's in the correct format +
-  * Flash with //mtd// +
-  * Factory reset +
- +
-{{:meta:icons:tango:dialog-warning.png?nolink |Warning!}}**WARNING:** The following steps were tested successfully on an **MR-3020 V1.4**. Make sure that the firmware link used in the instructions below **matches your hardware revision** by following the firmware link in the link section below. +
- +
-First, set the mode switch to //WISP//. Without it, you might have trouble connecting after the reboot. Connect via ssh/telnet/serial and use the following commands: +
- +
-<code># opkg update && opkg install unzip +
-# cd /tmp +
-# wget http://www.tp-link.com/Resources/software/TL-MR3020_V1_120320.zip +
-# unzip TL-MR3020*.zip +
-# mtd -r write mr3020*up*.bin firmware +
-</code> +
- +
-After a couple of seconds, the router reboots automatically. Reconnect, open [[http://192.168.0.254/|http://192.168.0.254]], log in with //admin// / //admin//, and do a factory reset with //System Tools// / //Factory Defaults//.+
===== Link Dump ===== ===== Link Dump =====
Line 490: Line 628:
  * A backup of the whole original SPI flash content is available from [[http://db.tt/Cp4F1EtX|here]].   * A backup of the whole original SPI flash content is available from [[http://db.tt/Cp4F1EtX|here]].
  * [[http://www.heise.de/netze/artikel/Taschenrouter-als-IPv6-Verteiler-1440851.html|Taschenrouter als IPv6-Verteiler (auf Deutsch)]]   * [[http://www.heise.de/netze/artikel/Taschenrouter-als-IPv6-Verteiler-1440851.html|Taschenrouter als IPv6-Verteiler (auf Deutsch)]]
 +  * [[https://apollo.open-resource.org/lab:argus|Interesting webpage with more data about power consumption and so on]]
-==== Relevant forum links:====+==== Relevant Forum Links ====
[[https://forum.openwrt.org/viewtopic.php?id=33429|TP-Link TL-MR3020 Support]] [[https://forum.openwrt.org/viewtopic.php?id=33429|TP-Link TL-MR3020 Support]]
===== Custom IPv6 image for mr3020 (v1.7) ===== ===== Custom IPv6 image for mr3020 (v1.7) =====
-a custom image with ipv6 support: radvd, wide-dhcpv6, 3g stick support, made for RCS-RDS Fiberlink dual stack PPPoE service,+A custom image with ipv6 support: radvd, wide-dhcpv6, 3g stick support, made for RCS-RDS Fiberlink dual stack PPPoE service,
but should be okay for static wan settings on other ISPs: but should be okay for static wan settings on other ISPs:
http://www.ip6.ro/firmware/mr3020/ http://www.ip6.ro/firmware/mr3020/

Back to top

toh/tp-link/tl-mr3020.1349470602.txt.bz2 · Last modified: 2012/10/05 22:56 by mferlitsch