OpenWrt Forum Archive

Topic: TP-Link TL-MR13U - small router with built-in 10,400 mAh battery

The content of this topic has been archived between 7 Jun 2015 and 22 Apr 2018. Unfortunately there are posts – most likely complete pages – missing.

Thanks @otlabs! I'm not sure if I'm brave enough to test it though wink

I just received my MR-13u and I have a question about charging. I connected a charger to "power" micro USB and I have only the red led. I don't know if it's charging or not. The router seems to be cold. How long does it take to charge ii to full?
I use a charger from Kindle Fire so it should provide enough power.

I wouldn't be susprised if it needs 8 to 10 hours to fully charge
I have a powerbank with the same capacity which needs that long to charge

And: on my mr10u, when I connect the power cable to charge, I get a red led too. So it sounds right to me!

I just measured with energy meter and I have 7.5 W at wall wart so it's around ~1A at 5V and now the red led changed to blue. But it still 7.5W so it's probably charging.

You need to wait till you get all 4 blue LEDs on, then they will turn off and your unit is fully charged. It can take upto 10 hours (or even more) to get it fully charged with 1A charger. Be patient, observe how LEDs turn on one by one and enjoy ;-)

OK. The leds went off and now it's draws only about ~2W when turned on.

otlabs wrote:

Christmas comes early this year. Especially for @grayman4hire ;-)

This patch brings support for TP-Link TL-MR13U in Attitude Adjustment 12.09 (r37729, latest release for AA):


You can get a patch file, firmware images and some packages from MEGA:

20130807 (Folder Link, 38.1 MiB)
https://mega.co.nz/#F!UVQmibwD!YYg-tmcyCaZpKtmAOpPsBA

WARNING: I had no time to test this build, so use it at your own risk (or wait till I get some time to test it).

I installed BB but now I can't revert to AA. When I run sysupgrade i get

Sysupgrade is not yet supported on unknown.
Image check 'platform_check_image' failed.

Can I maybe use --force option?

Or can I safely run?

mtd -r write openwrt-ar71xx-generic-tl-mr13u-v1-squashfs-sysupgrade.bin firmware

(Last edited by p4trykx on 17 Aug 2013, 22:24)

probably use mtd instead

OK
mtd works but I wanted to revert to original software and I have some problems.

I downloaded the original
http://service.tp-link.com.cn/detail_download_1226.html
and wanted to flash it with mtd but I get

Writing from /tmp/mr13uv1.bin to firmware ...  [e]Failed to erase block

After that I didn't reboot and flashed again with OpenWrt.
I looked around and I think that maybe the software form tp-link site has a bootloader in it.
The file has 4,1 MB (4063744 bytes)
http://wiki.openwrt.org/toh/tp-link/tl-wr741nd#back.to.original.firmware
I wonder if there is some way to determine it I have to cut the first 0x20200 bytes from original firmware.

Ok. It worked :-). I will update the Wiki page.
I was wondering if anyone manages to connect to the serial port. I saw some pictures form @slboat
https://forum.openwrt.org/viewtopic.php?pid=209022#p209022
and what I understand from the discussion attaching wires to those TX RX pads does not work.

otlabs wrote:

Christmas comes early this year. Especially for @grayman4hire ;-)

This patch brings support for TP-Link TL-MR13U in Attitude Adjustment 12.09 (r37729, latest release for AA):


You can get a patch file, firmware images and some packages from MEGA:

20130807 (Folder Link, 38.1 MiB)
https://mega.co.nz/#F!UVQmibwD!YYg-tmcyCaZpKtmAOpPsBA

WARNING: I had no time to test this build, so use it at your own risk (or wait till I get some time to test it).

Because it is not clear from the thread whether this version was so far successfully tested by anyone (AA 12.09, r37729), I would like to share my experience that updating the original TL-MR13U with openwrt-ar71xx-generic-tl-mr13u-v1-squashfs-factory.bin from the above mega link works fine for me.

The only difference to the description of 'otlabs' is that for updating the original TP-Link firmware I used the ethernet cable instead of wifi.  May be as a result, the TL-MR13U did not appear at 192.168.1.1 neither with AP nor ROUTER setting of the switch.  After switching it to 3G (and power on/off) the device then appeared under 192.168.1.1 and all following steps worked like a charm.

(Last edited by rodi on 21 Aug 2013, 20:11)

Hello all. I just got MR13U. Is there anybody who can provide the latest build for MR13U firmware?

Yesterday I have re-submitted the patch to OpenWrt-Devel. The patch was updated to accommodate recent changes introduced with: ar71xx: remove fs_* variables from image/Makefile.

You can get the patch from http://patchwork.openwrt.org/patch/4063/ and compile it by yourself. You will be rewarded with newest kernel 3.10.12!

As I can see this patch was already delegated to Gabor Juhos, this usually means that in 1-2-3 days were will be an answer, positive or negative, but the answer from OpenWrt team. That's very good.

Right now I am unable to generate firmware image for TL-MR13U as I am working on bringing back the deluge torrent client and my development environment is totally broken. Sorry.

I'm unable to apply patch from http://patchwork.openwrt.org/patch/4063/  on trunk(r38038)

git clone git://git.openwrt.org/openwrt.git openwrt-trunk
cd openwrt-trunk/
wget -O mr13u.patch http://patchwork.openwrt.org/patch/4063/raw/
git apply mr13u.patch

the last command returns "fatal: corrupt patch at line 227".
Am I doing anything wrong?

Try:

patch -p1 < mr13u.patch

and let me know about results.

"patch -p1 < mr13u.patch" also failed:

patching file target/linux/ar71xx/base-files/etc/diag.sh
Hunk #1 FAILED at 135.
1 out of 1 hunk FAILED -- saving rejects to file target/linux/ar71xx/base-files/etc/diag.sh.rej
patching file target/linux/ar71xx/base-files/etc/uci-defaults/02_network
patching file target/linux/ar71xx/base-files/lib/ar71xx.sh
Hunk #1 FAILED at 141.
Hunk #2 FAILED at 477.
2 out of 2 hunks FAILED -- saving rejects to file target/linux/ar71xx/base-files/lib/ar71xx.sh.rej
patching file target/linux/ar71xx/base-files/lib/upgrade/platform.sh
Hunk #1 FAILED at 161.
1 out of 1 hunk FAILED -- saving rejects to file target/linux/ar71xx/base-files/lib/upgrade/platform.sh.rej
patching file target/linux/ar71xx/config-3.10
patching file target/linux/ar71xx/files/arch/mips/ath79/mach-tl-mr13u.c
patching file target/linux/ar71xx/generic/profiles/tp-link.mk
Hunk #1 succeeded at 38 with fuzz 2.
patching file target/linux/ar71xx/image/Makefile
patch: **** malformed patch at line 220: SingleProfile,TPLINK-LZMA,64kraw,ARCHERC7,archer-c7-v1,ARCHER-C7,t

Ok, I was able to exactly reproduce all the error you have reported. I think these errors were introduced by my mail client - it broke several long lines in patch file.

I will publish the patch here, let me know if it working for you.

---
 target/linux/ar71xx/base-files/etc/diag.sh         |   1 +
 .../ar71xx/base-files/etc/uci-defaults/02_network  |   1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh       |   6 ++
 .../ar71xx/base-files/lib/upgrade/platform.sh      |   1 +
 target/linux/ar71xx/config-3.10                    |   1 +
 .../ar71xx/files/arch/mips/ath79/mach-tl-mr13u.c   | 107 +++++++++++++++++++++
 target/linux/ar71xx/generic/profiles/tp-link.mk    |  11 +++
 target/linux/ar71xx/image/Makefile                 |   1 +
 .../patches-3.10/930-add-tl-mr13u-support.patch    |  39 ++++++++
 tools/firmware-utils/src/mktplinkfw.c              |   6 ++
 10 files changed, 174 insertions(+)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-tl-mr13u.c
 create mode 100644 target/linux/ar71xx/patches-3.10/930-add-tl-mr13u-support.patch

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 7b790e2..381d4e8 100755
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -135,6 +135,7 @@ get_status_led() {
         ;;
     archer-c7 | \
     tl-mr10u | \
+    tl-mr13u | \
     tl-wdr4300 | \
     tl-wr703n | \
     tl-wr710n | \
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
index 176c485..e64d2b4 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -212,6 +212,7 @@ mr600v2 |\
 rb-411 |\
 tl-mr10u |\
 tl-mr11u |\
+tl-mr13u |\
 tl-mr3020 |\
 tl-mr3040 |\
 tl-wa901nd |\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index e7fbfbe..e61db3d 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -141,6 +141,9 @@ tplink_board_detect() {
     "001101"*)
         model="TP-Link TL-MR11U"
         ;;
+    "001301"*)
+        model="TP-Link TL-MR13U"
+        ;;
     "302000"*)
         model="TP-Link TL-MR3020"
         ;;
@@ -477,6 +480,9 @@ ar71xx_board_detect() {
     *"TL-MR11U")
         name="tl-mr11u"
         ;;
+    *"TL-MR13U")
+        name="tl-mr13u"
+        ;;
     *UniFi)
         name="unifi"
         ;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 8294fa4..8fbd395 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -161,6 +161,7 @@ platform_check_image() {
     archer-c7 | \
     tl-mr10u | \
     tl-mr11u | \
+    tl-mr13u | \
     tl-mr3020 | \
     tl-mr3040 | \
     tl-mr3220 | \
diff --git a/target/linux/ar71xx/config-3.10 b/target/linux/ar71xx/config-3.10
index 82559b8..0b91202 100644
--- a/target/linux/ar71xx/config-3.10
+++ b/target/linux/ar71xx/config-3.10
@@ -65,6 +65,7 @@ CONFIG_ATH79_MACH_TEW_632BRP=y
 CONFIG_ATH79_MACH_TEW_673GRU=y
 CONFIG_ATH79_MACH_TEW_712BR=y
 CONFIG_ATH79_MACH_TL_MR11U=y
+CONFIG_ATH79_MACH_TL_MR13U=y
 CONFIG_ATH79_MACH_TL_MR3020=y
 CONFIG_ATH79_MACH_TL_MR3X20=y
 CONFIG_ATH79_MACH_TL_WA901ND=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-mr13u.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-mr13u.c
new file mode 100644
index 0000000..8b03645
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-mr13u.c
@@ -0,0 +1,107 @@
+/*
+ *  TP-LINK TL-MR13U board support
+ *
+ *  Copyright (C) 2011 dongyuqi <729650915@qq.com>
+ *  Copyright (C) 2011-2012 Gabor Juhos <juhosg@openwrt.org>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+#include <linux/gpio.h>
+
+#include <asm/mach-ath79/ath79.h>
+
+#include "dev-eth.h"
+#include "dev-gpio-buttons.h"
+#include "dev-leds-gpio.h"
+#include "dev-m25p80.h"
+#include "dev-usb.h"
+#include "dev-wmac.h"
+#include "machtypes.h"
+
+#define TL_MR13U_GPIO_LED_SYSTEM    27
+
+#define TL_MR13U_GPIO_BTN_RESET        11
+#define TL_MR13U_GPIO_BTN_SW1        6
+#define TL_MR13U_GPIO_BTN_SW2        7
+
+#define TL_MR13U_GPIO_USB_POWER        18
+
+#define TL_MR13U_KEYS_POLL_INTERVAL    20    /* msecs */
+#define TL_MR13U_KEYS_DEBOUNCE_INTERVAL    (3 * TL_MR13U_KEYS_POLL_INTERVAL)
+
+static const char *tl_mr13u_part_probes[] = {
+    "tp-link",
+    NULL,
+};
+
+static struct flash_platform_data tl_mr13u_flash_data = {
+    .part_probes    = tl_mr13u_part_probes,
+};
+
+static struct gpio_led tl_mr13u_leds_gpio[] __initdata = {
+    {
+        .name        = "tp-link:blue:system",
+        .gpio        = TL_MR13U_GPIO_LED_SYSTEM,
+        .active_low    = 1,
+    },
+};
+
+static struct gpio_keys_button tl_mr13u_gpio_keys[] __initdata = {
+    {
+        .desc        = "reset",
+        .type        = EV_KEY,
+        .code        = KEY_RESTART,
+        .debounce_interval = TL_MR13U_KEYS_DEBOUNCE_INTERVAL,
+        .gpio        = TL_MR13U_GPIO_BTN_RESET,
+        .active_low    = 0,
+    },
+    {
+        .desc        = "sw1",
+        .type        = EV_KEY,
+        .code        = BTN_0,
+        .debounce_interval = TL_MR13U_KEYS_DEBOUNCE_INTERVAL,
+        .gpio        = TL_MR13U_GPIO_BTN_SW1,
+        .active_low    = 0,
+    },
+    {
+        .desc        = "sw2",
+        .type        = EV_KEY,
+        .code        = BTN_1,
+        .debounce_interval = TL_MR13U_KEYS_DEBOUNCE_INTERVAL,
+        .gpio        = TL_MR13U_GPIO_BTN_SW2,
+        .active_low    = 0,
+    },
+};
+
+static void __init tl_mr13u_setup(void)
+{
+    u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
+    u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
+
+    /* disable PHY_SWAP and PHY_ADDR_SWAP bits */
+    ath79_setup_ar933x_phy4_switch(false, false);
+
+    ath79_register_m25p80(&tl_mr13u_flash_data);
+    ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_mr13u_leds_gpio),
+                 tl_mr13u_leds_gpio);
+    ath79_register_gpio_keys_polled(-1, TL_MR13U_KEYS_POLL_INTERVAL,
+                    ARRAY_SIZE(tl_mr13u_gpio_keys),
+                    tl_mr13u_gpio_keys);
+
+    gpio_request_one(TL_MR13U_GPIO_USB_POWER,
+             GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED,
+             "USB power");
+    ath79_register_usb();
+
+    ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
+
+    ath79_register_mdio(0, 0x0);
+    ath79_register_eth(0);
+    ath79_register_wmac(ee, mac);
+}
+
+MIPS_MACHINE(ATH79_MACH_TL_MR13U, "TL-MR13U", "TP-LINK TL-MR13U v1",
+         tl_mr13u_setup);
diff --git a/target/linux/ar71xx/generic/profiles/tp-link.mk b/target/linux/ar71xx/generic/profiles/tp-link.mk
index e63aa7a..b7d4ec0 100644
--- a/target/linux/ar71xx/generic/profiles/tp-link.mk
+++ b/target/linux/ar71xx/generic/profiles/tp-link.mk
@@ -38,6 +38,17 @@ endef
 $(eval $(call Profile,TLMR11U))
 
 
+define Profile/TLMR13U
+    NAME:=TP-LINK TL-MR13U
+    PACKAGES:=kmod-usb-core kmod-usb2 kmod-ledtrig-usbdev
+endef
+
+define Profile/TLMR13U/Description
+    Package set optimized for the TP-LINK TL-MR13U.
+endef
+$(eval $(call Profile,TLMR13U))
+
+
 define Profile/TLMR3020
     NAME:=TP-LINK TL-MR3020
     PACKAGES:=kmod-usb-core kmod-usb2 kmod-ledtrig-usbdev
diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile
index 7f55e16..2f4aaec 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -911,6 +911,7 @@ $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,ARCHERC7,archer-c7-v1,ARCHER-C7,t
 $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLMR10U,tl-mr10u-v1,TL-MR10U,ttyATH0,115200,0x00100101,1,4Mlzma))
 $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLMR11UV1,tl-mr11u-v1,TL-MR11U,ttyATH0,115200,0x00110101,1,4Mlzma))
 $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLMR11UV2,tl-mr11u-v2,TL-MR11U,ttyATH0,115200,0x00110102,1,4Mlzma))
+$(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLMR13U,tl-mr13u-v1,TL-MR13U,ttyATH0,115200,0x00130101,1,4Mlzma))
 $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLMR3020,tl-mr3020-v1,TL-MR3020,ttyATH0,115200,0x30200001,1,4Mlzma))
 $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLMR3040V1,tl-mr3040-v1,TL-MR3040,ttyATH0,115200,0x30400001,1,4Mlzma))
 $(eval $(call SingleProfile,TPLINK-LZMA,64kraw,TLMR3040V2,tl-mr3040-v2,TL-MR3040,ttyATH0,115200,0x30400002,1,4Mlzma))
diff --git a/target/linux/ar71xx/patches-3.10/930-add-tl-mr13u-support.patch b/target/linux/ar71xx/patches-3.10/930-add-tl-mr13u-support.patch
new file mode 100644
index 0000000..76891c5
--- /dev/null
+++ b/target/linux/ar71xx/patches-3.10/930-add-tl-mr13u-support.patch
@@ -0,0 +1,39 @@
+--- a/arch/mips/ath79/Kconfig
++++ b/arch/mips/ath79/Kconfig
+@@ -516,6 +516,16 @@ config ATH79_MACH_TL_MR11U
+     select ATH79_DEV_USB
+     select ATH79_DEV_WMAC
+ 
++config ATH79_MACH_TL_MR13U
++    bool "TP-LINK TL-MR13U support"
++    select SOC_AR933X
++    select ATH79_DEV_ETH
++    select ATH79_DEV_GPIO_BUTTONS
++    select ATH79_DEV_LEDS_GPIO
++    select ATH79_DEV_M25P80
++    select ATH79_DEV_USB
++    select ATH79_DEV_WMAC
++
+ config ATH79_MACH_TL_MR3020
+     bool "TP-LINK TL-MR3020 support"
+     select SOC_AR933X
+--- a/arch/mips/ath79/machtypes.h
++++ b/arch/mips/ath79/machtypes.h
+@@ -83,6 +83,7 @@ enum ath79_mach_type {
+     ATH79_MACH_TEW_712BR,        /* TRENDnet TEW-712BR */
+     ATH79_MACH_TL_MR10U,        /* TP-LINK TL-MR10U */
+     ATH79_MACH_TL_MR11U,        /* TP-LINK TL-MR11U */
++    ATH79_MACH_TL_MR13U,        /* TP-LINK TL-MR13U */
+     ATH79_MACH_TL_MR3020,        /* TP-LINK TL-MR3020 */
+     ATH79_MACH_TL_MR3040,        /* TP-LINK TL-MR3040 */
+     ATH79_MACH_TL_MR3220,        /* TP-LINK TL-MR3220 */
+--- a/arch/mips/ath79/Makefile
++++ b/arch/mips/ath79/Makefile
+@@ -79,6 +79,7 @@ obj-$(CONFIG_ATH79_MACH_TEW_632BRP)    += m
+ obj-$(CONFIG_ATH79_MACH_TEW_673GRU)    += mach-tew-673gru.o
+ obj-$(CONFIG_ATH79_MACH_TEW_712BR)    += mach-tew-712br.o
+ obj-$(CONFIG_ATH79_MACH_TL_MR11U)    += mach-tl-mr11u.o
++obj-$(CONFIG_ATH79_MACH_TL_MR13U)    += mach-tl-mr13u.o
+ obj-$(CONFIG_ATH79_MACH_TL_MR3020)    += mach-tl-mr3020.o
+ obj-$(CONFIG_ATH79_MACH_TL_MR3X20)    += mach-tl-mr3x20.o
+ obj-$(CONFIG_ATH79_MACH_TL_WA901ND)    += mach-tl-wa901nd.o
diff --git a/tools/firmware-utils/src/mktplinkfw.c b/tools/firmware-utils/src/mktplinkfw.c
index 19dc2b4..2574678 100644
--- a/tools/firmware-utils/src/mktplinkfw.c
+++ b/tools/firmware-utils/src/mktplinkfw.c
@@ -31,6 +31,7 @@
 
 #define HEADER_VERSION_V1    0x01000000
 #define HWID_TL_MR10U_V1    0x00100101
+#define HWID_TL_MR13U_V1    0x00130101
 #define HWID_TL_MR3020_V1    0x30200001
 #define HWID_TL_MR3220_V1    0x32200001
 #define HWID_TL_MR3220_V2    0x32200002
@@ -199,6 +200,11 @@ static struct board_info boards[] = {
         .hw_rev        = 1,
         .layout_id    = "4Mlzma",
     }, {
+        .id        = "TL-MR13Uv1",
+        .hw_id        = HWID_TL_MR13U_V1,
+        .hw_rev        = 1,
+        .layout_id    = "4Mlzma",
+    }, {
         .id        = "TL-MR3020v1",
         .hw_id        = HWID_TL_MR3020_V1,
         .hw_rev        = 1,
-- 
1.8.4

Thanks, this new patch works.

[EDIT] I can apply the pacth by ignoring whitespace, but build failed:

Applying patch platform/930-add-tl-mr13u-support.patch
patching file arch/mips/ath79/Kconfig
Hunk #1 succeeded at 525 with fuzz 2 (offset 9 lines).
patching file arch/mips/ath79/machtypes.h
Hunk #1 FAILED at 83.
1 out of 1 hunk FAILED -- rejects in file arch/mips/ath79/machtypes.h
patching file arch/mips/ath79/Makefile
Hunk #1 FAILED at 79.
1 out of 1 hunk FAILED -- rejects in file arch/mips/ath79/Makefile
Patch platform/930-add-tl-mr13u-support.patch does not apply (enforce with -f)

I guess it's because tab being replaced by whitespace.

(Last edited by cz on 18 Sep 2013, 19:45)

Thanks a lot otlabs! Very helpful information!

Sorry, posts 76 to 75 are missing from our archive.