Support for tp-link ec220-g5

Hello All, I have a TPLink EC220-G5 router and am wanting to use nordvpn with it. Any suggestions as this router doesnt give me option to load an OVPN file to it like my last ASUS router did.Switched services and they require me to use this roouter. ugh.

Thanks

  1. If, as mentioned here, the tp-link ec220-G5 uses the same hardware as this Archer C5 V4 could I simply download and install the images for https://openwrt.org/toh/tp-link/archer_c5_v4

  2. I have the tp-link ec220-G5 ver:2.0, will it be the same hardware or not??

  3. I've seen here that the C4 V4 has wifi speed issues.
    If I ran 100Mbit/s up&down internet on it, with 5Ghz-WLAN would I be fine? Would I get full speeds?

Also noticed this: https://github.com/openwrt/openwrt/pull/4327
Is Giga Switch to do with Ethernet? Will Ethernet not work with OpenWRT currently?
Or Does it work fine?

PS I found this:

Hi, did you try to install open wrt on this device?

I did not, sorry

Found all gpios of this router:
LED:
-LAN - 1
-WIFI2.4 - 2
-WIFI5 - 9
-power - 42
-WAN - 53
-WPS - 55
Buttons:
-reset - 13
-WPS - 43

/* TP-LINK EC220_G5 V2 */

#define BOARD_PID "TL_EC220_G5-V2"
#define BOARD_NAME "TL_EC220_G5-V2"
#define BOARD_DESC "TP-Link EC220 Wireless Router"
#define BOARD_VENDOR_NAME "TP-LINK Technologies CO., LTD."
#define BOARD_VENDOR_URL "http://www.tp-link.com/uk-ua/"
#define BOARD_MODEL_URL "http://www.tp-link.com/uk-ua/support/download/ec220-g5/v2/"
#define BOARD_BOOT_TIME 25
#define BOARD_FLASH_TIME 120
#define BOARD_GPIO_BTN_RESET 13
#define BOARD_GPIO_BTN_WPS 43
#undef BOARD_GPIO_LED_ALL
#undef BOARD_GPIO_LED_WIFI
#define BOARD_GPIO_LED_SW2G 2
#define BOARD_GPIO_LED_SW5G 9
#undef BOARD_GPIO_LED_POWER 42
#define BOARD_GPIO_LED_LAN 1
#define BOARD_GPIO_LED_WAN 53
#undef BOARD_GPIO_LED_WAN_INVERTED
#undef BOARD_GPIO_LED_WAN_PHY
#undef BOARD_GPIO_LED_WAN_PHY_INVERTED
#undef BOARD_GPIO_LED_USB
#undef BOARD_GPIO_LED_ROUTER
#undef BOARD_GPIO_PWR_USB_ON
#undef BOARD_GPIO_PWR_USB
#undef BOARD_GPIO_PWR_USB2
#define BOARD_HAS_5G_11AC 1
#define BOARD_NUM_ANT_5G_TX 2
#define BOARD_NUM_ANT_5G_RX 2
#define BOARD_NUM_ANT_2G_TX 2
#define BOARD_NUM_ANT_2G_RX 2
#define BOARD_NUM_ETH_LEDS 0
#define BOARD_NUM_ETH_EPHY 4
#define BOARD_HAS_EPHY_L1000 1
#define BOARD_HAS_EPHY_W1000 1

CONFIG_RTL8367_PORT_WAN=3
CONFIG_RTL8367_PORT_LAN1=2
CONFIG_RTL8367_PORT_LAN2=1
CONFIG_RTL8367_PORT_LAN3=0
CONFIG_RTL8367_PORT_LAN4=4

I have the device running with Archer c5 v4 openwrt firmware. Only the WAN port does not work as a wan, but I am using it as a wireless repeater. I wish I could use a newer openwrt on it but I don't know much about code. But I would like to make myself available to test on my device. I'm currently using this version: "OpenWrt 19.07.3 r11063-85e04e9f46 / LuCI openwrt-19.07 branch git-20.136.49537-fb2f363"

Please, show your dts file?

Hello there, everyone!
I am a bit newbie to OpenWrt but looking forward to be an enthusiast.

I need to edit the Archer C5 V4 .dts file to support my EC220-G5. I've already downloaded this file.

But what changes must be made? How do I flash a new .dts file? I don't really care for LEDs and stuff like that, just WAN/LAN connection

Anyone using this router has an updated .dts or .bin file?

Thanks!

Time is running out for the EC220, and the C5v4, I wouldn't bother.

Oh, I got it.

But unfortunately I must to rewrite my router's MAC else I can't use ethernet on it...

This router does not provide a Clone MAC option, LuCI is the only way to go.

Theoretically, you could try to mount the flash, after you've booted an initramfs, then try to make the changes you need.

Thanks for your answers, could you please elaborate? As I have basically zero knowledge about openwrt, flashing etc..

You're not going to flash anything, but you'll need serial console access.

I found the reason why the gpio 2 (wlan2g) didn't work.
It's because of rfkill in keys section:

       keys {
               compatible = "gpio-keys";

               reset {
                       label = "reset";
                       gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
                       linux,code = <KEY_RESTART>;
               };

               rfkill {
                       label = "rfkill";
                       gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
                       linux,code = <KEY_RFKILL>;
               };
       };

I haven't noticed that before. It needs to clear out.

Here's working dts file:

# cat ./target/linux/ramips/dts/mt7620a_tplink_archer-c5-v4.dts
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

#include "mt7620a.dtsi"

#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>

/ {
	compatible = "tplink,archer-c5-v4", "ralink,mt7620a-soc";
	model = "TP-Link Archer C5 v4";

	aliases {
		led-boot = &led_power;
		led-failsafe = &led_power;
		led-running = &led_power;
		led-upgrade = &led_power;
		label-mac-device = &ethernet;
	};

	chosen {
		bootargs = "console=ttyS0,115200";
	};

	leds {
		compatible = "gpio-leds";

		led_power: power {
			label = "green:power";
			gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
		};

		wan_orange {
			label = "orange:wan";
			gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
		};

		wlan2g {
			label = "green:wlan2g";
			gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "phy1tpt";
		};

		wlan5g {
			label = "green:wlan5g";
			gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "phy0tpt";
		};

		lan {
			label = "green:lan";
			gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
		};
	};

	keys {
		compatible = "gpio-keys";

		reset {
			label = "reset";
			gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_RESTART>;
		};
	};

	rtl8367s {
		compatible = "realtek,rtl8367c";
		cpu_port = <7>;
		realtek,extif2 = <1 0 1 1 1 1 1 1 2>;
		mii-bus = <&mdio0>;
		phy-id = <29>;
	};
};

&gpio2 {
	status = "okay";
};

&spi0 {
	status = "okay";

	flash@0 {
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <60000000>;
		m25p,fast-read;

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "u-boot";
				reg = <0x0 0x20000>;
				read-only;
			};

			partition@20000 {
				compatible = "tplink,firmware";
				label = "firmware";
				reg = <0x20000 0x7a0000>;
			};

			partition@7c0000 {
				label = "config";
				reg = <0x7c0000 0x10000>;
				read-only;
			};

			rom: partition@7d0000 {
				label = "rom";
				reg = <0x7d0000 0x10000>;
				read-only;
			};

			partition@7e0000 {
				label = "romfile";
				reg = <0x7e0000 0x10000>;
				read-only;
			};

			radio: partition@7f0000 {
				label = "radio";
				reg = <0x7f0000 0x10000>;
				read-only;
			};
		};
	};
};

&state_default {
	gpio {
		groups = "i2c", "uartf", "ephy", "rgmii2";
		function = "gpio";
	};
};

&ethernet {
	pinctrl-names = "default";
	mtd-mac-address = <&rom 0xf100>;
	pinctrl-0 = <&rgmii1_pins &mdio_pins>;

	port@5 {
		status = "okay";
		mediatek,fixed-link = <1000 1 1 1>;
		phy-mode = "rgmii";
	};

	mdio0: mdio-bus {
		status = "okay";
		reset-gpios = <&gpio2 20 GPIO_ACTIVE_LOW>;
		reset-delay-us = <10000>;
	};
};

&ehci {
	status = "okay";
};

&ohci {
	status = "okay";
};

&wmac {
	ralink,mtd-eeprom = <&radio 0x0>;
	mtd-mac-address = <&rom 0xf100>;
};

&pcie {
	status = "okay";
};

&pcie0 {
	wifi@0,0 {
		reg = <0x0000 0 0 0 0>;
		mediatek,mtd-eeprom = <&radio 0x8000>;
		ieee80211-freq-limit = <5000000 6000000>;
		mtd-mac-address = <&rom 0xf100>;
		mtd-mac-address-increment = <2>;
	};
};


So I compiled 22.03.6 as in this post

Then I flashed the firmware, but ethernet and wlan5g won't work, it's happened because modules kmod-mt76x2 kmod-switch-rtl8367b haven't checked for some reasons during selecting target profile, don't know why.

I checked it out by hands in menuconfig. Now all works fine.

Try compiling version 23.05.2 from https://github.com/namiltd/openwrt/tree/openwrt-23.05-archer-c5-v4
Of course, correct the LEDs and keys to those appropriate for your router.

A little note: Since there are problems with the performance of 2.4GHz WiFi for Mediatek MT7620, disable 802.11w Management Frame Protection in Wireless Security.

GPL source code for TP-Link EC220-G5 v2

Support for TP-Link Archer C5 v4 has just been added to OpenWRT. Thanks to this, images for this router are available directly at https://firmware-selector.openwrt.org/?version=SNAPSHOT&target=ramips%2Fmt7620&id=tplink_archer-c5-v4
You can also build firmware for TP-Link ec220-g5 by changing mt7620a_tplink_archer-c5-v4.dts to:

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT

#include <dt-bindings/leds/common.h>

#include "mt7620a_tplink_archer.dtsi"

/ {
	compatible = "tplink,archer-c5-v4", "ralink,mt7620a-soc";
	model = "TP-Link Archer C5 v4";

	aliases {
		led-boot = &led_power;
		led-failsafe = &led_power;
		led-running = &led_power;
		led-upgrade = &led_power;
		label-mac-device = &ethernet;
	};

	leds {
		compatible = "gpio-leds";

		led_power: led-0 {
			function = LED_FUNCTION_POWER;
			color = <LED_COLOR_ID_GREEN>;
			gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
		};

		led-1 {
			function = LED_FUNCTION_WAN;
			color = <LED_COLOR_ID_ORANGE>;
			gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
		};

		led-2 {
			function = LED_FUNCTION_LAN;
			color = <LED_COLOR_ID_GREEN>;
			gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
		};

		led-3 {
			function = LED_FUNCTION_WLAN;
			color = <LED_COLOR_ID_GREEN>;
			function-enumerator = <2>;
			gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "phy0tpt";

		led-4 {
			function = LED_FUNCTION_WLAN;
			color = <LED_COLOR_ID_GREEN>;
			function-enumerator = <5>;
			gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "phy1tpt";
		};
	};

	/delete-node/ keys;

	keys {
		compatible = "gpio-keys";

		reset {
			label = "reset";
			gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
			linux,code = <KEY_RESTART>;
		};
	};

	rtl8367s {
		compatible = "realtek,rtl8367b";
		cpu_port = <7>;
		realtek,extif2 = <1 0 1 1 1 1 1 1 2>;
		mii-bus = <&mdio0>;
		phy-id = <29>;
	};
};

&spi0 {
	flash@0 {
		#address-cells = <1>;
		#size-cells = <1>;
	};
};

&state_default {
	gpio {
		groups = "i2c", "uartf", "ephy", "rgmii2";
		function = "gpio";
	};
};

&ethernet {
	pinctrl-names = "default";
	pinctrl-0 = <&rgmii1_pins &mdio_pins>;

	port@5 {
		status = "okay";
		mediatek,fixed-link = <1000 1 1 1>;
		phy-mode = "rgmii";
	};

	mdio0: mdio-bus {
		status = "okay";
		reset-gpios = <&gpio2 20 GPIO_ACTIVE_LOW>;
		reset-delay-us = <10000>;
	};
};

&wmac {
	pinctrl-names = "default", "pa_gpio";
	pinctrl-0 = <&pa_pins>;
	pinctrl-1 = <&pa_gpio_pins>;

	nvmem-cells = <&eeprom_radio_0>, <&macaddr_rom_f100 0>;
	nvmem-cell-names = "eeprom", "mac-address";
};

&wifi {
	nvmem-cells = <&eeprom_radio_8000>, <&macaddr_rom_f100 2>;
	nvmem-cell-names = "eeprom", "mac-address";
};

I don't have such a router, so I haven't checked if everything works properly. So test it out and send me any comments. If all goes well, there will be no obstacles to adding this router to the OpenWRT repository under its name.