OpenWrt support for Netgear WAX620

sooo this is:

diff --git a/target/linux/qualcommax/image/ipq807x.mk b/target/linux/qualcommax/image/ipq807x.mk
index 48dd7f7a39..378f37501b 100644
--- a/target/linux/qualcommax/image/ipq807x.mk
+++ b/target/linux/qualcommax/image/ipq807x.mk
@@ -28,7 +28,7 @@ define Build/wax6xx-netgear-tar
        mv $@ $@.tmp/nand-ipq807x-apps.img
        md5sum $@.tmp/nand-ipq807x-apps.img | cut -c 1-32 > $@.tmp/nand-ipq807x-apps.md5sum
        echo $(DEVICE_MODEL) > $@.tmp/metadata.txt
-       echo $(DEVICE_MODEL)"_V9.9.9.9" > $@.tmp/version
+       echo $(DEVICE_MODEL)"_V99.9.9.9" > $@.tmp/version
        tar -C $@.tmp/ -cf $@ .
        rm -rf $@.tmp
 endef
@@ -326,6 +326,8 @@ define Device/netgear_wax620
        BLOCKSIZE := 128k
        PAGESIZE := 2048
        SOC := ipq8072
+       IMAGES += ui-factory.tar
+       IMAGE/ui-factory.tar := append-ubi | qsdk-ipq-factory-nand | pad-to 4096 | wax6xx-netgear-tar
        DEVICE_PACKAGES := kmod-spi-gpio kmod-gpio-nxp-74hc164 \
                ipq-wifi-netgear_wax620
 endef
@@ -341,7 +343,7 @@ define Device/netgear_wax630
        PAGESIZE := 2048
        SOC := ipq8074
        IMAGES += ui-factory.tar
-       IMAGE/ui-factory.tar := append-ubi | wax6xx-netgear-tar
+       IMAGE/ui-factory.tar := append-ubi | qsdk-ipq-factory-nand | pad-to 4096 | wax6xx-netgear-tar
        DEVICE_PACKAGES := kmod-spi-gpio ipq-wifi-netgear_wax630
 endef
 TARGET_DEVICES += netgear_wax630

and

diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/init.d/bootcount b/target/linux/qualcommax/ipq807x/base-files/etc/init.d/bootcount
index 176a5a144a..e7c20493b6 100755
--- a/target/linux/qualcommax/ipq807x/base-files/etc/init.d/bootcount
+++ b/target/linux/qualcommax/ipq807x/base-files/etc/init.d/bootcount
@@ -17,5 +17,9 @@ boot() {
        linksys,mx8500)
                mtd resetbc s_env || true
        ;;
+       netgear,wax620|\
+       netgear,wax630)
+               fw_setenv boot_count 0
+       ;;
        esac
 }

Yep that all looks good. Let me know if you can flash it from stock and get it to switch partitions. Not sure how new you are to building images, so remember that by default Luci is not selected and you'll be connecting via SSH.

Building now .... it has been a while but I can still read a README file :slight_smile:
AFAIK it will get IP via dhcp, so I will pick this up from my router and ssh into it

I'm sorry for the late reply @ronni . But the code looks good and the AP will get IP from DHCP.

Update:

  • Build was successful with patch applied
  • Flash firmware on stock Netgear completed successfully (logs/notifications showed V99.9.9.9)
  • But it rebooted into previous (backup) native firmware
  • After trying 4 * reboot 5 sec hack still not able boot into openwrt

Good news is I did not brick it :slight_smile:

That's great. Are you able to boot from openwrt if you select "boot from second partition" or something like that in the web UI for Netgear?

Tried that (had to disable remote management first for option to be available) - but no success - it boots in to the newer version of stock firmware - so I can successfully swap between 2 versions of stock firmware ... no sign of openwrt image ...

Hmm... so it didn't write the Wrt image on any partition. If you have serial available, maybe it's time to connect and have a look what's happening when you try to upgrade.

I'm sorry, but I don't have any idea what to do here. But thanks for trying tho :slight_smile:

Alright, I'm going in - I bought usb ttl adapter waiting for it to ship - can you confirm the pin layout:

Great. I did write the text below in the PR so you’re right :slight_smile:

UART: Two 4-pin unpopulated headers under the LEDs.
Use the header closest to LED 4 and 5.
They are marked with a white stroke.
TX RX GND, beginning from "4". 115200n8.

So if I understand your third point correctly, it did auto switch firmware after 'flashing' but didn't actually flash anything.

When I have some time I'll set up a WAX630 build as above and compare the output image format to the official one to see if anything else is missing. There's a flasher script embedded in there on official firmwares but I don't think it gets used by UI firmware updates (at least didn't on WAX610). UART logs during the openWRT install could definitely help.

This is serial output during upgrade:

Watchdog handover: fd=3
- watchdog -
Qualcomm Technologies, Inc. IPQ807x/AP-HK07
Warning: optional section "sb11" missing from "/tmp/upgrade/nand-ipq807x-apps.img". Continue...
Warning: optional section "sbl2" missing from "/tmp/upgrade/nand-ipq807x-apps.img". Continue...
Warning: optional section "u-boot" missing from "/tmp/upgrade/nand-ipq807x-apps.img". Continue...
Warning: optional section "lkboot" missing from "/tmp/upgrade/nand-ipq807x-apps.img". Continue...
Warning: optional section "ddr-ap-hk07" missing from "/tmp/upgrade/nand-ipq807x-apps.img". Continue...
Warning: optional section "ssd" missing from "/tmp/upgrade/nand-ipq807x-apps.img". Continue...
Warning: optional section "tz" missing from "/tmp/upgrade/nand-ipq807x-apps.img". Continue...
Warning: optional section "rpm" missing from "/tmp/upgrade/nand-ipq807x-apps.img". Continue...
stat: No such file or directory
/sbin/sysupgrade: line 106: opkg: not found
Saving config files...
Command failed: Not found
Command failed: Not found
Performing system upgrade...
find: /proc/32379: No such file or directory
find: /proc/32380: No such file or directory
find: /proc/32381: No such file or directory
ubiformat: mtd20 (nand), size 62914560 bytes (60.0 MiB), 480 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 479 -- 100 % complete  
ubiformat: 480 eraseblocks have valid erase counter, mean value is 2
ubiformat: error!: file "/tmp/ubi.bin" is too large (118489088 bytes)
           error 0 (No error information)
Flashed ubi
0+1 records in
1+0 records out
2048 bytes (2.0KB) copied, 0.000041 seconds, 47.6MB/s
Unlocking /dev/mtd2 ...
Erasing /dev/mtd2 ...

Writing from <stdin> to /dev/mtd2 ...     
0+1 records in
1+0 records out
2048 bytes (2.0KB) copied, 0.000034 seconds, 57.4MB/s
Unlocking /dev/mtd3 ...
Erasing /dev/mtd3 ...

Writing from <stdin> to /dev/mtd3 ...     
UBI device number 2, total 480 LEBs (60948480 bytes, 58.1 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
Upgrade completed
[  377.903377] reboot: Restarting system

I think I figured this out - I built the ext4 instead of squashfs - will try to build squashfs now and see if that will fix my problem

SUCCESS!!!! image flashed
BUT: it still booted into stock firmware - where I did the "boot from backup partition" - and voila I could now ssh into operwrt :slight_smile:

1 Like

Nice. As expected the auto partition switch isn't being triggered. Can you run a couple of tests? Reboot 5x normally within openWRT and make sure you don't end up back on the other partition. Assuming not, do the "5 second etc" process I described before and see if it swaps back.

Awesome @ronni :+1:

So I hope to have a WAX620 to replace my garage/downstairs access point, a UAP-AC-LR running DD-WRT.

Is there an available build I can use to flash from stock firmware? Or will I need to either...

  • open the device to flash using serial
  • patch OpenWrt code as has been discussed, compile, and flash with webui

After I get an initial image installed and booted on one of the partitions, I should then use SSH to install a standard build from the OpenWrt Firmware Selector? I see that it defaults to version 24.10.0.

Any tips / corrections would be appreciated. Thank you!

If you can't build your own image, I can probably build one for you with the new changes from @ronni. Or if @ronni has a working image (success image) maybe he can share it :slight_smile: (asking politely)

I have working image (except for manual switch of firmware required) - but should we not push my patch into openwrt repo?

It has successfully survived 5+ reboots but I did not yet try the powercycles