HOW TO RESTORE THE STOCK FIRMWARE ON TP-LINK

In order to restore the stock firmware on a TP-Link WR740N v4, TP-Link TL-WR941ND v5, previously Wifimu Powered (flashed with the wifimu firmware), you have to follow these steps:

 
MAC / LINUX USERS
 
STEP 1
Get the stock firmware in the TP-Link website www.tp-link.com
 
STEP 2
Download of the stock firmware from your laptop to the Access Point using scp. You can perform the following command:
# scp original.bin root@ip_of_ap:/tmp/

Note: “ip_of_ap” is the IP address assigned (you can check using the cloud dashboard under your AP settings from the TCP/IP tab) or if you are directly connecting to ir the fallback IP is 192.168.66.1

when prompted for password please use: admin (unless you changed it from the cloud dashboard under the device configurations)

STEP 3

Now accessing trhoug SSH to your AP, remove the boot descriptor from the firmware using the command dd

dd if=original.bin of=originalok.bin skip=257 bs=512

NOTE: be careful during this operation, as if not correctly performed you risk to brick the boot.
 
STEP 4
Remove the original file (in order to free space) with command
rm original.bin
 
STEP 5
Flash with command:
mtd -r write originalok.bin firmware

 
WINDOWS USERS

STEP 1

Download Putty (putty.exe) and PSCP (pscp.exe) from here:
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
 
STEP 2
Download the stock firmware for your model from the TP-Link website: www.tp-link.com

STEP 3 
Rename the TP-Link firmware that you just downloaded to original.bin

STEP 4 
Copy PSCP. PUTTY and original.bin to the same folder on the computer that is being used to store the restore firmware
 
STEP 5
Open a Command Prompt
 
STEP 6
Perform a ping to the IP_ADDR of the AP to verify that you can reach it.
The default fall-back IP_ADDR of the AP will be 192.168.66.1 only if you haven’t changed its configuration AND if there is no DHCP server in the LAN. In such case you’ll have to configure your laptop with the following example IP: 192.168.66.20 / subnet mask: 255.255.255.0.
If there is a DHCP server in the LAN, you’ll have to check the DHCP lease table to know which is the IP_ADDR of the AP.
 
STEP 7
Transfer the original firmware file to the AP into the /tmp/ folder with the following command (replace IP_ADDR with the IP address of the AP you want to flash back to stock firmware):

 pscp -scp original.bin root@IP_ADDR:/tmp/

when prompted, enter password: admin (or in case you changed it from the cloud dashboard you should use the one you defined)
 
STEP 8
SSH into the AP using Putty. See the username and password below.

cd /tmp
dd if=original.bin of=originalok.bin skip=257 bs=512

Note: Be careful during this operation, if not correctly performed you risk to brick the boot.
 
STEP 9
Remove the original file (in order to free space) with command:
rm original.bin
 
STEP 10
Flash with command:
mtd -r write originalok.bin firmware
 
Note: The default username and password for SSH access on a device running
Wifimu firmware are:
username: root
password: admin
SSH Port : 2122