OpenWrt support for Linksys MX4200

Hi @sppmaster,with the same setup (and same smartphone client), how much download throughput you may get with FOSS build? Thanks.

1 Like

Sorry to drag this down with a 101 question but I'm not a linux expert. I have a question about the current state of my MX4300: Went from OEM to EA6, and installed FOSS with the 6.6.53 kernel on top of it (thanks Lytr and Arix I think, forgive if I've lost track). It's been working great and I'm going to leave it alone until this is mainlined and the device page is up to speed, then work on a tailscale integration.
My question is how should I put the next desired release on it? Between the two, I don't think it's been partition swapping because it's also lost the OEM partition. I've tried hard alternate and it won't boot, do it again and comes back to Openwrt. So I'm uncertain how it's actually currently running. I'd like to get it back to dual-swap like the WRT3200ACM did.
Thanks everyone with the expertise who made this happen.

1 Like

I've setup USB recovery on a MX4300 running the commands and I have

root@MX4300:~# fw_printenv -n bootcmd
run bootusb; if test $auto_recovery = no; then bootipq; elif test $boot_part = 1; then run bootpart1; else run bootpart2; fi

I copied openwrt-qualcommax-ipq807x-linksys_mx4300-initramfs-uImage.itb file to a FAT32 4GB Flash Drive and rebooted but it cannot boot from it and runs the installed OpenWrt build.
@lytr Anything wrong I did?

You don't simply copy the file. You have to use dd. For example:

dd if=openwrt-qualcommax-ipq807x-linksys_mx4300-initramfs-uImage.itb of=/dev/sdX

Where X is the letter assigned to the flash disk by the operating system. This is all in Linux by the way.

1 Like

Thanks a lot, I've tried in Linux but in my case it needed a sudo to access the flash drive. Works OK and that USB recovery is really useful.
@lytr @innovara How can I check if it is possible that the USB recovery can be set on other router models that have USB ports. For example I have a QNAP 301w (it has two USB3 ports) and few months ago I made a mistake with my build and it couldn't run. I had to use the serial cable to recover it but it would be more convenient to run an initramfs and use it for recovery or tests. QNAP 301w has two firmware partition setup too. And I keep the stock QNAP firmware on the second partition but it lacks the auto recovery mechanism of the three consecutive boot failures and the serial connection must be used to switch to the other partition to recover it.

It looks like one of your partitions is screwed up while the other one happily runs openwrt. So the first thing you should do is figure out which of the two partitions is the (healthy) boot partition. Boot the router into openwrt and ssh into it. In addition, upload the desired firmware file (either openwrt or OEM) to the router using scp command.
Once this is done run the command:
fw_printenv -n boot_part
The output will give you 1 or 2 indicating which partition is currently running. Once you know that you can flash the firmware to the other partition. You can flash openwrt (I think you should flash factory file and not sysupgrade file) or you can flash OEM firmware.

If the output of the command above was 1, run

mtd -r -e alt_kernel -n write $firmware-filename alt_kernel

and if the output of the command above was 2, run

mtd -r -e kernel -n write $firmware-filename kernel

where $firmware-filename is the name of the firmware file you want to flash.

Be careful, you will almost certainly brick (softbrick?) the router if you try to flash the firmware into the currently running partition.

There is more detail here:
https://github.com/openwrt/openwrt/pull/16070

You need to check if u-boot has USB support. Run help in u-boot and check if you have the commands: usb, usbboot or fatload.

Thanks a lot, I know this is way back above but I'll screenshot this. I'm fine with command line but haven't the foggiest about the partition schemes, especially how people get these blocks and addresses. Nor the difference in how sysupgrade can overwrite in-place and work vs OEM install to alternate.
Since the partitioning was worked on throughout and I have several more of these in the box, what was the outcome of the merge regarding dual partitioning? Will OEM to initial Openwrt result in two functional partitions?

Thanks for your help. I suppose I need to use a serial cable to read the console output. Can I run those from OpenWrt.

No, but you can dump u-boot partition and analyze binary file.

1 Like

There was a pull request to allow upgrade into the running partition but I have not don't know if it was merged as I am happy to upgrade into a non-running partition. I have replaced OEM firmware with openwrt on both partitions and that suits me.

Given a router with OEM firmware, the initial openwrt flash will only install openwrt into one partition. At that point, you can continue running OEM firmware in one partition and openwrt in the other. If so, to upgrade openwrt you should either enable "upgrade into the same partition" feature or always upgrade from the OEM side. In the latter case, you should backup your settings before the upgrade and then restore them after upgrade.

If you want openwrt on both partitions, you should run the commands from the URL I linked. I think in this case you should flash openwrt factory image into the other partition but @lytr and others would know better.

1 Like

I don't have that experience and knowledge and I don't want to fill this thread with off-topic.
Can you guide me how can I do this. Or maybe a link so I can read more. I searched but couldn't find how to dump U-boot. Thanks.

It was merged, sysupgrade -s /tmp/sysupgrade.bin was confirmed to upgrade and stay on actual partition.

For those of you running the FOSS build (not NSS) SNAPSHOT builds on MX4200 or MX4300, do all your lanX and wan interfaces have the same MAC address?

In my backport of the MX4300 code, I noticed this and wasn't sure if it was an artifact of the 24.10 branch, or whether this same issue applies in SNAPSHOT builds.

I suspect this is also why it's been so hard to establish connectivity after installing upgrades w/out keeping config... and maybe even when keeping config but having the system act as router vs. dumb AP.

Now I simply turn off DHCP, Firewall and dnsmasq on the router and bridge all LAN + WAN interfaces into br-lan, so connectivity should be the same from any port... but I also haven't installed a new build w/out keeping config in a while.

Thanks... this would be useful to know before opening up a PR to backport the MX4300 support to 24.10, esp. as there are issues with ipq-806x targets (maybe related to DSA? Maybe not?) where this same symptom appears and causes issues.

Can confirm all interfaces have the same MAC. Running OpenWrt 24.10.0-rc5 r28304-6dacba30a7

1 Like

On what hardware? Stock OpenWRT not a private build?

Thx!

using @arix FOSS builds. MX4300. Just upgraded the latest stable build from his repo and it's the same. Same mac for all interfaces.

Is there something I should configure to fix this? Does it cause any issues other than upgrades?

I use a custom images, based on Arix repo, one MX as a normal "master" router the other as dumb AP, both updated frequently and zero issues with connectivity after upgrades...

I haven't had issues in dumb AP mode, but in router mode I frequently cannot connect to the router's IP (e.g. SSH to the router itself) via any of the wired ports. After a while, the router appears to "wake up" (though it's running the whole time and the heartbeat LED is blinking as expected -- so the "waking up" is merely a network-level thing with the interface being "seen") and then connectivity can be established without any changes happening to the router (often, though, with a lot of flailing around on the client end, where I try all the possible networks it could be on, DHCP client and static configs, etc. etc.).

In order to save myself the headache, I've just configured both of the MX-4300s I have to dumb AP mode since that's my expected usage, but each time I want to reset-to-OEM or test sysupgrade w/out saving configs, I end up in this same situation.

Iā€™m trying to set up multiple SSIDs on dumb access points using BATMAN. However, the videos and guides I found online are not step-by-step and leave out key details.

Has anyone successfully configured multiple SSIDs on dumb APs using BATMAN? If so: Can you provide a step-by-step guide or share your configuration? Are there any specific settings or challenges I should be aware of?