Sysupgrade question for new device (TL-WPA8630P V2)

To cover the basic stock powerline UI/button functionality, here are some rough button scripts and PLC related luci-app-command suggestions for the eventual wiki page.

luci-app-commands for PLC status and management. This is a decent workaround for not having native PLC functionality in Luci.
opkg install luci-app-commands open-plc-utils-plctool open-plc-utils-plcrate

uci add luci command
uci set luci.@command[-1].name='Powerline Status'
uci set luci.@command[-1].command='plctool -i br-lan -m'

uci add luci command
uci set luci.@command[-1].name='Powerline Rates'
uci set luci.@command[-1].command='plcrate -i br-lan'

uci add luci command
uci set luci.@command[-1].name='Powerline Join'
uci set luci.@command[-1].command='plctool -i br-lan -B join'

uci add luci command
uci set luci.@command[-1].name='Powerline Leave'
uci set luci.@command[-1].command='plctool -i br-lan -B leave'

uci commit luci
Button scripts for 'LED' and powerline 'Pair'.
opkg install open-plc-utils-plctool open-plc-utils-plcrate

cat > /etc/rc.button/lights_toggle <<'EOF'
#!/bin/sh

[ "${ACTION}" = "released" ] || exit 0

control="/sys/class/gpio/tp-link:led:control/value"

if [ "$(cat ${control})" = "0" ]; then
	logger -p user.notice -t button "Enabling LEDs..."
	echo "1" > "$control"
else
	logger -p user.notice -t button "Disabling LEDs..."
	echo "0" > "$control"
fi

return 0
EOF
chmod +x /etc/rc.button/lights_toggle
echo "/etc/rc.button/lights_toggle" >> /etc/sysupgrade.conf


cat > /etc/rc.button/BTN_1 <<'EOF'
#!/bin/sh

[ "${ACTION}" = "released" ] || exit 0

. /lib/functions/system.sh

plc_mac="$(macaddr_add $(get_mac_label) +2)"
plc_interface="br-lan"

if [ "$SEEN" -ge 8 ]; then
	logger -p user.notice -t button "Sending 'leave' command to Powerline PLC..."
	plctool -i "$plc_interface" -B leave "$plc_mac"
elif [ "$SEEN" -ge 1 ]; then
	logger -p user.notice -t button "Sending 'join' command to Powerline PLC..."
	plctool -i "$plc_interface" -B join "$plc_mac"
fi

return 0
EOF
chmod +x /etc/rc.button/BTN_1
echo "/etc/rc.button/BTN_1" >> /etc/sysupgrade.conf


# Optional: log all button presses
mkdir -p /etc/hotplug.d/button
cat > /etc/hotplug.d/button/00-log-button <<'EOF'
logger -p user.notice -t button "Button: ${BUTTON}, Action: ${ACTION}, Seen: ${SEEN}"
EOF
echo "/etc/hotplug.d/button/00-log-button" >> /etc/sysupgrade.conf

1 Like

The patch that @jwmullally made is working and the WPA8630P v2.1 boots. The only issue is that the 5GHZ radio is not coming up. I believe this is because the board-2.bin firmware file shipped with OpenWRT does not describe that particular revision/ implementation of the QXA9888 chipset.

Does anyone know how to extract the board-2.bin from the OEM firmware file?

With help of @jwmullally I managed to extract the QCA9888 firmware files from the OEM firmware file.

It has a file named boarddata_0.bin and I replaced the OpenWRT board-2.bin with it. It appears to try to load it as it now says "invalid boad magic".

[   14.404271] ath10k_pci 0000:00:00.0: enabling device (0000 -> 0002)
[   14.411108] ath10k_pci 0000:00:00.0: pci irq legacy oper_irq_mode 1 irq_mode 0 reset_mode 0
[   15.621798] ath10k_pci 0000:00:00.0: qca9888 hw2.0 target 0x01000000 chip_id 0x00000000 sub 0000:0000
[   15.631379] ath10k_pci 0000:00:00.0: kconfig debug 0 debugfs 0 tracing 0 dfs 1 testmode 0
[   15.651962] ath10k_pci 0000:00:00.0: firmware ver 10.4-3.9.0.2-00070 api 5 features no-p2p,mfp,peer-flow-ctrl,allows-mesh-bcast,no-ps crc32 a44e2231
[   16.046145] ath10k_pci 0000:00:00.0: found invalid board magic
[   16.154239] ath10k_pci 0000:00:00.0: failed to fetch board-2.bin or board.bin from ath10k/QCA9888/hw2.0
[   16.164009] ath10k_pci 0000:00:00.0: failed to fetch board file: -12
[   16.184893] ath10k_pci 0000:00:00.0: could not probe fw (-12)

anyone with any ideas on what is going on?

No clear idea, but error looks similar to this thread: Guidance adding new device Linksys Velop WHW03

I tried the ath10k-bdencoder utility on the repo you referenced and it it gives no error on the OpenWRT board-2.bin file:

finas@madmax-vm ~/qca-swiss-army-knife/tools/scripts/ath10k $ ./ath10k-bdencoder -i board-2.bin 
FileSize: 84928
FileCRC32: f228337a
FileMD5: cd62d0656a0ab3526cb86f13bf54757a
BoardNames[0]: 'bus=pci,bmi-chip-id=0,bmi-board-id=16'
BoardLength[0]: 12064
BoardCRC32[0]: 165f27d1
BoardMD5[0]: c0fd21abadf20443153780b57f4c46a5
BoardNames[1]: 'bus=pci,bmi-chip-id=0,bmi-board-id=17'
BoardLength[1]: 12064
BoardCRC32[1]: ccfed209
BoardMD5[1]: dbf42e5d3cf1680ab1d718354d493214
BoardNames[2]: 'bus=pci,bmi-chip-id=0,bmi-board-id=18'
BoardLength[2]: 12064
BoardCRC32[2]: a7f0e9d9
BoardMD5[2]: ec1ff2be1b61ae53d8752fe6b1b0fa2e
BoardNames[3]: 'bus=pci,bmi-chip-id=0,bmi-board-id=23'
BoardLength[3]: 12064
BoardCRC32[3]: 795cc344
BoardMD5[3]: 1ae64807b2a91269878574aa1cabc185
BoardNames[4]: 'bus=pci,bmi-chip-id=0,bmi-board-id=24'
BoardLength[4]: 12064
BoardCRC32[4]: 9ec997a9
BoardMD5[4]: f9828e262a6827c772f62ec0bc7306ae
BoardNames[5]: 'bus=pci,bmi-chip-id=0,bmi-board-id=25'
BoardLength[5]: 12064
BoardCRC32[5]: 04d9857f
BoardMD5[5]: 37cc0eda80791408a9f2c436bf976a4a
BoardNames[6]: 'bus=pci,bmi-chip-id=0,bmi-board-id=16,variant=OM-A62'
BoardLength[6]: 12064
BoardCRC32[6]: 9f8ef437
BoardMD5[6]: 60f36b31866f5797aa7a857ed24b6913

but on the boarddata_0.bin and all the other files of the OEM fw directory it throws out an error:
finas@madmax-vm ~/qca-swiss-army-knife/tools/scripts/ath10k $ ./ath10k-bdencoder -i boarddata_0.bin

finas@madmax-vm ~/qca-swiss-army-knife/tools/scripts/ath10k $ ./ath10k-bdencoder -i boarddata_0.bin 
invalid signature found in boarddata_0.bin
Traceback (most recent call last):
  File "./ath10k-bdencoder", line 733, in <module>
    main()
  File "./ath10k-bdencoder", line 722, in main
    return cmd_info(args)
  File "./ath10k-bdencoder", line 467, in cmd_info
    print(cont.get_summary())
AttributeError: 'int' object has no attribute 'get_summary'

@Pedro: ahh, there was a typo in that patch in the /etc/hotplug.d/firmware/11-ath10k-caldata script, I fixed it so it should work now. I'll send you the patch again.

So far, these are the only unsupported V2 devices ref:

  • WPA8630v2 (CA)
  • WPA8630v2 (US)
  • WPA8630v2 (EU)

Because all the V2 devices are similar firmware wise, it might be easier for those users if there is custom firmware generation script somewhere that turns them into a WPA8630Pv2 (EU) or WPA8630Pv2 (AU) (and other firmware to revert to normal), after which the user can use the official OpenWRT images in the future without any trouble. E.g. Overwrite everything except the factory-uboot and art partitions. Care would need to be taken to include the regional PLC files in case there are regulatory specific settings. Might be a bit safer than giving instructions on how to make your own partition tables, which is easy to foul up and brick the device even with great care. This would be unsupported by OpenWRT though!

I have an 8630v2 (US) and it looks like it would work with the 8630P int build if only the SupportList included it, so I'd add it to the SupportList and put a note on the 8630/8630P page listing which 8630 models and stock firmware versions would work with which 8630/P firmware build so that someone like me doesn't have to do anything but look it that up instead of trying to run some random script or doing my own build.

The is the current OpenWRT position on supporting that device: link

So, my current feeling goes towards providing the above-mentioned two images officially and leave the remaining users to self-built images or downgrade methods.

The problem with 8630v2 (US) is that it has different partition tables depending on which version of the firmware its running, so AFAIK it won't be "officially" supported, as it won't be possible to prevent installing the wrong image. There will just need to be instructions somewhere for how to build an image going for it, or some special firmware that "turns" it into a support device.

  • If you are running Firmware version 2.0.1, luckily that only requires a small patch to tplink_safeloader which I think we could document somewhere, depending on how others feel about it. The problem with blind copy-paste is it will likely lead to bricked devices if users aren't checking everything very carefully.
  • If you are running Firmware version 2.0.2, you may be out of luck. It needs a different DTS file for the partition layout, and a way to deal with the non-contiguous os-image/file-system layout.

I put the basic information from all the threads into the wiki page here (needed for the EU 2.1 PR).
There are a few things missing, e.g.

  • TFTP details
  • PLC firmware upgrade instructions
  • photos of the boards (I don't have mine open any more),
  • Full OpenWRT bootlog.

If you have any of those (or want to make other changes) please fill them in:)

I'll add a section on using ImageBuilder with a summary of this comment Sysupgrade question for new device (TL-WPA8630P V2)

I can only see a 2.0.1 update for the v2 (US) and v2 (CA) on the TP-link website:

Can we add US/CA to SupportList and a US/CA build now?

Hi all,
I've got the 8630Pv2 (EU) and I've just tested the snapshot from the imagebuilder and it works fine!
I had to include luci to the make PACKAGES in order to fit it in.
I had the netdair openwrt firmware before, in order for sysupgrade image to install you need the board check to pass, so I just did a sysupgrade -F.

The only problem I still had, is the ath10k firmware cannot match the adapter, probably because of the board-2.bin file not containing the board label. I'm using the -ct firmware and I've edited the board-2.bin file with the help of ath10k-bdencoder and added the board id 31 to the table of board id 25.
It worked and the wlan0 interface is recognized as Qualcomm Atheros QCA9886 802.11nac.

This is where the newer TL-WPA8630(US) v2.0 firmware with the different partition layout appears (see this list for all of them):

(At a guess, it might have been a phased geographical rollout for the new US firmware which they haven't gone further with so far). The existence of that firmware is frustrating as otherwise it would be an easy decision to add the US model (a large market) to the OpenWRT INT version.

As it stands, if the US model was added to the OpenWRT INT version, it would work OK for the 2017.10.11 firmware, but if someone running the 2019.09.10 firmware flashed it, it would not boot (kernel is in different location) and not be recoverable without opening the device (which contains lethal voltages) and connecting serial or SPI flash cables.

Re: your earlier comment:

I'd add it to the SupportList and put a note on the 8630/8630P page listing which 8630 models and stock firmware versions would work with which 8630/P firmware build so that someone like me doesn't have to do anything but look it that up instead of trying to run some random script or doing my own build.

This would be nice. If its not included in the main source I think the images would have to be hosted somewhere else, similar to Netadairs original firmware. As mentioned earlier, its possible to rebuild the image using the official kernel, so all official package builds would still be compatible.


Can anyone confirm whether TFTP recovery is possible without opening the device? AFAIK it only works if initiated from the uboot serial console. If TFTP did work without opening, then it might be debatable to add "less safe" devices like this US model on the basis that they can be recovered using TFTP.

@Narrbot I made some automated builds for WPA8630(CA,EU,US)v2 here and added some links to them in the wiki.
After installing once, the devices are effectively the supported EU and INT OpenWRT firmwares, and regular packages and sysupgrades can be used from then on.

For anyone running the 2019 firmwares for those devices, the only solution is a custom firmware to downgrade it. I have a script to generate one, but its kinda risky and still needs some debugging.

Hi,

First of all big respect for all the time and effort you guys putting in to this! :+1:

i am following this topic for about a year now because i would like to upgrade my WPA8630P v2 EU device to a newer OpenWRT version. My exact device description is "TL-WPA8630P KIT(EU) Ver. 2.1"

Currently i am running the following Netadair version: (OpenWrt 18.06-SNAPSHOT r7781-f63a1caf22 / LuCI openwrt-18.06 branch (git-19.156.63894-115c4e3) which works fine at the moment.

But as a noob i have totally no idea how and if i can upgrade my device to newer OpenWRT version. To be honest at this point i am totally lost what steps to follow to upgrade my device :frowning:

This link explains that the Partition layout md5sum has to be the same as the one in the table and this can be checked with the following command: (grep -ao "partition .*$" wpa8630pv2_eu-up-ver2-0-3-P1-20171018-rel36564.bin | md5sum)

If i run that command (just copy / paste it) i get this output. Is that good or not, because the checksum does not match one of those in the table i suppose ?!?

root@MyAP:~# grep -ao "partition .*$" wpa8630pv2_eu-up-ver2-0-3-P1-20171018-rel3
6564.bin | md5sum
grep: wpa8630pv2_eu-up-ver2-0-3-P1-20171018-rel36564.bin: No such file or directory
**d41d8cd98f00b204e9800998ecf8427e**  -

Can someone tell me if it is possible to upgrade my device and point me in the right direction for the steps to follow to succesfully upgrade my device to a newer OpenRT version including the LuCI webinterface acces (simular to Netadair version)?

I'll take a look at tidying up those instructions, they are still a bit confusing. The md5sum part is mainly for people to find the partition layout from new versions of the stock firmware files.

For upgrading from the netadair firmware, you can use this sysupgrade file which is specific for TL-WPA8630P (EU) v2.1.

You can flash it with:

sysupgrade -F /tmp/openwrt-ath79-generic-tplink_tl-wpa8630p-v2.1-eu-squashfs-sysupgrade.bin

To install LuCI, you will have to follow these instructions to make a sysupgrade image with it installed. The command for your device would be:

make image PROFILE="tplink_tl-wpa8630p-v2.1-eu" PACKAGES="procd iw luci"

Edit: @rsn1

My exact device description is "TL-WPA8630P KIT(EU) Ver. 2.1"

Just noticed, this looks like the box description? Does it say that on the device barcode for model? If its TL-WPA8630P(EU) Ver. 2.0 then you should sysupgrade using the tl-wpa8630p-v2.0-eu firmware instead.

hi is there anyone had tplink_tl-wpa8630p-v2.0-eu and tplink_tl-wpa8630p-v2.1-eu original uboot dump or serial dump, my powerline has been bootloop when try to flash from openwrt to original firmware

TL-WPA8630P(AU)_V2_171030.zip contains a uboot-image but I'd wait for the others to chime in with re to whether or not it can be transplanted onto the EU HW. Apparently, so does the GPL-bundle available for the V1.

I do have the device and can send you the uboot image if you want. I don't have the factory firmware anymore but I am sure it would be the same.

1 Like

Here it is. There arr 2 files in the zip (mtd0 and mtd1). I believe I have the UK version.

If you need other partitions let me know.

This is what I copied as well from when I did the backup

mtd0: 00020000 00010000 "factory-uboot"
mtd1: 00020000 00010000 "u-boot"
mtd2: 005e0000 00010000 "firmware"
mtd3: 00166711 00010000 "kernel"
mtd4: 00470000 00010000 "rootfs"
mtd5: 00130000 00010000 "rootfs_data"
mtd6: 00010000 00010000 "partition-table"
mtd7: 00040000 00010000 "config"
mtd8: 000c0000 00010000 "nvm"
mtd9: 00040000 00010000 "pib"
mtd10: 00080000 00010000 "unused"
mtd11: 00010000 00010000 "art"