Flash Archer C20i from factory to OpenWRT/LEDE

I had a lot of success changing the firmware to OpenWRT on multiple TP-Link devices (TL-WR941ND, TL-WR841N, TL-WR740N). With original firmware these devices are only good for home use, but are not capable of supporting 10-20 users (or even more) for example in a dormitory. They just freeze, or drop wireless users randomly. But with an OpenWRT firmware they are rock stable, even under high load. Because these devices have only 4Mb of flash and 32Mb RAM they “just work” and don’t leave any opportunity for adding extra functionality (maybe a little muninlite or tinyproxy). With lede-17.01 you even have to disable some package feeds in opkg to install packages because opkg eats too much RAM. So it was time for a hardware upgrade…

Ingredients:

Problem:

When the original firmware is upgraded to the latest one, the device gets region locked, and drops an error code 4503 if you want to upload an unsigned firmware using the Web UI. It is possible to get around this using the TFTP flash method described by p.wassi. Keep in mind: Do not flash any firmware using TFTP as the device will overwrite everything from 0x0 address. The header has to be stripped and the image must contain a u-boot partition.

Remarks:

This post is based on the work of p.wassi and other OpenWRT/LEDE developers. I just wrote a step-by-step documentation about what I did.

  • Keep in mind that 5GHz is not working, even on LEDE-17.01.
  • Keep also in mind that you might brick your router, double & triple check everything.

Flashing and upgrading:

  1. Grab the TFTP firmware from p.wassi
  2. Check the MD5: e166f15cc9e0c93e4ebc70248d0dce1d, SHA256: d1b1a52ed8e80b355d855fff396b46b9d2fcbc68cea6cf65c09a82cb2becf5da
  3. Rename it to ArcherC20iV1_tp_recovery.bin
  4. Get a TFTP server
  5. Change your IP address to 192.168.0.66
  6. Install & Configure the TFTP server
    • Don’t add as a service.
    • add 192.168.0.66 to the LISTEN-ON segment
    • add C:\tftp\ to the HOME segment
  7. Disable firewall/anti-virus software.
  8. Start the tftp server as a stand-alone program.
  9. Copy the firmware to the C:\tftp\ directory
  10. Connect the router. LAN and WAN works.
  11. Press WPS/Reset for 10 seconds when powering up, the LED under the Update sign will light up.
  12. Wait for 2 minutes and don’t touch anything. Just observe the download from the TFTP server’s window.
  13. After the router reboots, change the network connection to obtain a dynamic ip.
  14. Connect to the router via putty: ssh root@192.168.1.1 without any password, as there is no luci installed.
  15. Change directory to /tmp and download the lede-17.01 sysupgrade.
    cd /tmp
    wget https://downloads.lede-project.org/releases/17.01.0/targets/ramips/mt7620/lede-17.01.0-r3205-59508e3-ramips-mt7620-ArcherC20i-squashfs-sysupgrade.bin
  16. Do the upgrade using
    sysupgrade -v lede-17.01.0-r3205-59508e3-ramips-mt7620-ArcherC20i-squashfs-sysupgrade.bin
  1. Wait for 2 long minutes and log into the Web UI.

The experiments with SQM can start! YAAY!

Update (2017-04-19):

You can upgrade to lede-17.01.1: (it also works from the UI):

cd /tmp
wget https://downloads.lede-project.org/releases/17.01.1/targets/ramips/mt7620/lede-17.01.1-ramips-mt7620-ArcherC20i-squashfs-sysupgrade.bin
sysupgrade -v lede-17.01.1-ramips-mt7620-ArcherC20i-squashfs-sysupgrade.bin

Count connected clients with muninlite on LEDE

Modify the /usr/sbin/munin-node file: download

24c24
< PLUGINS="df cpu if_ if_err_ load memory processes swap netstat uptime interrupts irqstats ntpdate plugindir_"
---
> PLUGINS="df cpu if_ if_err_ load memory processes swap netstat uptime interrupts irqstats iwinfo ntpdate plugindir_"
206a207,221
> }
> config_iwinfo() {
>   echo "graph_title Connected clients
> graph_args --base 1000 -l 0                                                                                                                                                        
> graph_vlabel iwinfo                                                                                                                                                                  
> graph_scale no                                                                                                                                                                     
> graph_category network                                                                                                                                                              
> iwinfo.label iwinfo                                                                                                                                                                    
> iwinfo.warning 10                                                                                                                                                                    
> iwinfo.critical 20                                                                                                                                                                  
> graph_info Connected wireless clients.                                                   
> iwinfo.info Average wireless clients in five minutes."
> }
> fetch_iwinfo() {
>   echo "iwinfo.value" $(iwinfo wlan0 assoclist | grep ago | wc -l)

References:

  1. https://pwassi.privatedns.org/lede/archerc20i/
  2. https://wiki.openwrt.org/toh/tabout:blankp-link/archer-c20i
  3. https://lede-project.org/toh/hwdata/tp-link/tp-link_archer_c20i_ac750_v1
Advertisements

Author: Gajdos Tamás

A "barefoot physicist" with some IT skills in system administration.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s