Changes between Version 1 and Version 2 of wireless/modem


Ignore:
Timestamp:
10/22/2017 06:10:14 AM (7 years ago)
Author:
Chris Lang
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • wireless/modem

    v1 v2  
    153153See also:
    154154 * [wiki:wireless/modem#libqmi libqmi]
     155 * [wiki:wireless/modem#uqmi uqmi]
     156
     157
     158[=#link-protocol]
     159==== Link Protocols ====
     160QMI modems support multiple link protocols:
     161 - 802-3: wraps IP packets within Ethernet frames (similar to an Ethernet device) like traditional modems
     162 - raw-ip: does away with the Ethernet layer and provides raw IP frames which is more efficient and allows higher throughput, but disallows things that rely on 802-3 such as DHCP
     163
     164Some QMI modem/firmware/SIM combinations support 802-3 only, others support raw-ip only, and some support both. It is important to make sure the driver and the network device are configured to use the same link protocol.
     165
     166
     167[=#ip-family]
     168==== IP Family ====
     169QMI modem/firmware/SIM combinations can support IPv4, IPv6, or both IP families. If you are trying to connect and receive an error related to IP family check that your asking for something supported.
     170
     171
     172[=#client-cid]
     173==== Client ID ====
     174To use QMI services you need a 'Client ID' or CID. The CID's can be created then released when they are no longer needed. When working with sessions the CID is what allows QMI services to be operated on the right session. Both libqmi and uqmi userspace applications allow you to issue QMI commands by using an existing specified CID and to not release CID upon completion. It is important to use this when configuring and starting connections. For example, you can have an ipv4 session concurrent with an ipv6 session, each must have their own CID that is not released (until the connection is closed) and must be used when referring to those sessions.
     175
     176When using {{{qmicli}} you do this with the {{{--client-cid=<cid>}}} and the {{{--client-no-release-cid}}} options.
     177
     178When using {{{uqmi}}} you obtain a client-id with the {{{--get-client-id}}} option and use an existing one with the {{{--get-client-id}}} option and release a CID with the {{{---release-client-id}}} option.
    155179
    156180
     
    278302==== Command Line Examples ====
    279303If not using a higher level manager which utilizes libqmi such as !ModemManager, you can use libqmi directly with the aforementioned tools '''(make sure !ModemManager is not installed or running if using libqmi directly!)''':
    280  * Query SIM:
     304 * SIM details (UIM service):
    281305{{{#!bash
    282306root@ventana:~# qmicli -d /dev/cdc-wdm0 --uim-get-card-status
     
    337361SINR (8): '9.0 dB'
    338362}}}
    339  * Network details:
     363 * Network details (NAS service):
    340364{{{#!bash
    341365root@ventana:~# qmicli -d /dev/cdc-wdm0 --nas-get-system-selection-preference
     
    510534        SIM reject info: 'available'
    511535}}}
    512  * Connect to Google Fi network:
     536 * Configure [wiki:wireless/modem#link-protocol Link Protocol]:
     537{{{#!bash
     538root@ventana:~# qmicli -p -d /dev/cdc-wdm0 --wda-set-data-format=802-3 # set data format (raw-ip/802-3)
     539root@ventana:~# qmicli -p -d /dev/cdc-wdm0 --set-expected-data-format=802-3 # set expected format, should match above
     540}}}
     541  - '''Make sure you choose a link protocol (802-3 or raw-ip) that is compatible with your modem/firmware/SIM'''
     542 * Connect to Google Fi network (WDS service):
    513543{{{#!bash
    514544root@ventana:~# echo "APN=h2g2" > /etc/qmi-network.conf # specify APN
     
    530560Saving state at /tmp/qmi-network-state-cdc-wdm0... (PDH: 62482624)
    531561Network started successfully
    532 root@ventana:~# qmicli --device /dev/cdc-wdm0   --client-no-release-cid --client-cid=35 --wds-get-current-settings
     562}}}
     563 * Configuring IP:
     564  - If your modem/firmware/SIM combination supports {{{802-3}}} link protocol and is configured to do so, you can use DHCP:
     565{{{#!bash
     566root@ventana:~# dhclient wwan0
     567}}}
     568  - or, you can use {{{-wds-get-current-settings}}} to obtain the settings provided to the conneciton from the carrier and configure them manually. Take care to use the same {{{client-cid}}} that was returned from the {{{-wds-start-network}}} command and to not release the client-id:
     569{{{#!bash
     570root@ventana:~# qmicli --device /dev/cdc-wdm0 --client-no-release-cid --client-cid=35 --wds-get-current-settings
    533571[/dev/cdc-wdm0] Current settings retrieved:
    534572           IP Family: IPv4
     
    550588}}}
    551589
    552   '''Connection Notes''':
    553 
    554   If your !Modem/Firmware/SIM combination supports the 802-3 protocol, you can use dhcp instead of manually configuring the interface:
    555 {{{#!bash
    556 echo "APN=h2g2" > /etc/qmi-network.conf # specify APN
    557 echo "PROXY=yes" >> /etc/qmi-network.conf # allow ports to be shared by multiple libqmi apps
    558 qmicli -p -d /dev/cdc-wdm0 --wda-set-data-format=802-3 # set data format (raw-ip/802-3)
    559 qmicli -p -d /dev/cdc-wdm0 --set-expected-data-format=802-3 # set expected format, should match above
    560 qmi-network /dev/cdc-wdm0 start
    561 dhclient wwan0
    562 }}}
    563 
    564   Some sims require that a particular IP family be used to establish a connection. The IP family can be specified on the command line when you start the network:
    565 {{{#!bash
    566 qmicli -p -d /dev/cdc-wdm0 --wda-set-data-format=802-3 # set data format (raw-ip/802-3)
    567 qmicli -p -d /dev/cdc-wdm0 --set-expected-data-format=802-3 # set expected format, should match above
    568 qmicli -p -d /dev/cdc-wdm0 --wds-start-network="apn=h2g2,ip-type=4" --client-no-release-cid
    569 dhclient wwan0
    570 }}}
    571 
    572   Notice that the start network commands used above, including the {{{qmi-network}}} call, all contain the {{{--client-no-release-cid}}} argument. This along with the {{{--client-cid=[CID]}}} argument provides the saving and recall of client IDs. The client ID (CID) references a client of a QMI service running in the firmware of the modem  which in this case is qmicli. Unless saved, the CID will be released once the call is finished and the program will exit. This behavior is expected for short lived commands like checking network status or signal strength but would result in an instantly dropped network connection if the "start network" call does not have its CID saved.
     590Troubleshooting QMI connection issues:
     591 - make sure you are using a [wiki:wireless/modem#link-protocol Link Protocol] compatible with your modem/firmware/SIM
     592 - make sure you are using an [wiki:wireless/modem#ip-family IP Family] compatible with your modem/firmware/SIM
     593 - don't use DHCP if its not supported by your carrier or if your not using the 802-3 link protocol - instead use 'wds-get-current-settings' and manually configure the interface
     594 - make sure you are not releasing the [wiki:wireless/modem#client-id Client ID] when connecting to the network
    573595
    574596[=#libqmi-firmware]
     
    18261848 * GSM/GPRS/EDGE: Quad-Band
    18271849
    1828 This card uses the QMI protocol (Qualcomm MSM Interface) for modem/connection - see [wiki:3g#uqmipackage uqmi]
     1850This modem uses the QMI protocol (Qualcomm MSM Interface) for modem/connection:
     1851 * see [wiki:wireless/modem#uqmi uqmi] for OpenWrt
     1852 * see [wiki:wireless/modem#libqmi libqmi] for Ubuntu
     1853
     1854This modem has been found to work well for:
     1855 * Ubuntu: Verizon/ATT/Fi
     1856 * LEDE/OpenWrt 16.02: Verizon/ATT/Fi
    18291857
    18301858Drivers:
     
    18351863 * qmi_wwan (USB_NET_QMI_WWAN) exposes network interface and QMI interface:
    18361864  * {{{/dev/cdc-wdm0}}} - control (QMI)
    1837   * {{{/dev/cdc-wdm1}}} - control (QMI) for GSM
    1838   * {{{/dev/cdc-wdm2}}} - control (QMI)
     1865  * {{{/dev/cdc-wdm1}}} - control (QMI)
    18391866  * {{{/sys/class/net/wwan0}}}
    1840   * {{{/sys/class/net/wwan1}}} - data for GSM
    1841   * {{{/sys/class/net/wwan2}}}
    1842 
    1843 Modem:
    1844 For using with GSM, please use these lines inside the /etc/config/network file.
    1845 {{{#!bash
    1846 config interface 'wan'
    1847         option ifname 'wwan1'
    1848         option proto 'qmi'
    1849         option apn 'ISP.CINGULAR'
    1850         option device '/dev/cdc-wdm1'
    1851         option delay '90'
    1852 }}}
     1867  * {{{/sys/class/net/wwan1}}}
     1868
     1869OpenWrt configuration:
     1870{{{#!bash
     1871uci set network.wan=interface
     1872uci set network.wan.ifname=wwan0
     1873uci set network.wan.proto=qmi
     1874uci set network.wan.apn=vzwinternet
     1875uci set network.wan.device=/dev/cdc-wdm0
     1876uci set network.wan.autoconnect=0
     1877uci commit network
     1878}}}
     1879 - '''it is important to configure autoconnect=0 as shown above for OpenWrt otherwise qmi.sh will not connect'''
    18531880
    18541881GPS:
     
    20052032  * {{{/dev/ttyUSB2}}} - AT Commands
    20062033  * {{{/dev/ttyUSB3}}} -
     2034 * pinout concerns:
     2035  - Pin 20 (W_DISABLE#) is W_DISABLE_E active-low input on 1.8V domain with a max of 2.1V (violated when we drive this high) (not supported by current firmware accoring to MiniPCIe hardware guide)
     2036  - Pin 22 (PERST#) is RESIN_N active-low input on 1.8V domain with max of 2.1V (violated when we drive this high)
    20072037 * OpenWrt package: usb-serial-option
    2008 
    2009 USB ID:
    2010  * 12d1:1573: Huawei Technologies:HUAWEI Mobile
    2011 
    2012 {{{lsusb}}} output:
     2038 * USB2.0: 12d1:1573: Huawei Technologies:HUAWEI Mobile
     2039 * Testing:
    20132040{{{#!bash
    2014204112d1:1573 Huawei Technologies Co., Ltd.