How-To: Installing Vanilla OpenWRT on GL X3000

So... I have noticed that OpenWRT finally released a new stable version which includes support for the GL-INET X3000 (24.10.0). I booted into an Ubuntu live system and went back to building a new image based on the stable release. It's been smooth sailing, just add the patches for the PCIe detection and throw the sysupgrade on the devices.

I have 3x X3000 running outdoor (but in waterproof boxes) for the last half year. Since my last posts here, I have been running vanilla OpenWRT on them. Needless to say, the devices are way more stable with vanilla OpenWRT. I haven't experienced any crashes or issues otherwise.

After some more tweaking and experimenting, this is the sysctl parameters that I am currently running in "production" which give ideal performance:

net.core.dev_weight = 256
net.core.netdev_budget = 1200
net.core.netdev_budget_usecs = 40000
net.core.netdev_tstamp_prequeue = 0
net.core.netdev_max_backlog = 5000
net.ipv4.icmp_ratemask = 524287
net.ipv4.icmp_ratelimit = 0

FWIW, I am not running the stock PSUs on these devices. I have noticed some strange crashes under load from time to time. So in November last year, I replaced the stock PSUs with proper outdoor-proof ones from a considerably "premium brand". Not a single crash since.

Thank you for that; Im really considering this option at the moment; any caveats ? Im a bit lost with this massive thread; I guess this subject would need its own forum... Is the first post the currently updated guide compatible with GL-INET X3000 ?

Turns out I have 0 x86 machines so I can't compile those files since Package 'gcc-multilib' has no installation candidate for ARM . Anywhere I can download the compiled files for CLX3000 Quectel PCIe-MHI Drivers ?

I have installed Openwrt 24.10.0 on the X3000, but there is no out of the box integration with the Modem 5G component of the overall router, I don't know how to setup that part to use it with T-Mobile Home Internet, it would be really amazing if somebody can create a step by step guide on how to fully configure the 5G functionality of the X3000 together with all the other required configuration (without having to compile the Linux kernel), right now I can only use it as a regular Wifi router, it will be greatly appreciated, thank you

I really think this topic needs a dedicated forum instead of a thread @staff ; If GL is ok supporting vanilla then give us a forum section ? at the moment I am completely lost on the current state of this method and compatibility overall; been reading a lot but information is too scattered and inconsistent

1 Like

Let me try to clarify some of the concerns above.

  1. There isn't any caveats apart from the fact that controlling the modem under vanilla OpenWRT is a bit more complicated. The stock GL-INET firmware offers a lot of control options within their own proprietary Web UI which will be missing. But most of the functionality that their Web UI offers can be achieved through AT commands.
  2. The current step-by-step guide in the beginning of this thread is outdated. You don't really need to mess around with custom drivers anymore. The linux kernel contains all necessary drivers for the "fast" PCI mode. However, it's buggy and requires a patch, which I have shared above. If you want to use the "fast" PCI mode, you won't get around building your own OpenWRT image.
  3. If you are fine with 300 Mbit/s in speed, you can switch the modem to the "slow" USB mode. In that case, the stock OpenWRT image that is available for download works just fine.

In any case, after you flashed the OpenWRT image, you use ModemManager to create a new interface, where you specify the APN. This can be done within the OpenWRT Web UI. Depending on which mode the modem is in, you can pick either an MBIM protocol or QMI protocol.

I don't recommend using the proprietary Quectel drivers. The linux kernel drivers work just fine. If you're fine with 300 Mbit/s of speed, the easiest way is to just flash the prebuilt OpenWRT image. Switching the modem's mode from USB to PCI and vice-versa can be done with AT commands:

AT+QCFG="data_interface",0,0 # USB
AT+QCFG="data_interface",1,0 # PCI

You would use a tool like picocom to issue the AT commands: picocom /dev/ttyUSB2.

Applying the patch above can be done by creating a file called 999-pci-mhi-generic.patch and placing it in the target/linux/mediatek/patches-6.6 folder prior to building the OpenWRT image.

Building OpenWRT itself is relatively easy:

git clone https://github.com/openwrt/openwrt.git
cd openwrt
git checkout v24.10.0
./scripts/feeds update -a
./scripts/feeds install -a
wget https://downloads.openwrt.org/snapshots/targets/mediatek/filogic/config.buildinfo -O .config
make defconfig
make menuconfig
<NOTES BELOW>
make -j16

NOTES: when entering make menuconfig you generally want to add LuCi and switch the target profile to the "X3000". Also, the default config is missing some things, such as mhi-pci-generic. So you need to open .config and then set kmod-mhi-pci-generic=y.

This gives you a super lightweight OpenWRT image with everything necessary to use the device as a modem/router. If you want to use the WiFi functionality, you might need to add some packages later down the road, but that can be done after building the image within LuCi.

Building the OpenWRT image takes time. Fortunately, I have a 9950X3D workstation and it only took like 10 minutes. Expect it to take a lot longer on weaker CPUs. FWIW, you can adjust make -j16 to fit the number of CPU threads you have, which might be more or less than 16.

I hope this helps!

1 Like

Hello @navalcadet,
as of kernel 6.6.84+ the second part of the patch (sequence number glitch messages to debug) has been upstreamed and needs to be taken out. :slightly_smiling_face:
Thank you.

Thank you; that really re-ignite my desire to switch to vanilla.

still a few unknowns:

  • Can I build on any computer ? I have a macbook and a pi. can I build on the mac ?
  • What is the state of dual sim support and failover on vanilla ?
  • can we do the repeater mode too ?
  • Can I install adguard with vanilla ?
  • is it possible to setup overlay networks like tailscale or similar ?

All I can think for now; I hope we can centralize all that somewhere as FAQ or similar because I bet so many like me are in a shroedinger state...

@navalcadet @EPinci and anyone else, does it really work for you? I've been testing the patches + PCI mode with vanilla OpenWRT v24.10.0, v24.10.1 and master (as of yesterday) and in all cases as soon as I try to run a speed test of any sort (iperf3, speedtest.net etc) the modem hangs, without modemmanager even realizing until a reboot is performed. I've even replaced the PSU with a very good one so power draw should not be the issue...

I'm a very unexperienced openwrt user and I managed for the first time to build the v24.10.1 with the patch and using PCI mode.
I have the same issue as you.
It seems that usage spikes of speedtest.net (I reach 400+ mbps, which I think is nearly the maximum I can get in my location, in the download and when the upload test start all blocks) cause the modem to hang and a manual restart is required.
I'm using the interface with modemmanager protocol as setting.

Does anybody know if there are other setting that I should apply to stabilize the connection?

thanks for confirming @zimling, by the way I should add that in the last couple days I have also tried, under v24.10.1, upgrading the RM520N-GL firmware through all the following versions:

  • RM520NGLAAR03A03M4G_01.201.01.201 (what was installed when I bought it)
  • RM520NGLAAR03A04M4G_01.202.01.202
  • RM520NGLAAR03A04M4G_01.204.01.204
  • RM520NGLAAR01A08M4G_01.206.01.206

Still same result. I believe the radio link I have set up would allow me to reach 700 or even 800 mbps, due to comparable results using a simple mobile phone, but the MHI driver issues force me to continue using the USB driver which limits the speed very much.

@oom thank you, that would have been my next test so you have spared me the trouble.

As a follow-up I tried reverting to a backup archive I made after a fresh sysupgrade install (via U-boot) where I made only LAN adjustments and at first it seemed to be working fine but it did not last for 24h.

I've seen that some times rebooting seemed to have fixed the issue and sometimes the issue was persistent, but nothing seemed to be permanent.

I am now trying mmcli inhibit option over the USB interface:

root@OpenWrt:~# mmcli -L
    /org/freedesktop/ModemManager1/Modem/1 [Quectel] RM520N-GL
    /org/freedesktop/ModemManager1/Modem/0 [quectel] RM520N-GL
root@OpenWrt:~# mmcli -m 1 --inhibit
successfully inhibited device with uid '/sys/devices/platform/soc/11200000.usb/usb1/1-1/1-1.2'
type Ctrl+C to abort this program and remove the inhibition

I have no technical explanation (I'm ignorant on this matter, just shooting in the dark) on why this should or shouldn't work but at least the "double modem" in the luci-modemmanager interface disappeared and I'm left with only the PCIe which is something.

This seems to have improved stability, but I am still not convinced if it is a fluke or if it is conclusive.
I've conducted 20ish consecutive speedtest without failure from a couple of different devices. I have no idea right now if this will hold up.

You can try it yourself if you want since it is easier than changing the modem firmware :slight_smile:
In the meantime I will keep it monitored

1 Like