Establishing LTE connection with TL-MR6400 v5 LTE

Hy there,

i have a problems making a connection with the LTE Modem. before i was stuck here, now i moved to another country and i am able to register to the network.

# uqmi -d /dev/cdc-wdm0 --get-serving-system
{
	"registration": "registered",
	"plmn_description": "Lj\u0011",
	"plmn_mcc": 340,
	"plmn_mnc": 20,
	"mnc_length": 2,
	"roaming": false
}
# uqmi -d /dev/cdc-wdm0 --get-signal-info
{
	"type": "lte",
	"rssi": -45,
	"rsrq": -15,
	"rsrp": -82,
	"snr": 3.800000
}
# uqmi -d /dev/cdc-wdm0 --get-profile-settings 3gpp,1
{
	"apn": "internet",
	"pdp-type": "ipv4",
	"username": "",
	"password": "",
	"auth": "none"
}

i got following errors:

in lucy

(IPV4_APN_ERROR)
Mon May  9 20:22:19 2022 daemon.notice netifd: 4G (3052): PINcode disabled
Mon May  9 20:22:19 2022 daemon.notice netifd: 4G (3052): Data format set to raw-ip
Mon May  9 20:22:19 2022 daemon.notice netifd: 4G (3052): Default profile number: 1
Mon May  9 20:22:19 2022 daemon.notice netifd: 4G (3052): registered on 34020
Mon May  9 20:22:20 2022 daemon.notice netifd: 4G (3052): Registered to Lj on LTE
Mon May  9 20:22:21 2022 daemon.notice netifd: 4G (3052): Unable to connect with ipv4, check APN settnings
Mon May  9 20:22:21 2022 daemon.notice netifd: 4G (3121): Stopping network 4G
Mon May  9 20:22:21 2022 daemon.notice netifd: 4G (3121): Command failed: Permission denied
Mon May  9 20:22:21 2022 daemon.notice netifd: Interface '4G' is now down

i tried several different APN Settings but i quiet sure i have the correct one bc its working on my cellphone with the simcard. Every help is appreciated.

Run the following commands (one at a time) and post the results.

uqmi -d /dev/cdc-wdm0 --uim-get-sim-state
uqmi -d /dev/cdc-wdm0 --get-profile-settings 3gpp,1
uqmi -d /dev/cdc-wdm0 --get-device-operating-mode
uqmi -d /dev/cdc-wdm0 --get-serving-system
uqmi -d /dev/cdc-wdm0 --get-signal-info
uqmi -d /dev/cdc-wdm0 --get-system-info
uqmi -d /dev/cdc-wdm0 --get-current-settings

Hi
Can you run cat /lib/netifd/proto/qmi.sh and paste the IPv4 part after # Start network interface?

Hi Mr. Haav, thanks for your reply.

# Start network interface                                                                                                     
        if [ $pdptype_def = 'ipv4' ]                                                                                          
        then                                                                                                                  
                cid_4=$(uqmi -s -d "$device" --get-client-id wds)                                                             
                uqmi -s -d "$device" --set-client-id wds,"$cid_4" --set-ip-family ipv4                                        
                pdh_4=$(uqmi -s -d "$device" --set-client-id wds,"$cid_4" \                                                   
                                                --start-network \                                                             
                                                --profile $default_profile)                                                   
                if ! [ "$pdh_4" -eq "$pdh_4" ] 2> /dev/null                                                                   
                then                                                                                                          
                        echo "Unable to connect with ipv4, check APN settnings"                                               
                        proto_notify_error "$interface" IPV4_APN_ERROR                                                        
                        proto_block_restart "$interface"                                                                      
                        return 1                                                                                              
                else                                                                                                          
                        echo "Default profile connected with ipv4"                                                            
                fi                                                                                                            
        elif [ $pdptype_def = 'ipv6' ]                                                                                        
        then                                                                                                                  
                cid_6=$(uqmi -s -d "$device" --get-client-id wds)                                                             
                uqmi -s -d "$device" --set-client-id wds,"$cid_6" --set-ip-family ipv6                                        
                pdh_6=$(uqmi -s -d "$device" --set-client-id wds,"$cid_6" \                                                   
                                                --start-network \                                                             
                                                --profile $default_profile)                                                   
                if ! [ "$pdh_6" -eq "$pdh_6" ] 2> /dev/null                                                                   
                then                                                                                                          
                        echo "Unable to connect with ipv6, check APN settnings"                                               
                        proto_notify_error "$interface" IPV6_APN_ERROR                                                        
                        proto_block_restart "$interface"                                                                      
                        return 1                                                                                              
                else                                                                                                          
                        echo "Default profile connected with ipv6"                                                            
                fi                                                                                                            
        fi                                                                                                                    
        if [ $pdptype = 'ipv4v6' ]                                                                                            
        then                                                                                                                  
                cid_6=$(uqmi -s -d "$device" --get-client-id wds)                                                             
                uqmi -s -d "$device" --set-client-id wds,"$cid_6" --set-ip-family ipv6                                        
                pdh_6=$(uqmi -s -d "$device" --set-client-id wds,"$cid_6" \                                                   
                                                --start-network \                                                             
                                                --profile $dualstack_profile)                                                 
                if ! [ "$pdh_6" -eq "$pdh_6" ] 2> /dev/null                                                                   
                then                                                                                                          
                        echo "Unable to connect ipv6 dual-stack profile"                                                      
                        pdh_6=''                                                                                              
                else                                                                                                          
                        echo "Dual-stack ipv6 profile connected"                                                              
                fi                                                                                                            
        fi 

Thanks for your reply, too.

root@XX:~# uqmi -d /dev/cdc-wdm0 --uim-get-sim-state
{
	"pin1_status": "disabled",
	"pin1_verify_tries": 1,
	"pin1_unlock_tries": 10,
	"pin2_status": "not_verified",
	"pin2_verify_tries": 3,
	"pin2_unlock_tries": 10
}
root@XX:~# uqmi -d /dev/cdc-wdm0 --get-profile-settings 3gpp,1
{
	"apn": "internet",
	"pdp-type": "ipv4",
	"username": "",
	"password": "",
	"auth": "none"
}
root@XX:~# uqmi -d /dev/cdc-wdm0 --get-device-operating-mode
"online"
root@XX:~# uqmi -d /dev/cdc-wdm0 --get-serving-system
{
	"registration": "registered",
	"plmn_description": "Lj\u0011",
	"plmn_mcc": 340,
	"plmn_mnc": 20,
	"mnc_length": 2,
	"roaming": false
}
root@XX:~# uqmi -d /dev/cdc-wdm0 --get-signal-info
{
	"type": "lte",
	"rssi": -48,
	"rsrq": -14,
	"rsrp": -84,
	"snr": -1.000000
}
root@XX:~# uqmi -d /dev/cdc-wdm0 --get-system-info
{
	"wcdma": {
		"service_status": "none",
		"true_service_status": "none",
		"preferred_data_path": false
	},
	"lte": {
		"service_status": "available",
		"true_service_status": "available",
		"preferred_data_path": false,
		"domain": "cs-ps",
		"service": "cs-ps",
		"roaming_status": "off",
		"forbidden": false,
		"mcc": "340",
		"mnc": "20",
		"tracking_area_code": 1300,
		"enodeb_id": 37876,
		"cell_id": 33,
		"voice_support": false,
		"ims_voice_support": false,
		"cell_access_status": "all calls",
		"registration_restriction": 0,
		"registration_domain": 0
	}
}
root@XX:~# uqmi -d /dev/cdc-wdm0 --get-current-settings
{
	"pdp-type": "ipv4",
	"ip-family": "ipv4",
	"mtu": 1460,
	"ipv4": {
		"ip": "xxx.115.43.227",
		"dns1": "xxx.24.16.4",
		"dns2": "xxx.24.16.5",
		"gateway": "xxx.115.43.228",
		"subnet": "255.255.255.248"
	},
	"ipv6": {
		
	},
	"domain-names": {
		
	}
}

root@XX:~# logread | grep 4G
Tue May 10 10:03:52 2022 daemon.notice netifd: Interface '4G' is setting up now
Tue May 10 10:03:55 2022 daemon.notice netifd: 4G (1813): Waiting for modem to initiate
Tue May 10 10:03:57 2022 daemon.notice netifd: 4G (1813): PINcode disabled
Tue May 10 10:03:57 2022 daemon.notice netifd: 4G (1813): Data format set to raw-ip
Tue May 10 10:03:57 2022 daemon.notice netifd: 4G (1813): Default profile number: 1
Tue May 10 10:03:57 2022 daemon.notice netifd: 4G (1813): Configure profile for dual-stack
Tue May 10 10:03:58 2022 daemon.notice netifd: 4G (1813): Dual-stack profile number: 2
Tue May 10 10:03:58 2022 daemon.notice netifd: 4G (1813): Airplane mode off
Tue May 10 10:03:59 2022 daemon.notice netifd: 4G (1813): registered on 34020
Tue May 10 10:04:01 2022 daemon.notice netifd: 4G (1813): Registered to Lj on LTE
Tue May 10 10:04:03 2022 daemon.notice netifd: 4G (1813): Unable to connect with ipv4, check APN settnings
Tue May 10 10:04:03 2022 daemon.notice netifd: 4G (2500): Stopping network 4G
Tue May 10 10:04:03 2022 daemon.notice netifd: 4G (2500): Command failed: Permission denied
Tue May 10 10:04:03 2022 daemon.notice netifd: Interface '4G' is now down

Hi
Can you run this and print the result?

uqmi -d /dev/cdc-wdm0 --set-device-operating-mode low_power
uqmi -d /dev/cdc-wdm0 --set-device-operating-mode online
uqmi -d /dev/cdc-wdm0 --get-client-id wds

Use this value as "$cid_4" in next commands

uqmi -d /dev/cdc-wdm0 --set-client-id wds,"$cid_4" --set-ip-family ipv4
uqmi -d /dev/cdc-wdm0 --set-client-id wds,"$cid_4" --start-network --profile 1
root@xx:~# uqmi -d /dev/cdc-wdm0 --set-device-operating-mode low_power
root@xx:~# uqmi -d /dev/cdc-wdm0 --set-device-operating-mode online
root@xx:~# uqmi -d /dev/cdc-wdm0 --get-client-id wds
2
root@xx:~# uqmi -d /dev/cdc-wdm0 --set-client-id wds,2 --set-ip-family ipv4
root@xx:~# uqmi -d /dev/cdc-wdm0 --set-client-id wds,"$cid_4" --start-network --profile 1

Console hangs after this. After Control-C i got the message "Unknown Error".

logread | grep 4G

Tue May 10 14:43:18 2022 daemon.notice netifd: 4G (5184): PINcode disabled
Tue May 10 14:43:18 2022 daemon.notice netifd: 4G (5184): Data format set to raw-ip
Tue May 10 14:43:19 2022 daemon.notice netifd: 4G (5184): Default profile number: 1
Tue May 10 14:43:19 2022 daemon.notice netifd: 4G (5184): registered on 34020
Tue May 10 14:43:19 2022 daemon.notice netifd: 4G (5184): Registered to Lj on LTE
Tue May 10 14:43:20 2022 daemon.notice netifd: 4G (5184): Unable to connect with ipv4, check APN settnings
Tue May 10 14:43:21 2022 daemon.notice netifd: 4G (5223): Stopping network 4G
Tue May 10 14:43:21 2022 daemon.notice netifd: 4G (5223): Command failed: Permission denied
Tue May 10 14:43:21 2022 daemon.notice netifd: Interface '4G' is now down

Reboot!

Then again. Now after the last command i have an output.

**# uqmi -d /dev/cdc-wdm0 --set-client-id wds,2 --start-network --profile 1**
**"No effect"**

Power Reset!

Then again.

**# uqmi -d /dev/cdc-wdm0 --set-client-id wds,2 --start-network --profile 1**
**"No effect"**
**```**

OK

We can do an other test. Can you change the IF condition in qmi.sh at:

# Start network interface                                                                                                     
        if [ $pdptype_def = 'ipv4' ]                                                                                          
        then                                                                                                                  
                cid_4=$(uqmi -s -d "$device" --get-client-id wds)                                                             
                uqmi -s -d "$device" --set-client-id wds,"$cid_4" --set-ip-family ipv4                                        
                pdh_4=$(uqmi -s -d "$device" --set-client-id wds,"$cid_4" \                                                   
                                                --start-network \                                                             
                                                --profile $default_profile)                                                   
# Change here
                if [ "$pdh_4" = '"Call failed"' ]                                                                   
                then                                                                                                          
                        echo "Unable to connect with ipv4, check APN settnings"                                               
                        proto_notify_error "$interface" IPV4_APN_ERROR                                                        
                        proto_block_restart "$interface"                                                                      
                        return 1                                                                                              
                else                                                                                                          
                        echo "Default profile connected with ipv4"                                                            
                fi                                                                                                            
        elif [ $pdptype_def = 'ipv6' ]                                                                                        

Restart router and print logread | grep 4G

After reboot i have the following message behind the 4G interface in luci:

Unsupported protocol type.
Install protocol extensions...

when i follow the link it guides me to the software page in luci:

/opkg?query=luci-proto

This link shows me all packages with luci-proto but i don't know which one it wants me to install. Here are the possibilities/not installed packages.

luci-proto-3g	git-22.046.84868-a7b0fe1	2.6 KB	Support for 3G	
Install…
luci-proto-bonding	git-21.222.28122-085bb7c	4.7 KB	Support for Link Aggregation (Channel Bonding)	
Install…
luci-proto-gre	git-21.163.64918-12b5dd9	2.7 KB	Support for GRE tunnels (RFC2784)	
Install…
luci-proto-hnet	git-21.148.49484-14511e5	1.5 KB	Support for hnet	
Install…
luci-proto-ipip	git-19.307.61018-284918b	1.9 KB	Support for IPIP tunnels (IPv4-in-IPv4 RFC2003)	
Install…
luci-proto-ipv6	git-21.148.49484-14511e5	3.5 KB	Support for DHCPv6/6in4/6to4/6rd/DS-Lite	
Installed
luci-proto-modemmanager	git-22.046.84868-a7b0fe1	2.8 KB	Support for ModemManager	
Install…
luci-proto-ncm	git-22.046.84868-a7b0fe1	2.3 KB	Support for NCM	
Install…
luci-proto-openconnect	git-21.148.49484-9eee69a	3.3 KB	Support for OpenConnect VPN	
Install…
luci-proto-openfortivpn	git-20.240.06846-642f738	1.8 KB	Support for OpenFortivpn	
Install…
luci-proto-ppp	git-21.163.64918-6c6559a	3.0 KB	Support for PPP/PPPoE/PPPoA/PPtP	
Installed
luci-proto-pppossh	git-21.163.64918-6c6559a	2.3 KB	Support for pppossh	
Install…
luci-proto-qmi	git-22.046.84868-a7b0fe1	2.4 KB	Support for QMI	
Installed
luci-proto-relay	git-19.307.61018-284918b	2.5 KB	Support for relayd pseudo bridges	
Install…
luci-proto-sstp	git-21.163.62466-fc43d4d	1.7 KB	Support for SSTP	
Install…
luci-proto-vpnc	git-21.148.49484-9eee69a	1.9 KB	Support for VPNC VPN	
Install…
luci-proto-vxlan	git-21.148.49484-14511e5	2.0 KB	Support for Virtual eXtensible Local Area Network (VXLAN, RFC7348)	
Install…
luci-proto-wireguard	git-21.243.21928-71fe35c	3.3 KB	Support for WireGuard VPN	
Install…

OK

Can you try to install the latest version? You are running on OpenWrt 21.02.2?

wget https://github.com/mrhaav/openwrt/raw/master/21.02.2/uqmi_2022-04-22-0.5_mipsel_24kc.ipk
opkg install uqmi_2022-04-22-0.5_mipsel_24kc.ipk

Awesome!

Yes, i am on OpenWrt 21.02.2, r16495-bf0c965af0. I installed the latest version uqmi_2022-04-22-0.5_mipsel_24kc.ipk and made the changes as described here. After the reboot i was connected to the internet.

Thanks for your support and patience.

1 Like

Hi
This version includes a daemon, uqmi_d.
It will check, every 30sec, if the modem has been disconnected by the network. If it is disconnected it will re-connect and update the interface.
The daemon will as well send the rssi value to /usr/bin/uqmi_rssi.sh, for trigger signal strength LEDs, and it will store received SMS to /var/sms and send the file name to /usr/bin/uqmi_sms.sh.
uqmi_rssi.sh and uqmi_sms.sh are not included in the ipk-file. You need to create them your self.
More info and examples are available at: https://github.com/mrhaav/openwrt/tree/master/21.02.2

1 Like