Let me try to clarify some of the concerns above.
- 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.
- 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.
- 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!