5
March
2024
19:07

How to flash TP-Link 842ND router on OpenWrt

5 March 2024 19:07

Installing another OpenWrt firmware.

Introduction

Router model TL-WR842ND. It was necessary to change one OpenWrt firmware to another.
The first was installed through the standard “green” web interface of regular firmware.
After some time, it turned out that there were not enough resources for the 23rd version and the router could barely move.
Then Wi-Fi began to disappear. There was a warning about this on the technical information page for the TL-WR842ND in red text.

It turned out that the router has an 8 GB permanent storage device installed, and the firmware takes up almost all the memory. It is necessary to install another, lighter firmware for the 4 GB ROM.

Details:
1) Initially flashed (via the web interface) software openwrt-22.03.5-ath79-generic-tplink_tl-wr842n-v2-squashfs-factory.bin - 8GB, its router “does not hold up”.
2) You need to flash the software version openwrt-19.07.9-ath79-generic-tplink_tl-wr842n-v2-squashfs-sysupgrade.bin - 4GB.

Actions

0) Disconnected the WAN cable because... it loads the processor. The LAN cable is connected to the PC.

1) Entered the router into Fail Safe mode, for which, after turning on the power, at the moment of changing the fast and slow blinking of the “Power” LED, no later than 2 seconds after changing the display mode, pressed the “Reset” button once (second from the left, if the router is “facing” with the inscription TP-Link).

The LED will flash quickly, indicating that Fail Safe mode is enabled.

2) On the computer, using the graphical utility "NetworkManager" (its icon is located in the system tray), configured the static IP address of the PC 192.168.1.2, which is located next to the IP address of the router 192.168.1.1.

3) Using the terminal and the ssh command, reset the root password (preferably)

ssh root@192.168.1.1

On the router side:

mount_root
passwd

I set a new empty password because... For router firmware, the root user password is not recommended.

4) Copied the new firmware openwrt-19.07.9-ath79-generic-tplink_tl-wr842n-v2-squashfs-sysupgrade.bin to the current user’s home folder ~/ under a simple name, for example “2.bin”.

5) You need to transfer the new firmware to the router. This is done with the SCP command (abbreviated SSH CP):

sudo scp ~/2.bin root@192.168.1.1:/tmp/2.bin

The password here is empty.

The authenticity of host '192.168.1.1 (192.168.1.1)' can't be established.
ED25519 key fingerprint is SHA256:3AIqYPaydw000GCqy2ocx+Oapeyrckm+RjXif3h6zjE.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.1.1' (ED25519) to the list of known hosts.
root@192.168.1.1's password:
2.bin 100% 4032KB 3.9MB/s 00:01 

6) Updating the router software in an SSH session:

sysupgrade -n /tmp/2.bin

where the /tmp directory is selected based on the largest free space df -h. The /tmp/2.bin path in the router’s file system may be different, but should point to the firmware file.

Note:

An easier way to update the firmware from LuCi - using the menu OpenWRT - System - Backup/Flash Firmware, where you also need to specify the file with the firmware *.bin.

As a result, the Wi-Fi router became very responsive after loading and the problem with Wi-Fi disconnecting disappeared and logging into the web interface became almost instantaneous.

Catalog with firmware for 4 GB ROM -OpenWrt downloads for ath79. As previously mentioned, the firmware is openwrt-19.07.9-ath79-generic-tplink_tl-wr842n-v2-squashfs-sysupgrade.bin


Links:
OpenWRT failsafe_and_factory_reset
OpenWRT failsafe mode
Transferring files via SSH
Forum - transferring files using SCP
MAN SCP in Russian
If there is not enough space on the device on the router
Technical information about OpenWRT for the TP-Link 842 model
Firmware OpenWrt 19.07.9