Support for TP-Link TL-WPA8631P v4

It looks like a new V4 version of the TL-WPA8631P has been released:

This forum thread tracks adding support for this device into OpenWrt.

1 Like

Looking at the firmware, it looks very similar to the v3, so the v3 image may run OK on it with some small changes (maybe similar to this thread).

@WotC and anyone else with this device: I have a test build of OpenWrt 22.03.5 for anyone who is willing to test.

If it bricks your device, you'll need to open the device and use an FTDI cable like this to recover via uboot.

I can give it a try I think. Hopefully it doesn't brick the device otherwise I would have to order an FTDI cable and ask for your support to recover :slight_smile:.

Do you have a link to download? Would you consider the "wrong file" message when trying to update using the current 22.3.05 image for v3 normal/expected behaviour?

Out of curiosity: What have you modified for that release (just basic, no details pls :-))?

Thanks!

Great thanks!

Its the same change as here except adding the WPA8631P v4 EU Support List entry. (I still need to check are there other regional variants. Update: No, only EU v4 seems to be released so far).

Yes, I sent you a direct message on the forums with a link.

Yes, thats means the firmware update process was aborted due to an unaccepted input file. It happens when an unsupported firmware file is used (i.e. device not in firmware file support-list) or if the filename is too long.

Thanks for your explanation! Can confirm your image works! Great job, thanks a lot. I have to admit, the default interface wasn't bad - especially the PLC part, but... now it fits better to my other APs etc :slight_smile:.

Small improvement: the model name given by OpenWrt is not correct :stuck_out_tongue_winking_eye:

This info I took before flashing from the TP-Link interface:

Hardware Version: TL-WPA8631P v4.0
Firmware Version: 4.0.0 Build 20220510 Rel.56203

kr and thanks!

p.s. @jwmullally: are you also experienced with hostpad issues (like daemon.notice hostapd: phy0-ap0: STA-OPMODE-SMPS-MODE-CHANGED xx:xx:xx:xx:xx:xx static as described here: "STA-OPMODE-SMPS-MODE-CHANGED" what that mean? - #21 by WotC)? :innocent:

Edit: @jwmullally: can I now reflash my own configured OpenWrt image (includes some other packages if I remember correctly)? To my understanding yes, but would appreciate your confirmation.

1 Like

Great. Can you also confirm both the 2.4GHz and 5GHz WiFi radios work? I.e. make a different WPA2 or WPA3 SSID for each, then connect from another device and check you can reach LuCI. If you confirm that, I'll get the patch ready for submission.

Also can you check on the Network -> Interfaces -> Devices page that the "plc" interface is still mapped correctly to the PLC switch port? I.e. check that plugging an Ethernet cable into each switch port causes the LAN1, LAN2, and LAN3 to show the appropriate connected/disconnected (the "plc" port should always show as connected).

Yeah the OEM UI is pretty solid. If you haven't seen it, you can recreate all the PLC management functionality in the OpenWrt with the luci-app-commands detailed here.

To change that, we'd have to add the WPA8631P v4 as a new separate new device in OpenWrt (i.e. duplicating this and this), instead of simply adding it as an extra supported device to the existing WPA8631P v3 firmware (like this).

My preference is to just extend the existing image, but the OpenWrt devs may feel differently and insist on seperate entries. There are other devices in tplink-safeloader.c with multiple v1, v2 etc revisions all using the same definition.

In retrospect, the WPA8631P should probably have been added without the v3 in the name, but at the time we already saw differences between WPA8630P v1 and v2 that needed different firmware.

Nope sorry!

Yes, you can now sysupgrade to the official OpenWrt image here and from then on, there is no difference for your device.

For these WPA863* devices that require opening to debrick (because the OEM does not include TFTP recovery, probably for security reasons), I generally advise against using ImageBuilder to make custom images as its possible to create images that won't boot. But if you are prepared to recover using uboot serial etc then you can try it.

Here we go...

Both wifi radios work. VLANs also work.

All three LAN adapters work assigning the intended subnet IPs.
Pinging WAN from a PC connected to each of the three ports works.

Anything else :-)? I have to redo the PLC stuff showing up, but I haven't done that on my v3 device either.
Thanks!

1 Like

That looks comprehensive enough, thanks @WotC ! I'll submit that change now

Regarding a customized image: If I remember correctly I had to do it because of plc tools that would have exceeded storage if added to the default image. I removed firewall, dhcp server, ppp stuff to fit that in...

Here is the output of echo $(opkg list-installed | sed -e "s/\s.*$//") if someone is interested:

base-files busybox ca-bundle cgi-io dnsmasq dropbear ethtool firewall4 fstools fwtool getrandom hostapd-common iw iwinfo jansson4 jshn jsonfilter kernel kmod-cfg80211 kmod-crypto-aead kmod-crypto-ccm kmod-crypto-cmac kmod-crypto-crc32c kmod-crypto-ctr kmod-crypto-gcm kmod-crypto-gf128 kmod-crypto-ghash kmod-crypto-hash kmod-crypto-hmac kmod-crypto-manager kmod-crypto-null kmod-crypto-rng kmod-crypto-seqiv kmod-crypto-sha256 kmod-gpio-button-hotplug kmod-hwmon-core kmod-leds-gpio kmod-lib-crc-ccitt kmod-lib-crc32c kmod-mac80211 kmod-mt76-connac kmod-mt76-core kmod-mt7603 kmod-mt7615-common kmod-mt7615e kmod-mt7663-firmware-ap kmod-nf-conntrack kmod-nf-conntrack6 kmod-nf-flow kmod-nf-log kmod-nf-log6 kmod-nf-nat kmod-nf-reject kmod-nf-reject6 kmod-nfnetlink kmod-nft-core kmod-nft-fib kmod-nft-nat kmod-nft-offload kmod-ppp kmod-pppoe kmod-pppox kmod-slhc libblobmsg-json20220515 libc libgcc1 libiwinfo-data libiwinfo-lua libiwinfo20210430 libjson-c5 libjson-script20220515 liblua5.1.5 liblucihttp-lua liblucihttp0 libmnl0 libnftnl11 libnl-tiny1 libpthread libubox20220515 libubus-lua libubus20220601 libuci20130104 libuclient20201210 libucode20220812 libustream-wolfssl20201210 libwolfssl5.5.4.ee39414e logd lua luci luci-app-commands luci-app-firewall luci-app-opkg luci-base luci-compat luci-lib-base luci-lib-ip luci-lib-jsonc luci-lib-nixio luci-mod-admin-full luci-mod-network luci-mod-status luci-mod-system luci-proto-ipv6 luci-proto-ppp luci-ssl luci-theme-bootstrap mtd netifd nftables-json open-plc-utils open-plc-utils-hpavkeys open-plc-utils-plcrate open-plc-utils-plctool openwrt-keyring opkg procd procd-seccomp procd-ujail px5g-wolfssl rpcd rpcd-mod-file rpcd-mod-iwinfo rpcd-mod-luci rpcd-mod-rrdns ubi-utils ubox ubus ubusd uci uclient-fetch ucode ucode-mod-fs ucode-mod-ubus ucode-mod-uci uhttpd uhttpd-mod-ubus urandom-seed urngd usign wireless-regdb wpad-basic-wolfssl

A comparison between "my" image and yours is given here (sorry for the screenshot, found no easy way to post differences and can't find my notes from the image builder :-)):



If this doesn't suffice, I can provide more information if someone guides me.

KR

Change included in this PR:

Thanks. I think we can close this topic. Here is the image builder command I used including all packages:

make image PROFILE="tplink_tl-wpa8631p-v3" PACKAGES="base-files busybox ca-bundle cgi-io dnsmasq dropbear ethtool firewall4 fstools fwtool getrandom hostapd-common iw iwinfo jansson4 jshn jsonfilter kernel kmod-cfg80211 kmod-crypto-aead kmod-crypto-ccm kmod-crypto-cmac kmod-crypto-crc32c kmod-crypto-ctr kmod-crypto-gcm kmod-crypto-gf128 kmod-crypto-ghash kmod-crypto-hash kmod-crypto-hmac kmod-crypto-manager kmod-crypto-null kmod-crypto-rng kmod-crypto-seqiv kmod-crypto-sha256 kmod-gpio-button-hotplug kmod-hwmon-core kmod-leds-gpio kmod-lib-crc-ccitt kmod-lib-crc32c kmod-mac80211 kmod-mt76-connac kmod-mt76-core kmod-mt7603 kmod-mt7615-common kmod-mt7615e kmod-mt7663-firmware-ap kmod-nf-conntrack kmod-nf-conntrack6 kmod-nf-flow kmod-nf-log kmod-nf-log6 kmod-nf-nat kmod-nf-reject kmod-nf-reject6 kmod-nfnetlink kmod-nft-core kmod-nft-fib kmod-nft-nat kmod-nft-offload kmod-ppp kmod-pppoe kmod-pppox kmod-slhc libblobmsg-json20220515 libc libgcc1 libiwinfo-data libiwinfo-lua libiwinfo20210430 libjson-c5 libjson-script20220515 liblua5.1.5 liblucihttp-lua liblucihttp0 libmnl0 libnftnl11 libnl-tiny1 libpthread libubox20220515 libubus-lua libubus20220601 libuci20130104 libuclient20201210 libucode20220812 libustream-wolfssl20201210 libwolfssl5.5.4.ee39414e logd lua luci luci-app-firewall luci-app-opkg luci-base luci-lib-base luci-lib-ip luci-lib-jsonc luci-lib-nixio luci-mod-admin-full luci-mod-network luci-mod-status luci-mod-system -luci-proto-ipv6 luci-proto-ppp luci-ssl luci-theme-bootstrap mtd netifd nftables-json -odhcp6c -odhcpd-ipv6only openwrt-keyring opkg -ppp -ppp-mod-pppoe procd procd-seccomp procd-ujail px5g-wolfssl rpcd rpcd-mod-file rpcd-mod-iwinfo rpcd-mod-luci rpcd-mod-rrdns ubi-utils ubox ubus ubusd uci uclient-fetch ucode ucode-mod-fs ucode-mod-ubus ucode-mod-uci uhttpd uhttpd-mod-ubus urandom-seed urngd usign wireless-regdb wpad-basic-wolfssl"

KR

Cool, will wait until its merged and there is one official build to try before closing, just in case there are any new issues. The recovery for this device is so difficult its worth double-checking before many others start using it :sweat_smile:

An alternative is to just specify the changes in packages, this should work safely across different OpenWrt versions:

make image PROFILE="tplink_tl-wpa8631p-v3" PACKAGES="luci luci-app-commands open-plc-utils-plctool open-plc-utils-plcrate open-plc-utils-hpavkeys"

(without PPP)

make image PROFILE="tplink_tl-wpa8631p-v3" PACKAGES="luci luci-app-commands open-plc-utils-plctool open-plc-utils-plcrate open-plc-utils-hpavkeys -ppp -ppp-mod-pppoe -luci-proto-ppp"

Thanks! Your piece of code for the image builder makes more sense than mine :-)!

This is my latest version - includes "everything" except ppp stuff and even wpad-mbedtls (full) as well as firewall and dhcp (at least I suppose it includes that :slight_smile: - have to check it and will flash it on weekend):

make image PROFILE="tplink_tl-wpa8631p-v3" PACKAGES="luci luci-app-commands open-plc-utils-plctool open-plc-utils-plcrate open-plc-utils-hpavkeys -ppp -ppp-mod-pppoe -luci-proto-ppp -wpad-basic-mbedtls wpad-mbedtls"

KR

1 Like

Just FYI that since 21.02 the default wpad is wpad-basic-wolfssl, but newer releases may be switching back to mbedtls. You can check the default package selection with:

make info

I also thought that OpenWrt uses wpad-basic-wolfssl but when I run this command:

make image PROFILE="tplink_tl-wpa8631p-v3" PACKAGES="luci luci-app-commands open-plc-utils-plctool open-plc-utils-plcrate open-plc-utils-hpavkeys -ppp -ppp-mod-pppoe -luci-proto-ppp wpad-wolfssl"

I get this result:

Configuring wpad-wolfssl.
Configuring urngd.
Collected errors:
 * check_data_file_clashes: Package wpad-basic-mbedtls wants to install file /home/osboxes/Downloads/openwrt-imagebuilder-ramips-mt7621/build_dir/target-mipsel_24kc_musl/root-ramips/usr/sbin/hostapd
	But that file is already provided by package  * wpad-wolfssl
 * check_data_file_clashes: Package wpad-basic-mbedtls wants to install file /home/osboxes/Downloads/openwrt-imagebuilder-ramips-mt7621/build_dir/target-mipsel_24kc_musl/root-ramips/usr/sbin/wpa_supplicant
	But that file is already provided by package  * wpad-wolfssl
 * check_data_file_clashes: Package wpad-basic-mbedtls wants to install file /home/osboxes/Downloads/openwrt-imagebuilder-ramips-mt7621/build_dir/target-mipsel_24kc_musl/root-ramips/usr/sbin/wpad
	But that file is already provided by package  * wpad-wolfssl
 * opkg_install_cmd: Cannot install package wpad-basic-mbedtls.
make[2]: *** [Makefile:187: package_install] Error 255
make[1]: *** [Makefile:142: _call_image] Error 2
make: *** [Makefile:260: image] Error 2

whereas this succeeds:

make image PROFILE="tplink_tl-wpa8631p-v3" PACKAGES="luci luci-app-commands open-plc-utils-plctool open-plc-utils-plcrate open-plc-utils-hpavkeys -ppp -ppp-mod-pppoe -luci-proto-ppp wpad-basic-mbedtls"

That's really strange.

make info just provides this:

tplink_tl-wpa8631p-v3:
    TP-Link TL-WPA8631P v3
    Packages: kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap -uboot-envtools
    hasImageMetadata: 1
    SupportedDevices: tplink,tl-wpa8631p-v3

KR

See the Default Packages line at the top of the make info ImageBuilder output. 22.03.5 uses wpad-basic-wolfssl, while 23.05-SNAPSHOT uses wpad-basic-mbedtls.

This was included in the openwrt-23.05 tree in this commit and is available in the latest 23.05.0-rc3 build of the tplink_tl-wpa8631p-v3 image. I'll add the "v4" to the model list in the hardware data wiki page once 23.05 is released.

Thank you for your work! I recently purchased a WPA8631P v4 and am attempting to migrate it to openwrt, but I am getting the "Failed! Wrong file." error.

I have tried:

But so far nothing seems to work. Is this a function of US (what I have) vs EU models? I'm not seeing that specified anywhere in this thread. Edit: after doing a strings of the EU and US OEM firmware files, I see that the special_id 55530000 was added via the commit you linked.

Thank you in advance for any help you're able to provide!

At the time I added this I checked for all available v4 firmware, but missed this new US region for some reason.

Looking at the recent v4 US firmware wpa8631pv4_us-up-ver4-0-1-P1-20230510-rel51263-APPLC.bin, shows it needs this line added to tplink-safeloader.c:

{product_name:TL-WPA8631P,product_ver:4.0.0,special_id:55530000}

Aside from that, the partition scheme is the same as wpa8631p-v3, so luckily the same image should be compatible.

I have a test build for that here, can you try it? If it works OK I'll submit a new patch.

After renaming the file to openwrt-firmware.bin, v4.0.1 of the OEM firmware accepted the firmware upgrade and the basics look good so far!

Ah, I see that the combination of v4 and special_id 55530000 is missing from https://github.com/openwrt/firmware-utils/pull/9/files#diff-5c5d4e121375a503808ea33aca446673b89b95d6d6490303cfcaae451dbcd07fR2303 -- I see it, now!

Thank you very much!

1 Like