前言

手头有一个TP-Link的旅行路由器,型号TL-WR902AC v3。看起来适合刷个OpenWRT,出差或者旅游的时候用来翻墙。
首先,在OpenWRT官网上查找 TL-WR902AC v3 ,发现是支持的,并且官方提供了固件下载。但是由于官方固件没有LuCI和SSR插件,因此准备自己编译一版。

编译固件

编译固件的过程详见文章【编译自己的OPENWRT固件】

TL-WR902AC v3参数中,可以找到:

  • CPU: MediaTek MT7628AN
  • Target: ramips
  • Subtarget: mt76x8

首次尝试用默认配置编译,失败了。最后发现是这款路由器只有8M Flash,固件太大了。
好吧,重新选择配置,把不需要的全砍掉。

  • Target System (MediaTek Ralink MIPS)
  • Subtarget (MT76x8 based boards)
  • Target Profile (TP-Link TL-WR902AC v3)
CONFIG_TARGET_ramips=y
CONFIG_TARGET_ramips_mt76x8=y
CONFIG_TARGET_ramips_mt76x8_DEVICE_tplink_tl-wr902ac-v3=y
# CONFIG_BUSYBOX_DEFAULT_FEATURE_IPV6 is not set
# CONFIG_IPV6 is not set
# CONFIG_KERNEL_AIO is not set
# CONFIG_KERNEL_CGROUPS is not set
# CONFIG_KERNEL_CRASHLOG is not set
# CONFIG_KERNEL_DEBUG_INFO is not set
# CONFIG_KERNEL_DEBUG_KERNEL is not set
# CONFIG_KERNEL_DEVPTS_MULTIPLE_INSTANCES is not set
# CONFIG_KERNEL_ELF_CORE is not set
# CONFIG_KERNEL_FANOTIFY is not set
# CONFIG_KERNEL_FHANDLE is not set
# CONFIG_KERNEL_IPV6 is not set
# CONFIG_KERNEL_KALLSYMS is not set
# CONFIG_KERNEL_MAGIC_SYSRQ is not set
# CONFIG_KERNEL_POSIX_MQUEUE is not set
# CONFIG_KERNEL_PRINTK is not set
# CONFIG_KERNEL_PRINTK_TIME is not set
CONFIG_PACKAGE_boost=y
CONFIG_PACKAGE_boost-date_time=y
CONFIG_PACKAGE_boost-program_options=y
CONFIG_PACKAGE_boost-system=y
# CONFIG_PACKAGE_etherwake is not set
# CONFIG_PACKAGE_kmod-crypto-user is not set
# CONFIG_PACKAGE_kmod-nf-conntrack-netlink is not set
# CONFIG_PACKAGE_kmod-nf-ipt6 is not set
# CONFIG_PACKAGE_kmod-nls-base is not set
# CONFIG_PACKAGE_kmod-tun is not set
# CONFIG_PACKAGE_kmod-usb-core is not set
# CONFIG_PACKAGE_kmod-usb-ledtrig-usbport is not set
# CONFIG_PACKAGE_kmod-usb-ohci is not set
# CONFIG_PACKAGE_kmod-usb2 is not set
# CONFIG_PACKAGE_libip6tc is not set
# CONFIG_PACKAGE_libminiupnpc is not set
# CONFIG_PACKAGE_libnatpmp is not set
# CONFIG_PACKAGE_libuuid is not set
# CONFIG_PACKAGE_luci-app-arpbind is not set
# CONFIG_PACKAGE_luci-app-autoreboot is not set
# CONFIG_PACKAGE_luci-app-ddns is not set
# CONFIG_PACKAGE_luci-app-flowoffload is not set
# CONFIG_PACKAGE_luci-app-nlbwmon is not set
# CONFIG_PACKAGE_luci-app-ramfree is not set
CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Trojan=y
# CONFIG_PACKAGE_luci-app-unblockmusic is not set
# CONFIG_PACKAGE_luci-app-upnp is not set
# CONFIG_PACKAGE_luci-app-vlmcsd is not set
# CONFIG_PACKAGE_luci-app-vsftpd is not set
# CONFIG_PACKAGE_luci-app-wol is not set
# CONFIG_PACKAGE_luci-app-zerotier is not set
CONFIG_PACKAGE_luci-ssl-openssl=y
# CONFIG_PACKAGE_miniupnpd is not set
# CONFIG_PACKAGE_nlbwmon is not set
CONFIG_PACKAGE_trojan=y
# CONFIG_PACKAGE_vlmcsd is not set
# CONFIG_PACKAGE_vsftpd-alt is not set
# CONFIG_PACKAGE_zerotier is not set
CONFIG_TARGET_SQUASHFS_BLOCK_SIZE=1024
CONFIG_boost-compile-visibility-hidden=y
CONFIG_boost-runtime-shared=y
CONFIG_boost-static-and-shared-libs=y
CONFIG_boost-variant-release=y
# CONFIG_TARGET_ramips_mt7620_DEVICE_aigale_ai-br100 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_alfa-network_ac1200rm is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_alfa-network_r36m-e4g is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_alfa-network_tube-e4g is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_asus_rp-n53 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_asus_rt-ac51u is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_asus_rt-n12p is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_asus_rt-n14u is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_bdcom_wap2100-sk is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_buffalo_whr-1166d is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_buffalo_whr-300hp2 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_buffalo_whr-600d is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_buffalo_wmr-300 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_comfast_cf-wr800n is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_dlink_dch-m225 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_dlink_dir-510l is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_dlink_dir-810l is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_dlink_dwr-116-a1 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_dlink_dwr-118-a1 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_dlink_dwr-118-a2 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_dlink_dwr-921-c1 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_dlink_dwr-921-c3 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_dlink_dwr-922-e2 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_dovado_tiny-ac is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_edimax_br-6478ac-v2 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_edimax_ew-7476rpc is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_edimax_ew-7478ac is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_edimax_ew-7478apc is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_elecom_wrh-300cr is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_engenius_esr600 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_fon_fon2601 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_glinet_gl-mt300a is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_glinet_gl-mt300n is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_glinet_gl-mt750 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_head-weblink_hdrm200 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_hiwifi_hc5661 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_hiwifi_hc5761 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_hiwifi_hc5861 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_hnet_c108 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_iodata_wn-ac1167gr is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_iodata_wn-ac733gr3 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_iptime_a104ns is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_kimax_u25awf-h1 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_kimax_u35wf is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_kingston_mlw221 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_kingston_mlwg2 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_lava_lr-25g001 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_lenovo_newifi-y1 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_lenovo_newifi-y1s is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_linksys_e1700 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_microduino_microwrt is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_netgear_ex2700 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_netgear_ex3700 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_netgear_ex6130 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_netgear_wn3000rp-v3 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_nexx_wt3020-4m is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_nexx_wt3020-8m is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_ohyeah_oy-0001 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_phicomm_k2g is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_phicomm_psg1208 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_phicomm_psg1218a is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_phicomm_psg1218b is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_planex_cs-qr10 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_planex_db-wrt01 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_planex_mzk-750dhp is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_planex_mzk-ex300np is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_planex_mzk-ex750np is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_ralink_mt7620a-evb is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_ralink_mt7620a-mt7530-evb is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_ralink_mt7620a-mt7610e-evb is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_ralink_mt7620a-v22sg-evb is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_ravpower_wd03 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_sanlinking_d240 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_sercomm_na930 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_tplink_archer-c2-v1 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_tplink_archer-c20-v1 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_tplink_archer-c20i is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_tplink_archer-c50-v1 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_tplink_archer-mr200 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_tplink_re200-v1 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_vonets_var11n-300 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_wrtnode_wrtnode is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_xiaomi_miwifi-mini is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_youku_yk1 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_yukai_bocco is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_zbtlink_zbt-ape522ii is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_zbtlink_zbt-cpe102 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_zbtlink_zbt-wa05 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_zbtlink_zbt-we1026-5g-16m is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_zbtlink_zbt-we1026-h-32m is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_zbtlink_zbt-we2026 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_zbtlink_zbt-we826-16m is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_zbtlink_zbt-we826-32m is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_zbtlink_zbt-we826-e is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_zbtlink_zbt-wr8305rt is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_zte_q7 is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_zyxel_keenetic-omni is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_zyxel_keenetic-omni-ii is not set
# CONFIG_TARGET_ramips_mt7620_DEVICE_zyxel_keenetic-viva is not set
# CONFIG_TARGET_ramips_mt7620_Default is not set
# CONFIG_TARGET_x86_64 is not set
# CONFIG_TARGET_x86_64_Generic is not set
# CONFIG_TARGET_x86_core2 is not set
# CONFIG_TARGET_x86_generic is not set
# CONFIG_TARGET_x86_geode is not set
# CONFIG_TARGET_x86_legacy is not set
# CONFIG_TARGET_x86_zen is not set

编译完成后获得固件 openwrt-ramips-mt76x8-tplink_tl-wr902ac-v3-squashfs-tftp-recovery.bin,可以从 这里下载

写入固件

根据OpenWRT官方说明,这款路由器只有一种写入固件的方式,就是使用U-Boot的tftp recovery mode。

  • 在电脑上开启tftp服务器
  • 将电脑IP设置为 192.168.0.66/24
  • 将固件 openwrt-ramips-mt76x8-tplink_tl-wr902ac-v3-squashfs-tftp-recovery.bin 重命名为 tp_recovery.bin,并且放入tftp服务器的根目录
  • 连接电脑与路由器,按住reset键,接入电源并持续按住reset键几秒钟,直到LED开始闪烁
  • 路由器会自动从tftp下载固件并写入flash
  • 路由器自动重启

登陆

LEDE OpenWRT的默认登陆地址 192.168.1.1 ,账号 root ,密码 password

救砖

有时刷写固件失败的情况下,还可以恢复到TP-Link官方固件

  • 去TP-Link网站下载固件 TL-WR902AC(EU)_V3_170828.zip
  • 解压得到 TL-WR902ACv3_EU_0.9.1_0.1_up_boot[170828-rel57433].bin
  • 在term窗口执行以下命令,移除文件的prefix
dd if="TL-WR902ACv3_EU_0.9.1_0.1_up_boot[170828-rel57433].bin" of=tp_recovery.bin skip=257 bs=512
  • 将电脑IP设置为 192.168.1.100/24
  • 连接电脑与路由器,按住reset键,接入电源并持续按住reset键几秒钟,直到LED开始闪烁
  • 在term窗口执行以下命令,将固件复制到路由器
scp tp_recovery.bin root@192.168.1.1:/tmp
  • ssh连接到路由器
ssh root@192.168.1.1
  • 写入官方固件
mtd -r write /tmp/tp_recovery.bin firmware

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注