Page 1 of 1

USB Modem 12d1:140c Huawei E180v

Posted: Sat May 28, 2022 10:05 pm
by nworbnhoj
I am having difficulty with the setup of a QMI USB Modem 12d1:140c Huawei E180v

It looks to me like there is a problem when uqmi checks for a PIN on the SIM (there is no PIN set on the SIM).

Any thoughts how I best move forward on this?

Device Name:Gargoyle
Gargoyle Version:1.12.0
Model:TP-Link TL-WDR3600 v1
Device Configuration:Gateway

my config is:

Code: Select all

network.wan=interface
network.wan.ipv6='0'
network.wan.peerdns='0'
network.wan.dns='208.67.222.222 208.67.220.220'
network.wan.proto='qmi'
network.wan.device='/dev/cdc-wdm0'
network.wan.apn='yesinternet'
network.wan.mobile_isp='custom'
network.wan6=interface
network.wan6.ifname='eth0.2'
network.wan6.proto='dhcpv6'
The logs show ...

Code: Select all

Sun May 29 11:24:53 2022 daemon.notice netifd: wan (2130): Waiting for SIM initialization
Sun May 29 11:24:53 2022 daemon.notice netifd: wan (2130): Failed to parse message data
Sun May 29 11:24:53 2022 daemon.notice netifd: wan (2130): PIN status failed ()
Sun May 29 11:24:53 2022 daemon.notice netifd: wan (3828): Stopping network wan
Sun May 29 11:24:53 2022 daemon.notice netifd: wan (3828): Command failed: Permission denied
Sun May 29 11:24:53 2022 daemon.notice netifd: Interface 'wan' is now down
And when I interact with the modem from the cli I see:

Code: Select all

root@Gargoyle:~# uqmi -d /dev/cdc-wdm0 --get-pin-status
"Invalid arguments given"
root@Gargoyle:~# uqmi -d /dev/cdc-wdm0 --get-capabilities
{
	"max_tx_channel_rate": 3100000,
	"max_rx_channel_rate": 3100000,
	"data_service": "non_simultaneous_cs_ps",
	"sim": "supported",
	"networks": [
		"gsm",
		"umts"
	]
}

Re: USB Modem 12d1:140c Huawei E180v

Posted: Mon May 30, 2022 4:34 pm
by nworbnhoj
Just upgraded to Gargoyle 1.13.0 and same behaviour with QMI modem :-(

Re: USB Modem 12d1:140c Huawei E180v

Posted: Mon May 30, 2022 8:54 pm
by Lantis
I know nothing about QMI sorry.
All we can do is chase the steps right?
https://git.openwrt.org/?p=openwrt/open ... 07403#l108

Code: Select all

. /usr/share/libubox/jshn.sh
json_load "$(uqmi -s -d "$device" --get-pin-status)"
json_get_var pin1_status pin1_status
if [ -z "$pin1_status" ]; then
    json_load "$(uqmi -s -d "$device" --uim-get-sim-state)"
    json_get_var pin1_status pin1_status
fi
json_get_var pin1_verify_tries pin1_verify_tries
We need to understand the output of that. You can probably skip the json related BS and just read the json by hand.

If there is no PIN as you said, ideally we want at least part of that code block to return "disabled" so that we get "PIN verification disabled" and it falls through the to the rest of the script.
You could even ask it to bypass that code block for testing? You know how to code, have some fun :P