I was trying to install the latest stable release 19.07.4 on a TP-Link Archer C60(CA) v2.0 running factory OEM firmware and I ran into an error. After asking on Reddit I was told that is because the special_id for the Canadian model is not in the official releases but I can easily add it and compile my own.
So I forked the master branch, added the new special_id line, and built my images. That worked fine and I ended up with a *-factory.bin file. Instead of installing this on my hardware I figured I'd rather work from the stable release branch and config.
This happens to me too sometimes...but I don't know why exactly.
Don't bother with stable branch for development, master is not as "unstable" as you think it is. The worst thing that has happened to me flashing master is the wifi driver having a bug. As long as you have a serial cable with a reliable method to reflash then there's no issues.
Also no need to download the config.buildinfo, just run make menuconfig and it generates a default one if .config does not exist yet.
I don't have a reliable method to reflash or serial cable setup. To be honest all that stuff is way out of my comfort zone. I guess I could spend time becoming comfortable with that but I was trying to opt for the stable approach because it seems my router (at least the US version) is well supported by OpenWrt.
Something I just noticed is that the profiles.json file that gets output from the build (bin/targets/ath79/generic/profiles.json) only has a type:sysupgrade entry in the "profiles.tplink_archer-c60-v2.images" array of the JSON. I've been trying to work backwards from there to see how the configuration determines which images to build.
It should just be the makefile for all the config...and the build process creates the JSON file...
Have you tried editing the US variant instead of adding a CA variant?
BTW, even if you make a factory.bin on stable branch, you're assuming that everything about the board is identical to the US version. It probably is identical, but if there is a difference in partitions for example, you will have a lot of problems after flashing. I would recommend grabbing a serial cable anyway and have a look around on the OEM image.
Yeah soldering pins are best, but if you can't solder it is possible to have decent connections using paperclips, folding one of the tips so that its large enough to push into the through-hole for a friction fit.
OK now I'm really confused. It no longer seems to matter which branch I build or whether it has my patch in it or not. It never builds the factory.bin file anymore. Now I'm trying to find the combination of steps I used the first time that worked. I just started from scratch again and it didn't. Is there some step in the build process that could persist between different checkouts of the repo (in different folders)? Does the scripts/feeds update/install steps do anything outside of the individually checked out branch?
you have to resync the feeds whenever you switch between branches with large difference in time or commit number (like stable vs master). there is a make command that does both update and install together make package/symlinks
You can also make sure your config is in sync with make clean defconfig. If .config file does not exist yet, do make menuconfig instead.
Started from a new checkout again. Redid all steps a few times with different branches. I think I've confirmed that I can build a factory image on the stable and master official branches however if I add my change to either the build succeeds but I don't end up with a factory image. So I suspect there is something wrong with my changes.
All I changed is I added a new special_id line to the tplink-safeloader.c file here:
I managed to get it to build correctly by replacing one of the existing special_id entries instead of adding a new one. The router accepted the firmware and upgraded. So one step forward.
The install I did must not have contained the web interface because AFAICT it isn't running. I can SSH into the router and poke around but no web interface. Looking back I can see that I reset my config file to the defaults then told it which device to build but I didn't specify any packages or anything. Whoops.
In case someone else comes across the same issue here is the answer:
Official firmware does not yet support the Canadian version but it can be added by adding the special_id 43410000 to the tplink-safeloader.c file entry for this model. Adding another line doesn't work and won't compile properly so you have to replace one of the existing special_id lines.
@pandasuit your personal build issues is not stopping you from adding official support. I am pretty sure there is something else going on thats stopping factory.bin compile. BTW you can do the image recipe step again after a complete build with verbose output and hunt for the issue in the resulting txt.
using nohup nohup make V=s target/linux/install &
or using tee make V=s target/linux/install | tee -a output.txt
Make a PR with your commit that adds the line. Whoever reviews your PR will let you know if anything is wrong. If they accept it you can flash a snapshot image a few hours later.
Edit: Again, dowloading the config.buildinfo is a pointless step. The only difference is LuCI, simply select it in make menuconfig under LuCI --> Collections.
Very timely info for me gents...thanks!! - I just bought the same router earlier this week and I'm a first-timer with OpenWRT.
I took the direct binary file modification approach - I opted to bypass a toolchain setup with code recompile and the related makefile mysteria. While official support for the CA version would be best going forward, at least I have my router up and running with the current version of OpenWRT.
Here is what I did:
download the 19.07.4 -factory.bin file
change the "4252" at offset 0x2079 to "4341" (the CA special_id)
recalculated the MD5 hash (using info in the tplink-safeloader.c file) to be
61 9A BF 79 B8 79 08 B8 A4 EE F2 79 F9 76 33 FB
replace bytes at offset 4-19 in the .bin file to the hash values above
flashed the router using the TFTP tp_recovery.bin method (server at 192.168.0.66)
BTW - I used https://hexed.it to modify the .bin file - it's a great implementation.
@TedH Good to hear you figured it out that way. I highly recommend giving a try at building Openwrt locally if you have the time (maybe when official support is figured out here), I think you would find it very smooth and easy. Honestly it is a mystery to me why adding this one line is causing so many issues. I make custom images for about 10 different boards so when it is flashed it has the config and packages already and I only have issues when backporting. Here's the quick build guide and required packages