mbim

查询sim卡信息

mbimcli -d /dev/cdc-wdm0  -p  --query-subscriber-ready-status
[/dev/cdc-wdm0] Subscriber ready status retrieved:
	      Ready state: 'initialized'
	    Subscriber ID: '4600120896123456'
	        SIM ICCID: '89860112345678'
	       Ready info: 'none'
	Telephone numbers: (1) '+86166'


查询无线电状态

 mbimcli -d /dev/cdc-wdm0 -p  --query-radio-state
[/dev/cdc-wdm0] Radio state retrieved:
	     Hardware radio state: 'on'
	     Software radio state: 'on'

查询信号强度

# mbimcli -d /dev/cdc-wdm0 -p  --query-signal-state 
[/dev/cdc-wdm0] Signal state:
	          RSSI [0-31,99]: '14'
	     Error rate [0-7,99]: '99'
	Signal strength interval: '5'
	          RSSI threshold: '2'
	    Error rate threshold: 'unspecified'

查询注册状态

 mbimcli -d /dev/cdc-wdm0 -p   --query-registration-state
[/dev/cdc-wdm0] Registration status:
	         Network error: 'unknown'
	        Register state: 'home'
	         Register mode: 'automatic'
	Available data classes: 'custom'
	Current cellular class: 'gsm'
	           Provider ID: '46001'
	         Provider name: 'CHN-UNICOM'
	          Roaming text: 'unknown'
	    Registration flags: 'packet-service-automatic-attach'

查询当前分配的IP信息

 mbimcli -d /dev/cdc-wdm0  -p --query-ip-configuration

[/dev/cdc-wdm0] IPv4 configuration available: 'address, gateway, dns, mtu'
     IP [0]: '10.2.72.180/29'
    Gateway: '10.2.72.181'
    DNS [0]: '218.104.111.122'
    DNS [1]: '218.106.127.114'
        MTU: '1400'

[/dev/cdc-wdm0] IPv6 configuration available: 'address, gateway, dns, mtu'
     IP [0]: '2408:843f:ba26:5ab:312a:3c4c:b513:c98e/64'
    Gateway: '2408:843f:ba26:5ab:3dbc:7e6e:c2b7:3019'
    DNS [0]: '2408:8888::8'
    DNS [1]: '2408:8899::8'
        MTU: '1432'

查询包服务状态

 mbimcli -d /dev/cdc-wdm0  -p  --query-packet-service-state
[/dev/cdc-wdm0] Packet service status:
	         Network error: 'unknown'
	  Packet service state: 'attached'
	Available data classes: 'custom'
	          Uplink speed: '1200000000 bps'
	        Downlink speed: '3200000000 bps'

–attach-packet-service Attach to the packet service
–detach-packet-service Detach from the packet service
–connect=

–set-radio-state=on/off

查询连接状态

mbimcli -d /dev/cdc-wdm0  -p   --query-connection-state

[/dev/cdc-wdm0] Connection status:
	      Session ID: '0'
	Activation state: 'activated'
	Voice call state: 'none'
	         IP type: 'ipv4v6'
	    Context type: 'internet'
	   Network error: 'unknown'

流量统计

mbimcli -d /dev/cdc-wdm0  -p  --query-packet-statistics 
[/dev/cdc-wdm0] Packet statistics:
	   Octets (in): '131250057'
	  Packets (in): '184155'
	 Discards (in): '0'
	   Errors (in): '0'
	  Octets (out): '11459167'
	 Packets (out): '111663'
	Discards (out): '0'
	  Errors (out): '0'

手动开启上网

mbim-network /dev/cdc-wdm0 start
mbimcli --device=/dev/cdc-wdm0 --device-open-proxy --set-radio-state=on

ip addr flush dev wwan0
ip -6 addr flush dev wwan0
ip link set wwan0 up

ip addr add 10.2.72.180/29 dev wwan0 broadcast +
ip route add default via 10.2.72.181 dev wwan0
ip link set mtu 1400 dev wwan0

断开连接
mmcli -m 0 –simple-disconnect

列出收到的短信
mmcli -m 0 –messaging-list-sms

导出短信
mmcli -s 0 –create-file-with-data=/tmp/sms0.txt

mmcli -m 0 –enable
mmcli -m 0 –simple-disconnect

QMI UTILS也能用

qmicli --device=/dev/cdc-wdm0 --device-open-proxy --dms-get-ids
也就是 qmicli -d /dev/cdc-wdm0 -p   --dms-get-ids


qmicli --device=/dev/cdc-wdm0 --device-open-proxy --dms-get-manufacturer

qmicli --device=/dev/cdc-wdm0 --device-open-proxy --dms-get-model

 qmicli --device=/dev/cdc-wdm0 --device-open-proxy   --wds-get-packet-service-status

qmicli --device=/dev/cdc-wdm0 --device-open-proxy --uim-get-card-status





发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注