Skip to content

Instantly share code, notes, and snippets.

@fbett
Last active December 25, 2025 17:00
Show Gist options
  • Select an option

  • Save fbett/8dc22b482eede8a9828eaacc51a4447a to your computer and use it in GitHub Desktop.

Select an option

Save fbett/8dc22b482eede8a9828eaacc51a4447a to your computer and use it in GitHub Desktop.

Revisions

  1. fbett revised this gist May 15, 2023. 1 changed file with 13 additions and 0 deletions.
    13 changes: 13 additions & 0 deletions openwrt_tp-link_TL-MR6400_v5.md
    Original file line number Diff line number Diff line change
    @@ -44,3 +44,16 @@ killall uqmi || echo "UQMI now works fine!"
    ````

    Thanks a lot to https://teklager.se/en/knowledge-base/openwrt-4g-wwan-configuration/ for this hint!

    ### LTE disconnect problem after dhcp lease and quick fix

    Use this check in cron (add by using crontab -e), if the gateway is missing after dhcp lease and the interface is not connected anymore.
    This code will restart the network interfaces to reconnect all interfaces.

    ```
    * * * * * [ "$(uqmi -d /dev/cdc-wdm0 --get-current-settings | grep -oFm1 "Out of call")" != "Out of call" ] || /etc/init.d/network restart
    ```

    Follow ups:
    - https://github.com/openwrt/openwrt/issues/6196
    - https://forum.turris.cz/t/setting-up-lte-modem/14762/21
  2. fbett created this gist Apr 27, 2023.
    46 changes: 46 additions & 0 deletions openwrt_tp-link_TL-MR6400_v5.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,46 @@
    # Install OpenWrt on TP-Link TL-MR6400 V5 using QMI

    I write this, because i had several problems to connect the LTE modul with the existing tutorials.

    A. https://openwrt.org/toh/tp-link/tl-mr6400_v5
    - Wrong package `luci-proto-uqmi`, no usage of the existing LuCi configuration

    B. https://gist.github.com/gamwe6/ef726b550037957a4d6d5255dc7efa7a
    - I was not able to use the package "modemmanager" because of insuffient drive space


    ## So, these are the steps to succeed:

    1. Download OpenWrt firmware image from here: https://openwrt.org/toh/tp-link/tl-mr6400_v5 (at time of writing this in April 2023, i got version 22.03.04)

    1.1 On Mac using TFTP-Server (dnsmasq) and the TFTP-recovery image (as descripted on the firmware download page)

    2. Install the package "luci-proto-qmi" using LuCi: "System" -> "Software"

    3. Configure the modem using LuCi: Network -> Interfaces -> "Add new interface" -> Protocol "QMI Cellular" using modem at "/dev/cdc-wdm0"

    4. The LTE interface should be running and connected now

    ### LTE problem and quick fix

    Sometimes the uqmi commands hang and result in a not connected LTE interface.

    `If you type any uqmi command and get no output, you may need to edit the qmi.sh script to fix it.`

    The file is located in /lib/netifd/proto/qmi.sh

    Locate the line that looks like this:

    ````
    while uqmi -s -d "$device" --get-pin-status | grep '"UIM uninitialized"' > /dev/null; do
    ````
    On OpenWRT 19.7 it's on line 83. It might be on a different line if you have a newer or older OS version.

    Add the following 3 lines before the line above.
    ````
    uqmi -s -d "$device" --get-pin-status &
    sleep 3
    killall uqmi || echo "UQMI now works fine!"
    ````

    Thanks a lot to https://teklager.se/en/knowledge-base/openwrt-4g-wwan-configuration/ for this hint!