TP-Link TL-WR1043ND

The device is a wireless N router with

  • 3 detachable antennas
  • 4 Port 1000/100/10 Switch
  • 1 Port 1000/100/10 Wan Interface
  • 8 MiB Flash
  • 32 MiB DDR Ram
  • 1 x USB 2.0 Host

Supported Versions

Version/Model S/N OpenWrt Version Supported Model Specific Notes
v1.1 - Backfire 10.03 Similar to WR941ND.
v1.4 - Backfire 10.03 Same v1 board as v1.1.
v1.5 - Backfire 10.03 Same v1 board as v1.1.
v1.6 - Backfire 10.03 Similar

Hardware Highlights

CPU Ram Flash Network USB Serial JTag
Atheros AR9132@400MHz 32MB 8MB 4x1 Yes Yes Yes

Installation

  • Quickest way is to download a precompiled image, look for openwrt-ar71xx-tl-wr1043nd-v1-squashfs-factory.bin. Missing packages can easily be installed later per opkg update then for example opkg install kmod-ath9k wpad-mini.
  • You can allways build your own image based on Kamikaze or on Backfire. Chose Atheros AR71xx/AT7240/AR913x platform and use TP-Link WR1043ND v1 Profile.
  • OpenWrt is based on OpenSource. So if it does not give you enough freedom to build you own image using precompiled files, you can go back further in the process and even compile your own stuff then build an image with that. You are cordially invited to return any useful changes you make back into the project.

OEM easy installation

Install openwrt-ar71xx-tl-wr1043ndv1-squashfs-factory.bin using "Firmware Upgrade" from the orginal firmware.

OEM installation using the TFTP and RS232 method

If you want to upgrade using TFTP you follow these steps (as an alternative to the above install process).

Quick howto recover from bad flash. (full log)

Requirements:

  • terminal program (e.g. minicom) set to 115200 8N1, no flow control
  • file named code.bin containing openwrt firmware.
  • tftpd server with an address 192.168.0.5 (configurable with setenv command, printenv first if unsure)

Commands:

erase 0xbf020000 +7c0000 # 7c0000: size of the firmware (be aware that you may have a different size thus bricking your router)
tftpboot 0x81000000 code.bin
cp.b 0x81000000 0xbf020000 0x7c0000
bootm 0xbf020000

Upgrading OpenWRT

If OpenWRT is already installed and you wish to upgrade to a newer OpenWRT,

  • Login as root via ssh
  • Check memory usage with the free or top commands; the image can be up to 8MB, so only proceed if you have as much free RAM as the image size plus 6-8MB
  • An easy way to free up some RAM is to delete the symlinks to /etc/modules.d/20-mac80211 and /etc/modules.d/27-ath9k and reboot. Drop caches can be useful too:
root@OpenWrt:/# echo 3 > /proc/sys/vm/drop_caches
  • wget or scp the new firmware build to /tmp
  • And finally:
root@OpenWrt:/# mtd -r write /tmp/openwrt-ar71xx-tl-wr1043ndv1-squashfs-sysupgrade.bin firmware
Alternately you can use sysupgarde command:
root@OpenWrt:/# sysupgrade /tmp/openwrt-ar71xx-tl-wr1043ndv1-squashfs-sysupgrade.bin 

Another alternative is to use netcat if there is insufficient space for the firmware image on the router.

  • Login as root via ssh
  • Install netcat package (busybox binary does not have server support by default):
root@OpenWrt:/# opkg install netcat
  • On the router run:
root@OpenWrt:/# nc -l -p 1234 | mtd write - firmware
  • On your system run:
user@yourpc:~% nc -q0 192.168.1.1 1234 < openwrt-ar71xx-tl-wr1043nd-v1-squashfs-sysupgrade.bin

Back to original firmware

WARNING: Only perform the dd action below if your original firmware has the word "boot" in it, for example, wr1043nv1_en_3_9_17_up_boot(091118).bin. Please do not dd your original firmware if it has no "boot" in its name, for example, wr1043nv1_en_3_11_5_up(100427).bin, because if you do, you will brick your router! This was confirmed by supertom64

Cut first 0x20200 bytes from original firmware

dd if=orig.bin of=tplink.bin skip=257 bs=512

and flash via uboot or mtd

Hardware

Info

Architecture: MIPS
Vendor: Atheros
Bootloader: U Boot
System-On-Chip: AR9132
CPU Speed: 400 Mhz
Flash-Chip: ST 25P64V6P
Flash size: 8 MiB
RAM: 32 MiB
Wireless: Atheros AR9103 802.11n
Ethernet: Gigabit switch Realtek RTL8366RB
USB: Yes 1 x 2.0
Serial: Yes
JTAG: Yes

Ethernet Performance

The test was done with two fast PCs wit GBit-Nic and the 1043ND loaded with 10.03 between them. Netperf was used to measure the troughput with TCP and TCP_MAERTS tests.

  • Bridged: 100 MByte/s
  • Routed: 23 Mbyte/s
  • Routed without Firewall and Conntrack: 29MB/s

Power Consumption

with a cheap Wattmeter i measured 6,9W idle and 9W under load.

Photos

Opening the case

Note: This will void your warranty! These instructions are not very good! (yet…)

  1. There are two screws underneath the rubber feet at the back (were the RJ45 jacks are) of the device. Remove those.
  2. Pull the upper white plastic cover from behind. Big latches are on the edges near the front panel.
  3. Unhinge the plastic cover at the front.

Opening Instructions Part Deux:

  1. Remove the two screws from under the rubber feet at the back of the device.
  2. Unscrew all three retaining nuts on the SMA connectors and carefully push them into the housing.
  3. Push one of the bottom screws back into place to separate the top from the outer frame.
  4. With the top slightly open, push the bottom plastic away from the outer frame. Use a screwdriver if your fingers cannot reach the inside of the router.
  5. Remove outer frame.
  6. With a flathead screwdriver or similar tool, gently pry the two front clips apart. Each clip has two latches and are located at the corner next to the LEDs. Put your screwdriver behind the latches and push it towards the latch (which is also towards the ethernet ports).
  7. Carefully separate the bottom guide posts from the top of the unit, then pull the top section forward.

For closeup pictures of the plastic parts see http://www.flickr.com/photos/19739482@N05/sets/72157624000636958/

Serial

How to connect to Serial Port:

Solder a header as shown in the picture. The device uses 3.3v

JTAG

JTAG Port:

JTAG Line:

http://forum.openwrt.org/viewtopic.php?pid=79931#p79931

UBoot and Wholeflash backup download: http://www.uushare.com/user/chenshaoju/files/2742627

Software:

Download EJTAG Debrick Utility 3.0.1 from here

Backup:

Backup wholeflash:

tjtag3.exe -backup:custom /fc:25 /window:bf000000 /start:bf000000 /length:00800000

Backup UBoot:

tjtag3.exe -backup:custom /fc:25 /window:bf000000 /start:bf000000 /length:00020000

Backup Firmware:

tjtag3.exe -backup:custom /fc:25 /window:bf000000 /start:bf020000 /length:00800000
W A R N I N G

At the moment it is NOT possible to UNBRICK the router by JTAG (no write access to flashrom).

so be very carefull not to overwrite the redboot. Read more via:http://www.dd-wrt.com/phpBB2/viewtopic.php?p=421935#421935

specific configuration

Interfaces

The default network configuration is:

Interface Name Description Default configuration
br-lan LAN & WiFi 192.168.1.1/24
eth0 LAN ports (1 to 4) + WAN None
wlan0 WiFi Disabled

Switch Ports (for VLANs)

Numbers 1-4 are Ports 1-4 as labeled on the unit, number 0 is the Internet (WAN) on the unit, 5 is the internal connection to the router itself.

Port Switch port
Internet (WAN) 0
LAN 1 1
LAN 2 2
LAN 3 3
LAN 4 4
Gigabit Media Independent Interface 5

http://www.realtek.com.tw/products/productsView.aspx?Langid=1&PNid=18&PFid=15&Level=5&Conn=4&ProdID=197

Failsafe mode

  • Unplug the router's power cord.
  • Connect any router LAN port directly to your PC.
  • Configure your PC with a static IP address: 192.168.1.2
  • Plug the power on to the router
  • SYS LED will flash slow
  • press QSS button (front) unless the SYS-LED now flash very fast
  • Login to the router using telnet on 192.168.1.1 IP (no password)

Commands:

  • mount_root - will mount root filesystem
  • firstboot - all settings will be reseted

Recovery via serial console

You will see something like this:

.
No valid address in Flash. Using fixed address
: cfg1 0xf cfg2 0x7114
eth0 up
eth0
Autobooting in 1 seconds

Type

tpl
during this 1 second period. Then continue with OEM installation using the TFTP and RS232 method

Buttons

The WR1043ND has 2 buttons:

BUTTON Event
Reset reset
Quick Security Setup QSS

Basic configuration

Besides the QSS-Button, nothing special here. The WR1043ND has the standard hardware-assembly: The CPU is connected via two interfaces with the WiFi and the GBit-Switch. The Switch has 6 Ports and is capable of using VLANs. Depending on what you want to do with it, you should consider making a sketch on a sheet of paper.

After first login you will want to check things. Use free to see the memory usage. Use ps or top to see which services are up and running. Type in date to see the current date and time as well as the timezone. It will probably say 1970-something and UTC. Per opkg update and opkg install xxxx you can get missing packages. There is quite a variety. opkg upgrade does not work so far. Type in iptables -L to see the firewall presets. As an advanced user, you will probably not want to use this, and instead put up a clean one using the standard iptables-syntax avoiding the cumbersome uci-system.

Now, take a look at the Wiki for the Unified Configuration Interface. You do not have to, but you can use that to configure your Router. Network, DHCP-Daemon, DNS, firewall, timezone, some NTP-Servers of your choice, putting up some cronjobs, etc. When you are done adjusting and testing, you could export you configuration. You also can simply copy files like user.firewall.

Actually a couple of the above mentioned things can be done using only the web-interface, but not all of them. Also, adopting trunk, luci could not be working properly. The web-interface is more useful for accessing the "reconnect-button" for a pppoe connection and to have a quick overlook over some charts. Sadly OpenWrt, as it comes out of the box is not as far yet as other projects: Tomato, Gargoyle (based on OpenWrt!), DD-Wrt.

To enable access to a usb-drive you can simply install luci-app-samba. Look under Services/Network shares for the config.

Use USB as external package storage

Use the latest Build from: http://openwrt.groov.pl/WR1043NDv1/

or compile by yourself and include block-extroot. (Can't be installed later on)

First install required modules: kmod-usb2, kmod-usb-storage, kmod-fs-ext2 and e2fstools (or whatever filesystem you like) and restart the router. It may help to read the fstab of UCI section.

Take a usb device, partition it on an external pc (1 partiton should be ok) and plug the device in the routers usb port. Watch the boot messages (dmesg) to check wether the device is successfully recognized.

Create a filesystem on the drive: mkfs.ext2 /dev/sda1

edit /etc/config/fstab to

config 'global' 'automount'

      option 'from_fstab' '1'
      option 'anon_mount' '1'

config 'global' 'autoswap'

      option 'from_fstab' '1'
      option 'anon_swap' '0'

config 'mount'

      option 'target' ''
      option 'fstype' 'ext2' #change for your filesystem
      option 'options' 'rw,sync'
      option 'enabled_fsck' '0'
      option 'device' '/dev/sda1' #change for your partition
      option 'enabled' '1'
      option 'is_rootfs' '1' #this enable overlay root to external drive

Reboot and set the path in /etc/opkg.conf from /jffs to /overlay

An alternative to using this image is:

  1. mount external drive during boot
  2. change /etc/opkg.conf and either add a new destination to mountpoint of usb drive, or
  3. modify dest root to point to your usb drive
  4. copy contents of /usr/lib/opkg to your USB drive
  5. map directories where it is likely that they'll receive lots of files to your usb drive, for example with mount –bind during startup. /etc/rc.local could be one place where to map the dirs.

example: mount –bind /mnt/usb/root /root

               mount --bind /mnt/usb/usr/local /usr/local
               mount --bind /mnt/usb/home  /home

For packages which contain libraries, and are installed on external drive, those libraries need to be found. Installing ldconfig, and listing the additional library paths in /etc/ld.so.conf will take care of that. ldconfig must be executed after new libraries have been installed, and it can be installed to external drive. Executing it once during boot may be a good idea.

My setup is such that daemons and "core" services are installed in internal flash, optional command I install to external drive. During boot, the external directories with executables (<mountpoint>/[bin,sbin,usr/bin,usr/sbin] are added to PATH if mount of external drive took place. That way does the router continue to provide all relevant services, even with external storage disconnected.

Problems arose with these packages, when installing to external drive:

   file  -   it installs its dependency libmagic to external drive too, but looks for that lib on root device.
             Fix: a script in a directory in PATH which is searched before the directory which contains file,
             and which calls file (full path) with option -m and path to the libmagic:
             #!/bin/sh
             /mnt/usb/usr/bin/file -m /mnt/usb/usr/share/file/magic "$@"
   netcat    not really a problem, but the link  nc (busybox?) was still pointing to a file with wrong location.
             moving the nc link to external drive ( to the dir containing netcat) fixes that
   nfsd      /etc/init.d/nfsd contains hardcoded paths to executables on /usr/sbin

I reverted to the OpenWrt Image after having upgraded to the above image, because of a few problems I started to experience: midnight commander would segfault, and the router reboot file wouldn't work (return "Killed" or froze the router) openvpn, as client, would connect to server, but not send any packets through the tunnel These problems weren't observed with the openwrt image, therefore I am a bit wary of the above image now.

64MB RAM Mod

Replace RAM chip with any 32MB x 16bit chip. 333MHz also works fine. It's quite hard to finde these chips. The best chance is to have a look at DDR-SODIMM.

Working chips:

  • Hynix HY5DU121622DTP-D43 (From Mustang DDR-SODIM 512 MB)

No don't ask there are no 64 x 16 chips available → no 128 MB mod!

Be careful to remove the old one! Following procedure has been working for me:

  1. Unsolder all big condensators close to the memory.
  2. Wrap the board in Aluminum foil so that only the memory is visible.
  3. Heat the chip with a heatgun (i think a hairdryer is not enough)
  4. Once the chip is decently hot, slap the board carefully to the table, the chip should fall off. If not repeat 3.)
  5. remove the excess of solder by using a fine desoldering braid.
  6. put the new IC very exactly to the pads and solder on two corners. Then solder the rest.
  7. Resolder the condensators.

If the router is not working and you see a permanent restart on the serial console, check the connections, the memory is quite hard to destroy.

Don't do this if your are inexperienced in soldering, you will for sure destroy the contacts→Trash!

root@OpenWrt:~# free
total used free shared buffers
Mem: 62104 17472 44632 0 1392
Total: 62104 17472 44632

Back to top

toh/tp-link/tl-wr1043nd.txt · Last modified: 2010/08/11 15:46 by jow