TL-MR6400 v5 can't start built in modem

Hello. I am new to Openwrt. I purchased a TP-LINK MR6400 V5 installed Openwrt and Luci. I tried to find the built in modem at the interface of Luci but there wasn't anywhere. Is there any way to unable it? Thank you in advance

What kind/brand of modem is it?

from the commit, this device's modem seem to be in QMI mode so you need to follow this tutorial,

Then you can create a new interface and choose lte modem with QMI

and as said in the commit,
"LTE module does not support DHCP so it must be configured via QMI."
you must change the default value of
"dhcp" option in QMI protocol configuration options from 1 to 0 so the system is using uqmi and not dhcp

1 Like

It is a TP-LINK MR6400 V5 4G Router

Thank you very much for your reply. I will follow the tutorial and let you know if it works.

I've tried that guide but I'm unable to make the LTE module work...
I've also see this post but I don't know if I have to compile a snapshot image with that patch...

Could someone explain the procedure to setup the LTE modem in QMI mode?

probably easier if you tell us what doesn't/didn't work ....

sorry, you're right! :sweat_smile:

I'm stuck at first passage of Interface configuration.
When I issue the command: root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --get-data-status
i get nothing...

If I try the following command, I get this answer:
root@OpenWrt:~# uqmi -d /dev/cdc-wdm0 --get-signal-info
"Information unavailable"

I've also tried usbmode -l : nothing!

this is the dmesg output:

root@OpenWrt:~# dmesg | grep USB
[    3.188523] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    3.237805] ehci-platform 101c0000.ehci: new USB bus registered, assigned bus number 1
[    3.266706] ehci-platform 101c0000.ehci: USB 2.0 started, EHCI 1.00
[    3.274100] hub 1-0:1.0: USB hub found
[    3.288089] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    3.308291] ohci-platform 101c1000.ohci: new USB bus registered, assigned bus number 2
[    3.387709] hub 2-0:1.0: USB hub found
[    3.574759] usb 1-1: new high-speed USB device number 2 using ehci-platform
[   12.041832] usbserial: USB Serial support registered for generic
[   13.655018] qmi_wwan 1-1:1.4: cdc-wdm0: USB WDM device
[   13.810653] usbserial: USB Serial support registered for GSM modem (1-port)

what does lsusb / lsusb -l say ?

root@OpenWrt:~# lsusb
Bus 002 Device 001: ID 1d6b:0001 Linux 5.4.124 ohci_hcd Generic Platform OHCI controller
Bus 001 Device 002: ID 05c6:9025 Android Android
Bus 001 Device 001: ID 1d6b:0002 Linux 5.4.124 ehci_hcd EHCI Host Controller
oot@OpenWrt:~# ls -l /dev/cdc-wdm0
crw-------    1 root     root      180, 176 Jun 13 22:02 /dev/cdc-wdm0
root@OpenWrt:~# cat /sys/kernel/debug/usb/devices

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  1, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 5.04
S:  Manufacturer=Linux 5.4.124 ehci_hcd
S:  Product=EHCI Host Controller
S:  SerialNumber=101c0000.ehci
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=05c6 ProdID=9025 Rev= 3.18
S:  Manufacturer=Android
S:  Product=Android
S:  SerialNumber=c58XXXX
C:* #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E:  Ad=84(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none)
E:  Ad=86(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
E:  Ad=88(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 5 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=(none)
E:  Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=125us

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12   MxCh= 1
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0001 Rev= 5.04
S:  Manufacturer=Linux 5.4.124 ohci_hcd
S:  Product=Generic Platform OHCI controller
S:  SerialNumber=101c1000.ohci
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   2 Ivl=255ms

Check Enabling TL-MR6400 v5 LTE

The solution that someone has found and seems to work is that: thanks to Filip Moc I learned that two changes were needed

1 is a patch to /lib/netifd/prot/qmi.sh adding a timeout to uqmi. Patch below

--- /lib/netifd/proto/qmi.sh.orig	2021-01-04 20:44:11.000000000 +0000
+++ /lib/netifd/proto/qmi.sh	2020-12-31 22:31:01.000000000 +0000
@@ -81,7 +81,7 @@
 
 	echo "Waiting for SIM initialization"
 	local uninitialized_timeout=0
-	while uqmi -s -d "$device" --get-pin-status | grep '"UIM uninitialized"' > /dev/null; do
+	while uqmi -t 1000 -s -d "$device" --get-pin-status | grep '"UIM uninitialized"' > /dev/null; do
 		[ -e "$device" ] || return 1
 		if [ "$uninitialized_timeout" -lt "$timeout" -o "$timeout" = "0" ]; then
 			let uninitialized_timeout++
@@ -94,7 +94,7 @@
 		fi
 	done
 
-	if uqmi -s -d "$device" --get-pin-status | grep '"Not supported"\|"Invalid QMI command"' > /dev/null; then
+	if uqmi -t 1000 -s -d "$device" --get-pin-status | grep '"Not supported"\|"Invalid QMI command"' > /dev/null; then
 		[ -n "$pincode" ] && {
 			uqmi -s -d "$device" --verify-pin1 "$pincode" > /dev/null || uqmi -s -d "$device" --uim-verify-pin1 "$pincode" > /dev/null || {
 				echo "Unable to verify PIN"
2 is setting network.wan.dhcp=0

But the question is where we have to write all those commands ? Can someone please help us with some details please? Thank you in advance

It's a patch. The code will be inserted into the script /lib/netifd/proto/qmi.sh

How can someone make this patch and insert it into the script /lib/netifd/proto/qmi.sh. ? Can you give us some guidance please?

Save it in a file named .patch then use the patch command to apply it to the original script file. Or you can do it manually once you realize the format of the diff process.

The @@ refers to line numbers in the original file.
Lines with a - in the left margin need to be removed.
Lines with a + in the left margin are additions / replacements.
Lines with nothing in the left margin are parts of the original file shown for context (keep them)

Thank you for your reply which very helpful. I will try to make this patch file. My question now is where I will import the file named .patch that I will make? By which way I will use the command to apply it to the original script file?

patch < file.patch
^--- is the binary doing the actual patching.

Maybe I haven't understand something. If I make the .patch file I have to patch in the routers firmware right? How can I do that?

Yes, it's done on the router, or you can do it in any *nix environment, if you've got one, and copy the file over to the router afterwards.

Just as I wrote, using the patch binary.

I can not understand where exactly in the router I will use the .patch file. Can you upload any photos showing where I will use the.patch file? Sorry for my junior level question. I am new to Openwrt firmware and I am trying to catch up