artikel / preparing tplink router for openwrt and usb flashdisc

Preparing TPLink Router for OpenWRT and USB Flashdisc

Preparing TPLink Router for OpenWRT and USB Flashdisc

This guide specifically explains how to set up a TP-Link router as a server using ugai. For routers that are still using the factory default settings, please refer to this page [].

First, reset the router to its initial condition: Restart the router and when the LED starts blinking, press the reset button for 3 seconds. Release the button after the router's LED blinks rapidly.

Login to the router from Windows PowerShell or terminal (MacOS/Linux) and remove all modifications:

telnet 192.168.1.1
mount_root
mtd -r erase rootfs_data
reboot -f

After router restart, login and setup network connection.

telnet 192.168.1.1
cd /tmp
vi /etc/config/network

add:

option gateway '192.168.1.254'  
list dns '8.8.8.8'
list dns '8.8.4.4'

Type :wq to save new configuration. Run new configuration:

/etc/init.d/network restart

Use ping to ensure you already connect:

ping perpustakaan.nirkabel.net 

The address '192.168.1.254 is the address of the router that connects the local network to the Internet. Adjust this address if it is different. If the network uses a pattern other than '192.168.1.xxx, also adjust the option ipaddr '192.168.1.1'.

download firmware

Download the firmware according to the hardware specifications. Check the specifications on the sticker/factory information at the back (bottom).

If the local network uses a proxy (example: 192.168.1.69), run this command first:

export http_proxy='http://192.168.1.69:8080'
  • TP-Link MR3020 V1

    wget https://archive.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/openwrt-ar71xx-generic-tl-mr3020-v1-squashfs-factory.bin
  • TP-Link MR3040 V1

    wget https://archive.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/openwrt-ar71xx-generic-tl-mr3040-v1-squashfs-factory.bin
  • TP-Link MR3220 V1

    wget https://archive.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/openwrt-ar71xx-generic-tl-mr3220-v1-squashfs-factory.bin
  • TP-Link MR3420 V1

    wget https://archive.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/openwrt-ar71xx-generic-tl-mr3420-v1-squashfs-factory.bin
  • TP-Link WR1043nd V1

    wget https://archive.openwrt.org/attitude_adjustment/12.09/ar71xx/generic/openwrt-ar71xx-generic-tl-wr1043nd-v1-squashfs-factory.bin

Replace your firmware (for MR3420)

mtd -r write openwrt-ar71xx-generic-tl-`mr3420`-v1-squashfs-factory.bin firmware

You will see:


Unlocking firmware ...

Writing from /tmp/openwrt-ar71xx-generic-tl-mr3420-v1-squashfs-factory.bin to firmware ...     
Rebooting ...

Reading USB FAT32

After the router restarts, check the LED:

  • If the LED keeps blinking continuously, the firmware replacement process has failed, and the router enters a state called bricked (neither dead or alive condition), where it is unresponsive. This guide does not cover how to recover the router (unbrick) from such a condition.
  • If the LED is lit normally, the next step is to install the USB reader system with the FAT32 format.

Relogin:

telnet 192.168.1.1

Move to temporer dir

cd /tmp

If the local network uses a proxy (example: 192.168.1.69), run this command first:

export http_proxy='http://192.168.1.69:8080'

Install:

wget https://perpustakaan.nirkabel.net/repositori/openwrt/ipk/aa/kmod-fs-vfat_3.3.8-1_ar71xx.ipk
wget https://perpustakaan.nirkabel.net/repositori/openwrt/ipk/aa/kmod-nls-cp437_3.3.8-1_ar71xx.ipk
wget https://perpustakaan.nirkabel.net/repositori/openwrt/ipk/aa/kmod-nls-iso8859-1_3.3.8-1_ar71xx.ipk
opkg install *.ipk
reboot -f

Plug USB Flashdisk or HDD and relogin:

telnet 192.168.1.1

Find out wether your router recognize your USB:

ls /dev/sd*

If you see /dev/sda1 on the screen, it means the USB has been detected. The next step is to link (mount) the USB partition to the system. This step is the same as the other method.

mkdir -p /mnt/usb 
mount -t vfat /dev/sda1 /mnt/usb 
uci add fstab mount 
uci set fstab.@mount[-1].target=/mnt/usb 
uci set fstab.@mount[-1].device=/dev/sda1 
uci set fstab.@mount[-1].fstype=vfat 
uci set fstab.@mount[-1].options=rw,sync 
uci set fstab.@mount[-1].enabled=1 
uci set fstab.@mount[-1].enabled_fsck=0 
uci commit 

The original OpenWRT 12.09 package already includes the uhttpd web server. We just need to install libpthread. Install the additional software libpthread:

opkg install /mnt/usb/install/ipk/libpthread.ipk
cp /mnt/usb/install/ipk/uhttpd.conf /etc/config/uhttpd
/etc/init.d/uhttpd start
/etc/init.d/uhttpd enable

If not needed (recommended), also remove LUCI the router management package:

opkg remove luci* --force-depends 
rm -f /etc/config/luci

The configuration for the next step is the same as in other firmware versions. Please refer to this article.

Selayang pandang proyek Perpustakaan Nirkabel

Perpustakaan Nirkabel (wireless library) is a 11-year-old project bringing digital technology to remote areas in Indonesia, empowering basic education and bridging the gap in education. It enables students in remote areas to access knowledge and resources previously out of reach. Witness the tech enthusiasts' brainchild with a heart for education.

detail