TP-LINK TL-WR841ND

From DD-WRT Wiki

Jump to: navigation, search


Contents

[edit] Hardware

See the OpenWRT wiki for hardware and recovery: https://wiki.openwrt.org/toh/tp-link/tl-wr841nd

Note: TP-Link TL-WR840N is similar to the 841ND. Note: V13 is marvell based and is not currently supported.

[edit] Wifi Switch toggle script

Taken from here: https://www.dd-wrt.com/phpBB2/viewtopic.php?t=312744

#!/bin/sh

instance=`ps | grep [c]ustom.sh | awk '{print $1}' | wc -l`
instanceps=`ps | grep [c]ustom.sh | awk '{print $1}' | head -1`
while [ "$instance" -gt "2" ]; do
   kill -9 "$instanceps"
   sleep 2
   instance=`ps | grep [c]ustom.sh | awk '{print $1}' | wc -l`
   instanceps=`ps | grep [c]ustom.sh | awk '{print $1}' | head -1`
done

while true; do
sleep 10
gpio16=`cat /proc/gpio/16_in`
wstatus=`iw ath0 info | grep ssid`

if [ "$gpio16" -ne "0" ] && [ -z "$wstatus" ]; then
   ifconfig ath0 up
   sleep 5
   hostapd -B -P /var/run/ath0_hostapd.pid /tmp/ath0_hostap.conf
   sleep 20
   wstatus=`iw ath0 info | grep ssid`
   if [ -z "$wstatus" ]; then
      ifconfig ath0 down
      sleep 5
      kill -9 `ps | grep [h]ostapd | head -1 | awk '{print $1}'`
   fi
fi
if [ "$gpio16" -eq "0" ] && [ -n "$wstatus" ]; then
   ifconfig ath0 down
   sleep 5
   kill -9 `ps | grep [h]ostapd | head -1 | awk '{print $1}'`
fi
done 

[edit] Hacking

[edit] Serial Port

In the pictures above there are schematics for soldering an Serial port. The serial runs at 115200 8N1.

To get into the U-Boot prompt, you have to type >tpl< while booting.

[edit] Flashing an alternate firmware from TFTP

First setup a TFTP server which is serving the firmware file. (Only flash "factory-to-"ddwrt/openwrt files). See Where do I download firmware? for links.

Then we have to setup the network settings. Type the following things into the bootloader prompt. Replace ROUTERIP and SERVERIP with the right IPs.

setenv ipaddr ROUTERIP

setenv serverip SERVERIP

Now we have to load the firmware into the memory!. Replace FACTORY-TO-OPENWRT/DDWRT.bin with the right filename of the image!

ar7240> tftpboot 0x80000000 FACTORY-TO-OPENWRT/DDWRT.bin

You will read something like that. The size is very important. Note it. It can differ to the example.


Bytes transferred = 3932160 (3c0000 hex)

The last steps are erasing the flash and writing the new image to the right address. Replace 3c0000 with the address you noted before.

ar7240> erase 0x9f020000 +0x3c0000

ar7240> cp.b 0x80000000 0x9f020000 0x3c0000

ar7240> bootm 0x9f020000

More instructions can be found on the OpenWRT link: https://wiki.openwrt.org/toh/tp-link/tl-wr841nd#tftp_installrecovery_via_serial

[edit] Recovery

See this OpenWRT Section for recovery of v8 and greater: https://wiki.openwrt.org/toh/tp-link/tl-wr841nd#tftp_recovery_via_bootloader_for_v8_v9_v10_v11_v12

[edit] Hardware Hacks

I already managed to solder an USB Hub on that router, with an 7805 as power supply.

I'll write somthing about it, next time!!