TP-LINK TL-WR841ND

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 14:21, 13 December 2017 (edit)
Ian5142 (Talk | contribs)
(Hardware)
← Previous diff
Revision as of 14:47, 13 December 2017 (edit) (undo)
Ian5142 (Talk | contribs)
(Flashing an alternate firmware from TFTP)
Next diff →
Line 65: Line 65:
ar7240> bootm 0x9f020000'' 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
-===Hardware Hacks===+==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
 +==Hardware Hacks==
I already managed to solder an USB Hub on that router, with an 7805 as power supply. I already managed to solder an USB Hub on that router, with an 7805 as power supply.

Revision as of 14:47, 13 December 2017

Contents

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.

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`
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 

Hacking

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.

Flashing an alternate firmware from TFTP

First setup a TFTP server which is serving the firmware file. (Only flash "factory-to-"ddwrt/openwrt files)

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

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

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!!