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.

Why dont you make a patch for Attitude adjustment? Its released, where as the  trunk will keep changing.

(Last edited by ron on 20 Jul 2013, 21:46)

@kamwanlai: thank you again for sharing your script!

@ron: I am interested to complete the patch against current trunk and submit it to openwrt-devel list for official inclusion. Later I can produce a patch for  AA.

Here goes the instruction of how to flash TL-MR13U with OEM firmware to OpenWRT.

I got my unit from AliExpress shop named DNS, exceptional attention, very good price and extremely fast delivery.

TP-Link TL-MR13U has a button on the left to check the battery level. If you press it you will see several blue leds turning on on the left side of the unit, right where you see a blue line, on its right side. My unit came with 3 leds charge level.

I put it to charge for several hours with 5V 1A charger (I understand that we can use 5V 2A charges too) I had from ebook reader. While charging it has a blue leds turning on as the charge progress, all leds go off as soon as it gets fully charged (4 leds).

I have not tryed to connect to the router with Ethernet cables as I did last time with TP-Link TL-MR10U and directly started the unit trying to connect by Wi-Fi. Wi-Fi came up (SSID: TP-LINK_XXXXXX, where XXXXXX is the last 6 digits of MAC address of your router printed on its back), but I was unable to get an IP address lease from the router. I had the switch on the router in position "AP", so I turned off the router, moved the switch into the middle position - "Router" and turned it on again. This time I got an IP lease.

Pointing the browser to http://192.168.1.1/ I got following screen:
http://farm3.staticflickr.com/2843/9328289087_127af8d7f6_m.jpg
where I just put "admin" (it was printed on the router's back) and pressed the button.

I got next screen:
http://farm3.staticflickr.com/2863/9328288939_62386a3a16_m.jpg
Sorry, I have no idea what it means, I just pressed the button and moved to router's main screen:
http://farm4.staticflickr.com/3681/9331084272_19fa0aa25c_m.jpg
From this screen I can see following interesting information:

3.15.1 Build 130517 Rel. 51827n
TL-MR13U v1 00000000

I assume that first line gives us information about firmware used and the second one - about hardware revision we have.

Taking steps to last item in the left column, and then selecting third item from top of the new list you reach firmware upgrade page (you can try to navigate to http://192.168.1.1/SoftwareUpgradeRpm.htm). Click on the button on the right of the input field, select firmware image "openwrt-ar71xx-generic-tl-mr13u-v1-squashfs-factory.bin" (the factory component in name is important) and press the button lower on the left. This will start the file upload to the router and you will advance to this screen:
http://farm8.staticflickr.com/7399/9331084560_c36c192590_m.jpg
You will see it for some time without any change as the file uploads to router. As soon as upload had finished you will advance to this screen:
http://farm8.staticflickr.com/7319/9331084502_1c1318e791_m.jpg
I assume that this progress bar show the flashing process progress. At some point you will loose wi-fi connection, I think in this moment the router reboots. As flashing finishes you will get this screen:
http://farm4.staticflickr.com/3730/9331084402_bacbb5f903_m.jpg
And few moments later the browser will refresh the page and you will get "Error 404" as the OpenWRT is running now and wi-fi is disabled by default:
http://farm6.staticflickr.com/5457/9331084382_67cf9d33d5_m.jpg

That's it. Your router now has the OpenWRT firmware, you need to connect by Ethernet cable, telnet to 192.168.1.1, run "passwd", type twice your new root's password and exit. Now you should be able to connect by ssh and continue with router configuration. Probably you want to edit /etc/config/wireless and remove this line to get Wi-Fi working:

# REMOVE THIS LINE TO ENABLE WIFI: 
option disabled 0

To start wi-fi interface just run "wifi" on command line.

You also may find useful to instal LuCI for easy web-based configuration:

opkg update
opkg install luci
/etc/init.d/uhttpd enable
/etc/init.d/uhttpd start

To transfer package files to router for further installation I use scp:

scp packagename.ipk root@192.168.1.1:/tmp/

(Last edited by otlabs on 7 Aug 2013, 16:03)

Got running kernel 3.10.1:

BusyBox v1.19.4 (2013-07-20 23:19:58 CDT) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 BARRIER BREAKER (Bleeding Edge, r37485)
 -----------------------------------------------------
  * 1/2 oz Galliano         Pour all ingredients into
  * 4 oz cold Coffee        an irish coffee mug filled
  * 1 1/2 oz Dark Rum       with crushed ice. Stir.
  * 2 tsp. Creme de Cacao
 -----------------------------------------------------
root@OpenWrt:~# uname -a
Linux OpenWrt 3.10.1 #1 Sat Jul 20 23:29:35 CDT 2013 mips GNU/Linux
root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                    1.1M    216.0K    936.0K  19% /
/dev/root                 1.8M      1.8M         0 100% /rom
tmpfs                    14.2M     48.0K     14.1M   0% /tmp
/dev/mtdblock3            1.1M    216.0K    936.0K  19% /overlay
overlayfs:/overlay        1.1M    216.0K    936.0K  19% /
tmpfs                   512.0K         0    512.0K   0% /dev
root@OpenWrt:~# 

:-)

thanks for the update @otlabs.

I would also love to see a patch for AA 12.09 r36088.

My MR13U is on the way!

You are very welcome @grayman4hire! Thank you for testing. My roadmap is following - I am waiting for acceptance of the patch for TL-MR10U unit in main trunk, ASAP it gets accepted I will submit a patch for TL-MR13U and right after that I will do my best to add support for TL-13U in AA. Hope your MR13U will arrive in one week, maybe I will have an AA patch that time ;-)

johan666 wrote:

You can also take a look of this
http://www.yoobao.com/en/product.asp?b_ … p;a_id=739

I think it is tl-wr703 inside.

That router has a built in flashlight! Too funny. Is it a Cree?

(Last edited by grayman4hire on 25 Jul 2013, 22:33)

Nowadays most of those external battery also include "light".
And that LED light can last for over hundreds of hours !
(that one claimed that able to light up for 380hrs)
It is quite useful !

I made some final changes to patch, now it applies against current trunk (r37561). So far latest firmware based on trunk runs fine so I submitted this patch to openwrt-devel list. Here comes the latest version of the patch:

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 56e87b1..0bad4e4 100755
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -134,6 +134,7 @@ get_status_led() {
         ;;
     archer-c7 | \
     tl-mr10u | \
+    tl-mr13u | \
     tl-wdr4300 | \
     tl-wr703n | \
     tl-wr720n-v3)
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 05b4566..883ac8c 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network
@@ -211,6 +211,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 bb96f63..b657a85 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -138,6 +138,9 @@ tplink_board_detect() {
     "001101"*)
         model="TP-Link TL-MR11U"
         ;;
+    "001301"*)
+        model="TP-Link TL-MR13U"
+        ;;
     "302000"*)
         model="TP-Link TL-MR3020"
         ;;
@@ -456,6 +459,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 c57e5d5..6370a6c 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -159,6 +159,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 8695bad..0b52737 100644
--- a/target/linux/ar71xx/config-3.10
+++ b/target/linux/ar71xx/config-3.10
@@ -64,6 +64,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 30e2b9c..634d94f 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 ceb0d0a..743e47f 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -973,6 +973,7 @@ $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),ARCHERC7,archer-c7-v1,ARCHE
 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR10U,tl-mr10u-v1,TL-MR10U,ttyATH0,115200,0x00100101,1,4Mlzma))
 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR11UV1,tl-mr11u-v1,TL-MR11U,ttyATH0,115200,0x00110101,1,4Mlzma))
 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR11UV2,tl-mr11u-v2,TL-MR11U,ttyATH0,115200,0x00110102,1,4Mlzma))
+$(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR13U,tl-mr13u-v1,TL-MR13U,ttyATH0,115200,0x00130101,1,4Mlzma))
 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR3020,tl-mr3020-v1,TL-MR3020,ttyATH0,115200,0x30200001,1,4Mlzma))
 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR3040,tl-mr3040-v1,TL-MR3040,ttyATH0,115200,0x30400001,1,4Mlzma))
 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR3220V2,tl-mr3220-v2,TL-MR3220-v2,ttyATH0,115200,0x32200002,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,

These image files are good for "long time use" as they use latest kerner 3.10.3 so you can install all kernel modules and other packages from snapshot repository, e.g. right from opkg managed or LuCI:

20130726 (Folder Link, 26.2 MB)
https://mega.co.nz/#F!wQwmSK4D!PcfV-CdEDawlAps9BIYstw

Some screenshots:

BusyBox v1.19.4 (2013-07-26 11:38:41 CDT) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 BARRIER BREAKER (Bleeding Edge, r37561)
 -----------------------------------------------------
  * 1/2 oz Galliano         Pour all ingredients into
  * 4 oz cold Coffee        an irish coffee mug filled
  * 1 1/2 oz Dark Rum       with crushed ice. Stir.
  * 2 tsp. Creme de Cacao
 -----------------------------------------------------
root@OpenWrt:~# free
             total         used         free       shared      buffers
Mem:         29068        17308        11760            0         1496
-/+ buffers:              15812        13256
Swap:            0            0            0
root@OpenWrt:~# uname -a
Linux OpenWrt 3.10.3 #1 Fri Jul 26 11:48:32 CDT 2013 mips GNU/Linux
root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                    1.1M    208.0K    944.0K  18% /
/dev/root                 1.8M      1.8M         0 100% /rom
tmpfs                    14.2M     52.0K     14.1M   0% /tmp
tmpfs                    14.2M     28.0K     14.2M   0% /tmp/root
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/mtdblock3            1.1M    208.0K    944.0K  18% /overlay
overlayfs:/overlay        1.1M    208.0K    944.0K  18% /

UPDATE: the patch is corrected now - I have changed 130101 to 001301.

(Last edited by otlabs on 7 Aug 2013, 03:54)

@jamc928, thank you for the link! It would be better to use https://forum.openwrt.org/viewtopic.php?id=45631 and provide short descruiption about what we will find following this link, something like:

@slboat opened the TL-MR13U and took nice pictures!

I made a mistake in my patch, Cezary Jackiewicz was so kind to comment me about it - we need to use "001301"*) in ./target/linux/ar71xx/base-files/lib/ar71xx.sh. Please, take this into account.

thank you otlabs i fixed

My MR-13U came this Saturday, but no one was around to sign for the registered mail (of all days they had to come on a Saturday). Of course, my wife can't find the notice they left, so now I'm trying to figure out what post office to pick it up from.

Anyways...any status on the AA patch?

Sorry, no AA patch yet - I am still waiting for any response on patch submitted to openwrt-devel list.

Thanks for the update and no problem @otlabs.

Just got my MR13U!

How do I go about building my own firmware image using the patch you provided above?

cd ~
mkdir mr13u
cd mr13u
svn co -r 37561 svn://svn.openwrt.org/openwrt/trunk
#cut/paste the content of your patch above into mr13u.37561.patch
patch -p1< mr13u.37561.patch
make menuconfig
#select mr13u

Just want to make sure I got it right. From @slboat pictures (thank you so much!) I would hate to have open it up to recover.

Thanks

There is no need to checkout r37561, this patch should cleanly apply on top of latest r37734 (I just checked).

Yes, all steps are correct, if you get any complains from patch - publish them here.

IMPORTANT: do not forget to change 130101 -> 001301 as it stated in msg #38!

UPDATE: I have corrected the patch in msg #35, you can just copy from there.

(Last edited by otlabs on 7 Aug 2013, 16:14)

Thanks @otlabs!

Call me paranoid, but I'm going to stick with r37561 since its been tested by you smile

I copied your patch to my dropbox to make it easier to pull down. Here is what I'm running:

cd ~
mkdir mr13u
cd mr13u
svn co -r 37561 svn://svn.openwrt.org/openwrt/trunk
cd trunk
wget http://dl.dropbox.com/u/42238/openwrt/mr13u/mr13u.patch
patch -p1< mr13u.patch

What am I doing wrong? Can't image those FAILED messages are normal.

user@ubuntu:~/mr13u/trunk$ patch -p1< mr13u.patch
patching file target/linux/ar71xx/base-files/etc/diag.sh
Hunk #1 FAILED at 134.
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 138.
Hunk #2 FAILED at 456.
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 159.
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
patching file target/linux/ar71xx/patches-3.10/930-add-tl-mr13u-support.patch
patching file tools/firmware-utils/src/mktplinkfw.c
Hunk #1 FAILED at 31.
Hunk #2 FAILED at 199.
2 out of 2 hunks FAILED -- saving rejects to file tools/firmware-utils/src/mktplinkfw.c.rej
user@ubuntu:~/mr13u/trunk$

It's not so bad idea to use r37561 ;-) Trunk is so unstable.

If you copied the patch from this message board you can get some problems with white spaces, e.g. tabs were changed to 8 spaces. I assume that's the problem.

Do you know an option for patch to ignore whitespaces?

I am unable to attach any file to my messages here. Can you download the patch from MEGA?

(Last edited by otlabs on 7 Aug 2013, 04:40)

Yeah, I'll give that a try. Thanks

[Edit] - That was it. I used the patch file from mega (with the minor correction you noted in post 38) and all is good now.

patching file target/linux/ar71xx/base-files/etc/diag.sh
patching file target/linux/ar71xx/base-files/etc/uci-defaults/02_network
patching file target/linux/ar71xx/base-files/lib/ar71xx.sh
patching file target/linux/ar71xx/base-files/lib/upgrade/platform.sh
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
patching file target/linux/ar71xx/image/Makefile
patching file target/linux/ar71xx/patches-3.10/930-add-tl-mr13u-support.patch
patching file tools/firmware-utils/src/mktplinkfw.c

Thank you again.

(Last edited by grayman4hire on 7 Aug 2013, 05:22)

Hi,

does somebody know how could we use it with a solar panel charger ?
https://forum.openwrt.org/viewtopic.php?id=45680

Which panel must we use and which charger control must we use to have it as an autonomous router ?

Sincerely thanks and have a nice day,

Miguipda ;-)

@grayman4hire: Great! You are welcome!

@miguipda: great start on so important topic of solar energy for autonomous routers! Keep researching and sharing your results! It's my huge dream to put MR13U on solar only power supply (and MR10U with built-in webcam).

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

diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 416322d..7590414 100755
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -139,6 +139,7 @@ get_status_led() {
     tl-wr941nd)
         status_led="tp-link:green:system"
         ;;
+    tl-mr13u | \
     tl-wdr4300 | \
     tl-wr703n)
         status_led="tp-link:blue:system"
diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/network b/target/linux/ar71xx/base-files/etc/uci-defaults/network
index 7fa219d..6daf568 100755
--- a/target/linux/ar71xx/base-files/etc/uci-defaults/network
+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/network
@@ -154,6 +154,7 @@ eap7660d |\
 mr600 |\
 rb-411 |\
 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 2bc8194..ed3b33e 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -111,6 +111,9 @@ tplink_board_detect() {
     "110101"*)
         model="TP-Link TL-MR11U"
         ;;
+    "001301"*)
+        model="TP-Link TL-MR13U"
+        ;;
     "302000"*)
         model="TP-Link TL-MR3020"
         ;;
@@ -384,6 +387,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 49b1de9..c105318 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -148,6 +148,7 @@ platform_check_image() {
         return 1
         ;;
     tl-mr11u | \
+    tl-mr13u | \
     tl-mr3020 | \
     tl-mr3040 | \
     tl-mr3220 | \
diff --git a/target/linux/ar71xx/config-3.3 b/target/linux/ar71xx/config-3.3
index 446f202..ff1db6a 100644
--- a/target/linux/ar71xx/config-3.3
+++ b/target/linux/ar71xx/config-3.3
@@ -56,6 +56,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 07d7059..34c7933 100644
--- a/target/linux/ar71xx/generic/profiles/tp-link.mk
+++ b/target/linux/ar71xx/generic/profiles/tp-link.mk
@@ -16,6 +16,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 9ebe486..5206b9b 100644
--- a/target/linux/ar71xx/image/Makefile
+++ b/target/linux/ar71xx/image/Makefile
@@ -873,6 +873,7 @@ $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR941NV4,tl-wr941nd-v4,TL-WR74
 $(eval $(call SingleProfile,TPLINK,$(fs_64kraw),TLWR1043,tl-wr1043nd-v1,TL-WR1043ND,ttyS0,115200,0x10430001,1,8M))
 
 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR11U,tl-mr11u-v1,TL-MR11U,ttyATH0,115200,0x00110101,1,4Mlzma))
+$(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR13U,tl-mr13u-v1,TL-MR13U,ttyATH0,115200,0x00130101,1,4Mlzma))
 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR3020,tl-mr3020-v1,TL-MR3020,ttyATH0,115200,0x30200001,1,4Mlzma))
 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLMR3040,tl-mr3040-v1,TL-MR3040,ttyATH0,115200,0x30400001,1,4Mlzma))
 $(eval $(call SingleProfile,TPLINK-LZMA,$(fs_64kraw),TLWR703,tl-wr703n-v1,TL-WR703N,ttyATH0,115200,0x07030101,1,4Mlzma))
diff --git a/target/linux/ar71xx/patches-3.3/930-add-tl-mr13u-support.patch b/target/linux/ar71xx/patches-3.3/930-add-tl-mr13u-support.patch
new file mode 100644
index 0000000..2daf6cd
--- /dev/null
+++ b/target/linux/ar71xx/patches-3.3/930-add-tl-mr13u-support.patch
@@ -0,0 +1,39 @@
+--- a/arch/mips/ath79/Kconfig
++++ b/arch/mips/ath79/Kconfig
+@@ -441,6 +441,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/Makefile
++++ b/arch/mips/ath79/Makefile
+@@ -75,6 +75,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
+--- a/arch/mips/ath79/machtypes.h
++++ b/arch/mips/ath79/machtypes.h
+@@ -72,6 +72,7 @@ enum ath79_mach_type {
+     ATH79_MACH_TEW_673GRU,        /* TRENDnet TEW-673GRU */
+     ATH79_MACH_TEW_712BR,        /* TRENDnet TEW-712BR */
+     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 */
diff --git a/tools/firmware-utils/src/mktplinkfw.c b/tools/firmware-utils/src/mktplinkfw.c
index 2be6335..595e6f9 100644
--- a/tools/firmware-utils/src/mktplinkfw.c
+++ b/tools/firmware-utils/src/mktplinkfw.c
@@ -30,6 +30,7 @@
 #define ALIGN(x,a) ({ typeof(a) __a = (a); (((x) + __a - 1) & ~(__a - 1)); })
 
 #define HEADER_VERSION_V1    0x01000000
+#define HWID_TL_MR13U_V1    0x00130101
 #define HWID_TL_MR3020_V1    0x30200001
 #define HWID_TL_MR3220_V1    0x32200001
 #define HWID_TL_MR3420_V1    0x34200001
@@ -179,6 +180,11 @@ static struct flash_layout layouts[] = {
 
 static struct board_info boards[] = {
     {
+        .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,

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

(Last edited by otlabs on 8 Aug 2013, 00:27)