Changes between Initial Version and Version 1 of wireless/modem


Ignore:
Timestamp:
10/22/2017 05:28:45 AM (22 months ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • wireless/modem

    v1 v1  
     1[[Image(3ggraphic.png)]]
     2
     3-----
     4
     5= M2M 3G / 4G support on Gateworks products (GSM/GPRS/EDGE/UMTS/HSPA) =
     6
     7[[PageOutline]]
     8
     9M2M Cellular modems allow embedded systems to communicate and connect to the network in places that may not have other standard connections such as !WiFi or Ethernet. Embedded systems are being deployed in more remote locations that still require and mandate an internet connection. Gateworks boards have Mini-PCI-Express slots that allow for many types of cellular modems to be connected.
     10
     11You will find below many examples and setup instructions for many devices Gateworks has qualified.
     12
     13Please check with Sierra Wireless for availability and EOL status.
     14
     15M2M cellular modems operate as a point-to-point serial device. Typically they are used as IP network interfaces by initiating a connection to a cellular carrier using standard AT modem commands then running {{{pppd}}} which performs CHAP authentication and implements the PPP protocol. The {{{pppd}}} daemon uses the {{{chat}}} application for AT command scripts and creates a network interface once authentication succeeds. Some devices expose more than one serial interface for things like AT commands, proprietary API's, NMEA data from optional GPS etc can be used while the network is connected.
     16
     17As a general rule, you need to have obtained the following from your Service Provider to use M2M devices in linux:
     18 * GSM modems:
     19  * A SIM card and the following details:
     20   * APN - Access Point Name
     21   * unlocked - or you need the PIN to unlock it (the SIM must not be locked to another device)
     22   * username - often optional but may be required by your provider
     23   * password - often optional but may be required by your provider
     24 * UMTS modems:
     25  * A modem that has been previously 'activated' by your provider. This involves providing the provider with the IMEI (unique identifier on the modem/module), the provider adding it to their system, and you 'activating' the module (which usually requires a Windows PC and application if not already done by the provider of the module)
     26
     27This information has been tested and created for use on the Gateworks Single Board Computers (SBCs)''', specifically the Ventana family that utilizes the Freescale i.MX6 processors.
     28
     29Gateworks SBCs can be viewed at the following link: [http://www.gateworks.com]
     30
     31[[Image(http://trac.gateworks.com/raw-attachment/wiki/OpenWrt/wireless/relayd/gw5100realsmall.png,200px)]]
     32
     33
     34[=#carrier-certification]
     35== Carrier Approval / Certification ==
     36Production hardware needs to be '''Carrier Approved''' - a process that the end-customer needs to work through with the M2M Carrier (Cellular provider) on the finished device.
     37
     38FCC Certification should be considered as well.
     39
     40The Cellular Carrier dictates if your plan provides 'mobile termination' (the ability to accept connections from the Internet) and the IP address provisioning (IP class, static vs dynamic, IP range). For GSM Carriers this is based on the APN.
     41
     42Products that use USA cellular networks typically need to be certified with the network.
     43
     44Some Mini-PCIe modems are pre-certified, however the product as a whole (enclosure, SBC, antenna) may still need to be certified.
     45
     46Gateworks recommends contacting the network provider of choice for more information.
     47
     48Additional links:
     49
     50 * Connected IO modem Gateworks has used and is a supplier for which is pre-certified for Verizon: https://www.connectedio.com/products/details/17-lt1002-4g-lte-m2m-modem
     51 *  Another certified modem that Gateworks has seen available on the Aeris network that is end-certified: http://www.multitech.com/datasheets/86002165.pdf
     52 * [http://ei.att.com/media/att/2013/emerging_devices/chooseATT/pdf/hardware-development-best-practices-2013.pdf AT&T Certification White Paper] - A very informative read for AT&T Network
     53
     54
     55[=#recommended]
     56== Recommended Modems ==
     57Gateworks has modems they recommend based on their experience and compatibility with their devices.
     58 * [#MC7700MC7710 Sierra Wireless MC7700] - 4G for AT&T in USA.
     59 * [#MC7750 Sierra Wireless !AirPrime MC7750] - CDMA LTE for Verizon etc. in USA.
     60 * [#MC7354 Sierra Wireless !AirPrime MC7354] - UMTS / CDMA / LTE (multiband / multicarrier)
     61 * [#MultiTechMTPCIe-H5ModulesGSMCDMA MultiTech MTPCIe-H5 Modem ] - Has SIM slot on modem. GSM.
     62
     63
     64[=#firmware]
     65== Modem Firmware ==
     66Modems typically require non-volatile firmware that gets flashed onto the device. This firmware is available from the modem manufacturer and/or carrier. Often you will need a different firmware version for different carriers and the firmware can also drastically change the behavior and control protocol the modem uses.
     67
     68Often vendor/carriers support only a Windows utility to update the firmware in which case you will need a miniPcie-to-USB adapter to put the modem on a PC.
     69
     70Qualcomm's QMI based modems can update their firmware using [#libqmi-firmware libqmi-firmware]
     71
     72[=#terminology]
     73== Modem Terminology ==
     74 * 3G : 3G has an average speed of around 1Mb/s
     75 * 4G : 4th Generation of mobile communications technology meeting requirements defined by ITU (International Telecommunications Union) in IMT Advanced. LTE or WiMax.
     76 * LTE : (Long Term Evolution) - Considered 4G.
     77 * HSPA+ :High Speed Packet Access Plus - Considered 3G.  theoretical top speed of 21Mb/s. Average is around 4Mb/s.
     78 * Frequency Bands - Many carriers and technologies utilize different radio frequencies. Confirming the cellular radio operates on the same frequencies as the targeted provider is required for proper operation.
     79
     80 * Reference Links
     81   * http://www.androidauthority.com/4g-vs-lte-274882/
     82
     83
     84[=#control]
     85== Modem Control ==
     86Unlike typical ethernet network interfaces, modem's require additional configuration and control to perform the following types of details before moving on to configuring a network interface:
     87 * Dialing - in the old days for dial-up modems
     88 * SIM pin control and unlocking (security)
     89 * Network provider registration
     90 * Data Protocol selection
     91
     92Once all of the above is complete a modem driver will provide a network interface to the Linux OS:
     93 * IP over ethernet
     94 * raw IP
     95 * IP over serial (sometimes via PPP daemon)
     96
     97And once you finally have an IP networking interface up and running from the modem, you can use the standard IP configuration tools within Linux (like !NetworkManager or the lower-level tools such as ip, route, ifconfig, etc)
     98
     99Over the years various different modem control protocols have been developed:
     100 * AT commands (text commands and responses typically preceded by 'AT' and terminated with a CR (carriage return or 0x0d)
     101 * QMI - Qualcomm Modem Interface (A binary protocol used for modern Qualcomm based modems)
     102 * MBIM - Mobile Interface Broadband Model (A new standard by the USB Implementers Forum specifying a new MBIM USB device model with multiple IP connections over a single USB interface without the need of 802.3 frames and a new MBIM control protocol
     103
     104
     105[=#at]
     106=== AT commands ===
     107If your modem/firmware/driver provides an AT command control interface you will have a serial device which you send AT commands and receive responses. While many modems share common AT commands, each modem/manufacturer typically has their own set of extensions.
     108
     109You can use any typical terminal program such as 'screen', 'minicom', 'picocom' or even simply stty/echo/cat to communicate. Be aware of translations that may occur based on your terminal and/or configuration of these terminal programs. For example, modem AT interpreters expect to receive commands terminated by a CR (carriage return, hex 0x0d code) and will not respond if your terminal program is translating CR's to LF's (beware of using screen within a screen session for example, which will do this).
     110
     111Modems should auto-baud meaning they should support a variety of baudrates. Typical settings would be 57600baud, 8 data bits, 1 stop bit, no parity (8N1).
     112
     113Some examples (assuming /dev/ttyUSB0 is your modem's control interface)
     114* screen
     115{{{#!bash
     116screen /dev/ttyUSB0 57600
     117}}}
     118* minicom
     119{{{#!bash
     120minicom --device /dev/ttyUSB0 --baudrate 57600
     121}}}
     122* picocom
     123{{{#!bash
     124picocom /dev/ttyUSB0 --baud 57600
     125}}}
     126* stty/cat/echo:
     127{{{#!bash
     128stty -F /dev/ttyUSB0 ignbrk -brkint -icrnl -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke
     129cat /dev/ttyUSB0 &
     130echo -e "ATI\n" > /dev/ttyUSB0
     131}}}
     132
     133
     134[=#mbim]
     135=== Mobile Interface Broadband Model (MBIM) ===
     136Mobile Interface Broadband Model (MBIM) is a new standard by the USB Implemented Forum. It specifies a new MBIM USB device model providing multiple IP connections over a single USB interface without the need of 802.3 frames (which was the case for ECM and NCM) and a new MBIM control protocol to talk to modem devices.
     137
     138See also:
     139 * [wiki:wireless/modem#libmbim libmbim]
     140
     141
     142[=#qmi]
     143=== Qualcomm MSM Interface (QMI) ===
     144The Qualcomm MSM Interface (QMI) is a modem control protocol that appears in many modern Qualcomm based modems.
     145
     146QMI defines different services:
     147 - DMS: Device Management - load device info
     148 - NAS: Network Access - register in the network
     149 - WDS: - request data connections
     150 - PDS: - setup GPS location reporting
     151 - UIM: - manage internals of the user identity module
     152
     153See also:
     154 * [wiki:wireless/modem#libqmi libqmi]
     155
     156
     157[=#bsp]
     158=== Gateworks BSP Support ===
     159Gateworks supports multiple Board Support Packages. The following table shows details on modem support for each:
     160||= BSP                          =||= Product Families =||= AT   =||= QMI =||= MBIM =||= Drivers =||= Notes =||
     161|| [wiki:Android]                 || Ventana            || No     ||  No   || No     || None      || [http://trac.gateworks.com/wiki/Android#CellularModemNetworking See Freescale information] ||
     162|| [wiki:Yocto Yocto]             || Ventana            || manual ||  No   || No     || Minimal   || ||
     163|| OpenWrt                        || All                || comgt  ||  uqmi || umbim  || Many      || ||
     164|| [wiki:ventana/ubuntu Ubuntu]   || Ventana            || !ModemManager || libqmi || libmbim || Many || [https://wiki.ubuntu.com/ConnMan/Hardware/3G] ||
     165|| [wiki:ventana/debian Debian ]  || Ventana            || !ModemManager || libqmi || libmbim || Many || [https://wiki.debian.org/Modem/3G] ||
     166
     167If you are looking for additional support please contact support@gateworks.com
     168
     169
     170[=#linux]
     171== Linux Drivers ==
     172There are several Linux kernel drivers used for modem technology. You should enable all of these depending on your device needs:
     173 * qcserial / USB_SIERIAL_QUALCOMM - Provides serial tty devices for Qualcomm modems
     174 * sierra / USB_SERIAL_SIERRAWIRELESS - Provides serial tty devices for Sierra Wireless modems
     175 * option / USB_SERIAL_OPTION - USB driver for GSM and CDMA modems with built-in OHCI-USB adapter (Option, Huawei, Audiovox, Novatel, Anydata)
     176 * sierra_net / USB_SIERRA_NET - USB-to-WWAN driver for Sierra Wireless modems
     177 * cdc-acm / USB_ACM - USB Modem (CDC ACM) support
     178 * qmi_wwan / USB_NET_QMI_WWAN - QMI WWAN driver for Qualcomm modems based on QMI (Qualcomm Messaging Interface)
     179 * cdc_mbim / USB_NET_CDC_MBIM - CDC MBIM support: Provides support for CDC MBIM (Mobile Broadband Interface modem) devices.
     180
     181These all depend on the following Kernel features:
     182 * NETDEVICES=y
     183 * USB_NET_DRIVERS=y
     184 * USB_USBNET=y
     185 * USB_SERIAL
     186
     187
     188[=#ubuntu]
     189== Ubuntu Cellular Modem Support (libqmi/libmbim/modemmanager) ==
     190Ubuntu Linux systems utilize the following opensource projects for modem control and management:
     191 * libmbim
     192 * libqmi
     193 * modemmanager
     194 * networkmanager
     195
     196
     197[=#libmbim]
     198=== libmbim ===
     199The libmbim library is a protocol support library much like libqmi is for QMI and has a {{{mbimcli}}} and {{{mbim-network}}} as well. Since libqmi-1.16.0 and libmbim-1.14.0 there is support for QMI-over-MBIM as well but not clear what is using this. !ModemManager is using libmbim directly as that is what vendors expect/test
     200
     201Useful Examples:
     202 * show status (useful for verifying SIM):
     203{{{#!bash
     204mbimcli --device /dev/cdc-wdm0 --query-subscriber-ready-status # should show "Ready state: 'initialized'"
     205}}}
     206 * radio state (should show 'on')
     207{{{#!bash
     208mbimcli --device /dev/cdc-wdm0 --query-radio-state # should show on
     209}}}
     210   - if not use '--set-radio-state=on'
     211 * enable FCCAuth (required on many Sierra Wireless devices)
     212{{{#!bash
     213qmicli --device /dev/cdc-wdm0 --device-open-proxy --device-open-mbim --dms-set-fcc-authentication
     214}}}
     215 * verify signal state:
     216{{{#!bash
     217mbimcli --device /dev/cdc-wdm0 --device-open-proxy --query-signal-state # RSSI=99 is no signal
     218}}}
     219- Network
     220{{{#!bash
     221mbimcli --device /dev/cdc-wdm0 --device-open-proxy --query-preferred-providers
     222mbimcli --device /dev/cdc-wdm0 --device-open-proxy --query-home-provider
     223mbimcli --device /dev/cdc-wdm0 --device-open-proxy --query-visible-providers
     224mbimcli --device /dev/cdc-wdm0 --device-open-proxy --query-registration-state
     225[/dev/cdc-wdm0] Registration status:
     226                 Network error: 'unknown'
     227                Register state: 'home'
     228                 Register mode: 'automatic'
     229        Available data classes: 'lte'
     230        Current cellular class: 'gsm'
     231                   Provider ID: '310260'
     232                 Provider name: 'Project Fi'
     233                  Roaming text: 'unknown'
     234            Registration flags: 'packet-service-automatic-attach'
     235}}}
     236- connect:
     237 * using mbim-network
     238{{{#!bash
     239root@ventana:~# echo "APN=h2g2" > /etc/mbim-network.conf # specify APN
     240root@ventana:~# echo "PROXY=yes" >> /etc/mbim-network.conf # allow ports to be shared by multiple libmbim apps
     241root@ventana:~# mbim-network /dev/cdc-wdm0 start
     242Loading profile at /etc/mbim-network.conf...
     243    APN: h2g2
     244    APN auth protocol: unset
     245    APN user: unset
     246    APN password: unset
     247    mbim-proxy: no
     248Querying subscriber ready status 'mbimcli -d /dev/cdc-wdm0 --query-subscriber-ready-status --no-close '...
     249[/dev/cdc-wdm0] Subscriber ready status retrieved: Ready state: 'initialized' Subscriber ID: '310260970524563' SIM ICCID: '8901260971105245631' Ready info: 'unknown' Telephone numbers: (1) '15309030245' [/dev/cdc-wdm0] Session not closed: TRID: '3'
     250Saving state at /tmp/mbim-network-state-cdc-wdm0... (TRID: 3)
     251Querying registration state 'mbimcli -d /dev/cdc-wdm0 --query-registration-state --no-open=3 --no-close '...
     252[/dev/cdc-wdm0] Registration status: Network error: 'unknown' Register state: 'home' Register mode: 'automatic' Available data classes: 'lte' Current cellular class: 'gsm' Provider ID: '310260' Provider name: 'Project Fi' Roaming text: 'unknown' Registration flags: 'packet-service-automatic-attach' [/dev/cdc-wdm0] Session not closed: TRID: '4'
     253Saving state at /tmp/mbim-network-state-cdc-wdm0... (TRID: 4)
     254Attaching to packet service with 'mbimcli -d /dev/cdc-wdm0 --attach-packet-service --no-open=4 --no-close '...
     255Saving state at /tmp/mbim-network-state-cdc-wdm0... (TRID: 5)
     256Starting network with 'mbimcli -d /dev/cdc-wdm0 --connect=apn='h2g2' --no-open=5 --no-close '...
     257Network started successfully
     258Saving state at /tmp/mbim-network-state-cdc-wdm0... (TRID: 7)
     259}}}
     260 * or manually
     261{{{#!bash
     262mbimcli --device /dev/cdc-wdm0 --device-open-proxy --connect=apn='h2g2' --no-open=5 --no-close
     263}}}
     264
     265Notes:
     266- MBIM modems do not implement DHCP shim functionality. You need to get the IP details for the interface with 'mbimcli --query-ip-configuration=<session id>' and apply those to the interface and update routing manually
     267
     268References:
     269- https://sigquit.wordpress.com/2013/02/06/an-introduction-to-libmbim/
     270
     271
     272[=#libqmi]
     273=== libqmi ===
     274The libqmi library is a protocol support library much like libmbim is for MBIM and has a {{{qmicli}}} and {{{qmi-network}}} command-line tool as well. Since libqmi-1.16.0 and libmbim-1.14.0 there is support for QMI-over-MBIM as well but not clear what is using this. !ModemManager is using libqmi to control QMI based modems.
     275
     276
     277
     278==== Command Line Examples ====
     279If 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:
     281{{{#!bash
     282root@ventana:~# qmicli -d /dev/cdc-wdm0 --uim-get-card-status
     283[/dev/cdc-wdm0] Successfully got card status
     284Provisioning applications:
     285        Primary GW:   slot '0', application '0'
     286        Primary 1X:   session doesn't exist
     287        Secondary GW: session doesn't exist
     288        Secondary 1X: session doesn't exist
     289Card [0]:
     290        Card state: 'present'
     291        UPIN state: 'not-initialized'
     292                UPIN retries: '0'
     293                UPUK retries: '0'
     294        Application [0]:
     295                Application type:  'usim (2)'
     296                Application state: 'ready'
     297                Application ID:
     298                        A0:00:00:00:87:10:02:FF:FF:FF:FF:89:06:19:00:00
     299                Personalization state: 'ready'
     300                UPIN replaces PIN1: 'no'
     301                PIN1 state: 'disabled'
     302                        PIN1 retries: '3'
     303                        PUK1 retries: '10'
     304                PIN2 state: 'enabled-not-verified'
     305                        PIN2 retries: '10'
     306                        PUK2 retries: '10'
     307        Application [1]:
     308                Application type:  'isim (5)'
     309                Application state: 'detected'
     310                Application ID:
     311                        A0:00:00:00:87:10:04:FF:FF:FF:FF:89:07:03:00:00
     312                Personalization state: 'unknown'
     313                UPIN replaces PIN1: 'no'
     314                PIN1 state: 'disabled'
     315                        PIN1 retries: '3'
     316                        PUK1 retries: '10'
     317                PIN2 state: 'not-initialized'
     318                        PIN2 retries: '0'
     319                        PUK2 retries: '0'
     320}}}
     321 * Signal strength:
     322{{{#!bash
     323root@ventana:~# qmicli -d /dev/cdc-wdm0 --nas-get-signal-info
     324[/dev/cdc-wdm0] Successfully got signal info
     325WCDMA:
     326        RSSI: '-96 dBm'
     327        ECIO: '-12.0 dBm'
     328root@ventana:~# qmicli -d /dev/cdc-wdm0 --nas-get-signal-strength
     329[/dev/cdc-wdm0] Successfully got signal strength
     330Current:
     331        Network 'umts': '-96 dBm'
     332RSSI:
     333        Network 'umts': '-96 dBm'
     334ECIO:
     335        Network 'umts': '-11.0 dBm'
     336IO: '-106 dBm'
     337SINR (8): '9.0 dB'
     338}}}
     339 * Network details:
     340{{{#!bash
     341root@ventana:~# qmicli -d /dev/cdc-wdm0 --nas-get-system-selection-preference
     342[/dev/cdc-wdm0] Successfully got system selection preference
     343        Emergency mode: 'no'
     344        Mode preference: 'umts, lte'
     345        Band preference: 'wcdma-2100, wcdma-pcs-1900, wcdma-dcs-1800, wcdma-1700-us, wcdma-850-us, wcdma-900'
     346        LTE band preference: '1, 2, 3, 4, 5, 7, 8, 12, 13, 20, 25, 41'
     347        TD-SCDMA band preference: '(null)'
     348        Roaming preference: 'any'
     349        Network selection preference: 'automatic'
     350        Service domain preference: 'cs-ps'
     351        Service selection preference: 'automatic'
     352root@ventana:~# qmicli -d /dev/cdc-wdm0 --nas-network-scan
     353[/dev/cdc-wdm0] Successfully scanned networks
     354Network [0]:
     355        MCC: '310'
     356        MNC: '260'
     357        Status: 'available, home, not-forbidden, preferred'
     358        Description: 'T-Mobile'
     359Network [1]:
     360        MCC: '310'
     361        MNC: '260'
     362        Status: 'current-serving, home, not-forbidden, preferred'
     363        Description: 'Project F'
     364Network [2]:
     365        MCC: '312'
     366        MNC: '770'
     367        Status: 'available, roaming, not-forbidden, not-preferred'
     368        Description: '312 770'
     369Network [3]:
     370        MCC: '310'
     371        MNC: '410'
     372        Status: 'available, roaming, not-forbidden, not-preferred'
     373        Description: 'AT&T'
     374Network [4]:
     375        MCC: '310'
     376        MNC: '410'
     377        Status: 'available, roaming, not-forbidden, not-preferred'
     378        Description: 'AT&T'
     379Network [5]:
     380        MCC: '311'
     381        MNC: '480'
     382        Status: 'available, roaming, forbidden, not-preferred'
     383        Description: 'Verizon'
     384Network [0]:
     385        MCC: '310'
     386        MNC: '260'
     387        RAT: 'lte'
     388Network [1]:
     389        MCC: '310'
     390        MNC: '260'
     391        RAT: 'umts'
     392Network [2]:
     393        MCC: '312'
     394        MNC: '770'
     395        RAT: 'lte'
     396Network [3]:
     397        MCC: '310'
     398        MNC: '410'
     399        RAT: 'lte'
     400Network [4]:
     401        MCC: '310'
     402        MNC: '410'
     403        RAT: 'umts'
     404Network [5]:
     405        MCC: '311'
     406        MNC: '480'
     407        RAT: 'lte'
     408Network [0]:
     409        MCC: '310'
     410        MNC: '260'
     411        MCC with PCS digit: 'yes'
     412Network [1]:
     413        MCC: '310'
     414        MNC: '260'
     415        MCC with PCS digit: 'yes'
     416Network [2]:
     417        MCC: '312'
     418        MNC: '770'
     419        MCC with PCS digit: 'yes'
     420Network [3]:
     421        MCC: '310'
     422        MNC: '410'
     423        MCC with PCS digit: 'yes'
     424Network [4]:
     425        MCC: '310'
     426        MNC: '410'
     427        MCC with PCS digit: 'yes'
     428Network [5]:
     429        MCC: '311'
     430        MNC: '480'
     431        MCC with PCS digit: 'yes'
     432root@ventana:~# qmicli -d /dev/cdc-wdm0 --nas-get-operator-name
     433[/dev/cdc-wdm0] Successfully got operator name data
     434PLMN List:
     435        MCC/MNC: '310-DDD' LAC Range: 0->65279  PNN Record: 1
     436        MCC/MNC: '311-DDD' LAC Range: 0->65279  PNN Record: 1
     437        MCC/MNC: '312-DDD' LAC Range: 0->65279  PNN Record: 1
     438        MCC/MNC: '313-DDD' LAC Range: 0->65279  PNN Record: 1
     439        MCC/MNC: '314-DDD' LAC Range: 0->65279  PNN Record: 1
     440        MCC/MNC: '315-DDD' LAC Range: 0->65279  PNN Record: 1
     441        MCC/MNC: '316-DDD' LAC Range: 0->65279  PNN Record: 1
     442PLMN Names:
     443        0: 'Project Fi' ('Project Fi')          Country: 'initials-do-not-add'
     444root@ventana:~# qmicli -d /dev/cdc-wdm0 --nas-get-serving-system
     445[/dev/cdc-wdm0] Successfully got serving system:
     446        Registration state: 'registered'
     447        CS: 'attached'
     448        PS: 'attached'
     449        Selected network: '3gpp'
     450        Radio interfaces: '1'
     451                [0]: 'umts'
     452        Roaming status: 'off'
     453        Data service capabilities: '3'
     454                [0]: 'hsdpa'
     455                [1]: 'hsupa'
     456                [2]: 'wcdma'
     457        Current PLMN:
     458                MCC: '310'
     459                MNC: '260'
     460                Description: 'Project Fi'
     461        Roaming indicators: '1'
     462                [0]: 'off' (umts)
     463        3GPP location area code: '26289'
     464        3GPP cell ID: '85367600'
     465        Detailed status:
     466                Status: 'available'
     467                Capability: 'cs-ps'
     468                HDR Status: 'none'
     469                HDR Hybrid: 'no'
     470                Forbidden: 'no'
     471        Call barring status:
     472                Circuit switched: 'all-calls'
     473                Packet switched: 'all-calls'
     474        UMTS primary scrambling code: '61'
     475        Full operator code info:
     476                MCC: '310'
     477                MNC: '260'
     478                MNC with PCS digit: 'yes'
     479root@ventana:~# qmicli -d /dev/cdc-wdm0 --nas-get-home-network
     480[/dev/cdc-wdm0] Successfully got home network:
     481        Home network:
     482                MCC: '310'
     483                MNC: '260'
     484                Description: 'Project F'
     485root@ventana:~# qmicli -d /dev/cdc-wdm0 --nas-get-system-info
     486[/dev/cdc-wdm0] Successfully got system info:
     487        WCDMA service:
     488                Status: 'available'
     489                True Status: 'available'
     490                Preferred data path: 'no'
     491                Domain: 'cs-ps'
     492                Service capability: 'cs-ps'
     493                Roaming status: 'off'
     494                Forbidden: 'no'
     495                Location Area Code: '26289'
     496                Cell ID: '85367600'
     497                MCC: '310'
     498                MNC: '260'
     499                HS call status: 'hsdpa-hsupa-unsupported'
     500                HS service: 'hsdpa-hsupa-supported'
     501                Primary scrambling code: '61'
     502                Cell broadcast support: 'off'
     503                Call barring status (CS): 'all-calls'
     504                Call barring status (PS): 'all-calls'
     505                Cipher Domain: 'none'
     506        LTE service:
     507                Status: 'none'
     508                True Status: 'none'
     509                Preferred data path: 'no'
     510        SIM reject info: 'available'
     511}}}
     512 * Connect to Google Fi network:
     513{{{#!bash
     514root@ventana:~# echo "APN=h2g2" > /etc/qmi-network.conf # specify APN
     515root@ventana:~# echo "PROXY=yes" >> /etc/qmi-network.conf # allow ports to be shared by multiple libqmi apps
     516root@ventana:~# qmi-network /dev/cdc-wdm0 start
     517Loading profile at /etc/qmi-network.conf...
     518    APN: h2g2
     519    APN user: unset
     520    APN password: unset
     521    qmi-proxy: no
     522Checking data format with 'qmicli -d /dev/cdc-wdm0 --wda-get-data-format --device-open-proxy'...
     523Device link layer protocol retrieved: raw-ip
     524Getting expected data format with 'qmicli -d /dev/cdc-wdm0 --get-expected-data-format'...
     525Expected link layer protocol retrieved: 802-3
     526Updating kernel link layer protocol with 'qmicli -d /dev/cdc-wdm0 --set-expected-data-format=raw-ip'...
     527Kernel link layer protocol updated
     528Starting network with 'qmicli -d /dev/cdc-wdm0 --wds-start-network=apn='h2g2'  --client-no-release-cid '...
     529Saving state at /tmp/qmi-network-state-cdc-wdm0... (CID: 35)
     530Saving state at /tmp/qmi-network-state-cdc-wdm0... (PDH: 62482624)
     531Network started successfully
     532root@ventana:~# qmicli --device /dev/cdc-wdm0   --client-no-release-cid --client-cid=35 --wds-get-current-settings
     533[/dev/cdc-wdm0] Current settings retrieved:
     534           IP Family: IPv4
     535        IPv4 address: 100.69.157.123
     536    IPv4 subnet mask: 255.255.255.248
     537IPv4 gateway address: 100.69.157.124
     538    IPv4 primary DNS: 10.177.0.34
     539  IPv4 secondary DNS: 10.177.0.210
     540                 MTU: 1500
     541             Domains: none
     542[/dev/cdc-wdm0] Client ID not released:
     543        Service: 'wds'
     544            CID: '35'
     545root@ventana:~# ifconfig wwan0 100.69.157.123 netmask 255.255.255.248
     546root@ventana:~# route add default gw 100.69.157.124 wwan0
     547root@ventana:~# echo "nameserver 10.177.0.34" > /etc/resolv.conf
     548root@ventana:~# echo "nameserver 10.177.0.210" >> /etc/resolv.conf
     549root@ventana:~# ping www.google.com
     550}}}
     551
     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
     556echo "APN=h2g2" > /etc/qmi-network.conf # specify APN
     557echo "PROXY=yes" >> /etc/qmi-network.conf # allow ports to be shared by multiple libqmi apps
     558qmicli -p -d /dev/cdc-wdm0 --wda-set-data-format=802-3 # set data format (raw-ip/802-3)
     559qmicli -p -d /dev/cdc-wdm0 --set-expected-data-format=802-3 # set expected format, should match above
     560qmi-network /dev/cdc-wdm0 start
     561dhclient 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
     566qmicli -p -d /dev/cdc-wdm0 --wda-set-data-format=802-3 # set data format (raw-ip/802-3)
     567qmicli -p -d /dev/cdc-wdm0 --set-expected-data-format=802-3 # set expected format, should match above
     568qmicli -p -d /dev/cdc-wdm0 --wds-start-network="apn=h2g2,ip-type=4" --client-no-release-cid
     569dhclient 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.
     573
     574[=#libqmi-firmware]
     575Firmware related commands:
     576 * Show firmware versions
     577{{{#!bash
     578root@ventana:~# qmicli -d /dev/cdc-wdm0 --dms-get-firmware-preference
     579firmware preference successfully retrieved:
     580[image 0]
     581        Image type: 'modem'
     582        Unique ID:  '005.010_001'
     583        Build ID:   '05.05.16.02_ATT'
     584[image 1]
     585        Image type: 'pri'
     586        Unique ID:  '005.010_001'
     587        Build ID:   '05.05.16.02_ATT'
     588}}}
     589 * update firmware:
     590{{{#!bash
     591root@ventana:~/mc7354/firmware# qmi-firmware-update --update -d 1199:68c0 9999999_9902196_SWI9X15C_05.05.58.00_00_ATT_005.026_000-field.spk
     592loading device information before the update...
     593setting firmware preference:
     594  firmware version: '05.05.58.00'
     595  config version:   '005.026_000'
     596  carrier:          'ATT'
     597rebooting in download mode...
     598download mode detected
     599downloading cwe image: 9999999_9902196_SWI9X15C_05.05.58.00_00_ATT_005.026_000-field.spk (34.8 MB)...
     600finalizing download... (may take more than one minute, be patient)
     601successfully downloaded in 11.31s (3.1 MB/s)
     602rebooting in normal mode...
     603normal mode detected
     604
     605------------------------------------------------------------------------
     606    NOTE: in order to validate which is the firmware running in the
     607    module, the program will wait for a complete boot; this process
     608    may take some time and several retries.
     609------------------------------------------------------------------------
     610
     611waiting some time for the device to boot...
     612loading device information after the update (1/12)...
     613waiting some time for the device to boot...
     614loading device information after the update (2/12)...
     615waiting some time for the device to boot...
     616loading device information after the update (3/12)...
     617
     618------------------------------------------------------------------------
     619
     620   original firmware revision was:
     621      SWI9X15C_05.05.16.02 r21040 carmd-fwbuild1 2014/03/17 23:49:48
     622   original running firmware details:
     623      Model: MC7354
     624      Boot version: SWI9X15C_05.05.16.02 r21040 carmd-fwbuild1 2014/03/17 23:49:48
     625      AMSS version: SWI9X15C_05.05.16.02 r21040 carmd-fwbuild1 2014/03/17 23:49:48
     626      SKU ID: 1102016
     627      Package ID: 1102016_9903211_SWI9X15C_05.05.16.02_00_Generic_005.006_000
     628      Carrier ID: 4
     629   original firmware preference details:
     630      image 'modem': unique id '005.010_001', build id '05.05.16.02_ATT'
     631      image 'pri': unique id '005.010_001', build id '05.05.16.02_ATT'
     632
     633   new firmware revision is:
     634      SWI9X15C_05.05.58.00 r27038 carmd-fwbuild1 2015/03/04 21:30:23
     635   new running firmware details:
     636      Model: MC7354
     637      Boot version: SWI9X15C_05.05.58.00 r27038 carmd-fwbuild1 2015/03/04 18:38:46
     638      AMSS version: SWI9X15C_05.05.58.00 r27038 carmd-fwbuild1 2015/03/04 21:30:23
     639      SKU ID: 1102016
     640      Package ID: 1102016_9903211_SWI9X15C_05.05.16.02_00_Generic_005.006_000
     641      Carrier ID: 4
     642   new firmware preference details:
     643      image 'modem': unique id '005.026_000', build id '05.05.58.00_ATT'
     644      image 'pri': unique id '005.026_000', build id '05.05.58.00_ATT'
     645
     646   NOTE: this device supports firmware preference management
     647   with qmicli operations:
     648      --dms-get-firmware-preference
     649      --dms-set-firmware-preference
     650
     651------------------------------------------------------------------------
     652
     653firmware update operation finished successfully
     654}}}
     655
     656References:
     657 * libqmi - http://www.freedesktop.org/wiki/Software/libqmi/
     658 * An introduction to libqmi - http://sigquit.wordpress.com/2012/08/20/an-introduction-to- *
     659
     660[=#modemmanager]
     661=== !ModemManager ===
     662!ModemManager is a package containing a background service/daemon and a command-line-interfalce (mmcli) that can be used to configure and connect modems.
     663
     664Note that after starting the service (if manually started) it does take 20 to 30 seconds to finish modem detection.
     665
     666Example usage:
     667- List detected modems
     668{{{#!bash
     669root@ventana:~# mmcli --list-modems
     670
     671No modems were found
     672
     673root@ventana:~# mmcli --list-modems
     674
     675Found 1 modems:
     676        /org/freedesktop/ModemManager1/Modem/0 [Sierra Wireless, Incorporated] MC7455
     677
     678}}}
     679- Show details for the first modem:
     680{{{#!bash
     681root@ventana:~# mmcli --modem 0
     682
     683/org/freedesktop/ModemManager1/Modem/0 (device id '86bde2905ff6f63bbefcfa457fe8f9221b76e968')
     684  -------------------------
     685  Hardware |   manufacturer: 'Sierra Wireless, Incorporated'
     686           |          model: 'MC7455'
     687           |       revision: 'SWI9X30C_02.08.02.00 r5428 CARMD-EV-FRMWR2 2016/01/06 20:38:53'
     688           |      supported: 'gsm-umts
     689           |                  lte
     690           |                  gsm-umts, lte'
     691           |        current: 'gsm-umts, lte'
     692           |   equipment id: '359072060290422'
     693  -------------------------
     694  System   |         device: '/sys/devices/soc0/soc/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.2'
     695           |        drivers: 'qmi_wwan, qcserial'
     696           |         plugin: 'Sierra'
     697           |   primary port: 'cdc-wdm0'
     698           |          ports: 'ttyUSB0 (qcdm), ttyUSB2 (at), cdc-wdm0 (qmi), wwan0 (net), wwan1 (net), cdc-wdm1 (qmi)'
     699  -------------------------
     700  Numbers  |           own : '18057812000'
     701  -------------------------
     702  Status   |           lock: 'sim-pin2'
     703           | unlock retries: 'sim-pin (3), sim-pin2 (10), sim-puk (10), sim-puk2 (10)'
     704           |          state: 'disabled'
     705           |    power state: 'on'
     706           |    access tech: 'unknown'
     707           | signal quality: '0' (cached)
     708  -------------------------
     709  Modes    |      supported: 'allowed: 2g, 3g, 4g; preferred: none'
     710           |        current: 'allowed: 2g, 3g, 4g; preferred: none'
     711  -------------------------
     712  Bands    |      supported: 'u2100, u1800, u1900, u17iv, u850, u900, eutran-i, eutran-ii, eutran-iii, eutran-iv, eutran-v, eutran-vii, eutran-viii, eutran-xii, eutran-xiii, eutran-xx, eutran-xxv, eutran-xli'
     713           |        current: 'u2100, u1800, u1900, u17iv, u850, u900, eutran-i, eutran-ii, eutran-iii, eutran-iv, eutran-v, eutran-vii, eutran-viii, eutran-xii, eutran-xiii, eutran-xx, eutran-xxv, eutran-xli'
     714  -------------------------
     715  IP       |      supported: 'ipv4, ipv6, ipv4v6'
     716  -------------------------
     717  3GPP     |           imei: '359072060290555'
     718           |  enabled locks: 'none'
     719           |    operator id: 'unknown'
     720           |  operator name: 'unknown'
     721           |   subscription: 'unknown'
     722           |   registration: 'unknown'
     723  -------------------------
     724  SIM      |           path: '/org/freedesktop/ModemManager1/SIM/0'
     725
     726  -------------------------
     727  Bearers  |          paths: 'none'
     728
     729}}}
     730 * Note the above shows a Sierra Wireless MC7455 modem supporting 'gsm-umts', 'lte' networks, using QMI control protocol (qmi_wwan driver) on /dev/cdc-wdm0, with a SIM that has been read however the radio is disabled
     731- If the SIM has PIN locking enabled and its state is 'locked' under the Status section above you can enter the SIM pin with {{{mmcli --pin=<PIN>}}}
     732{{{#!bash
     733root@ventana:~# mmcli --pin=1234
     734successfully sent PIN code to the SIM
     735}}}
     736 * Some additional commands for handling SIM PINs are '--enable-pin', '--disable-pin', '--change-pin=<NEW_PIN>', '--puk=<PUK>' to enable PIN locking, disable PIN locking, changing the PIN, and unlocking a PUK-locked ([https://en.wikipedia.org/wiki/Personal_unblocking_code Personal unblocking code]) SIM.
     737- Enable first modem:
     738{{{#!bash
     739root@ventana:~# mmcli --modem 0 --enable
     740successfully enabled the modem
     741}}}
     742 * Now a status will show the following different info under status
     743{{{#!bash
     744  -------------------------
     745  Status   |           lock: 'sim-pin2'
     746           | unlock retries: 'sim-pin (3), sim-pin2 (10), sim-puk (10), sim-puk2 (10)'
     747           |          state: 'registered'
     748           |    power state: 'on'
     749           |    access tech: 'umts'
     750           | signal quality: '26' (recent)
     751
     752}}}
     753- Scan available networks:
     754{{{#!bash
     755root@ventana:~# mmcli --modem 0 --3gpp-scan --timeout=300
     756
     757Found 5 networks:
     758310410 - AT&T (umts, available)
     759310410 - AT&T (lte, available)
     760310260 - T-Mobile (gsm, available)
     761310260 - Project Fi (umts, current)
     762310260 - T-Mobile (lte, available)
     763}}}
     764- Connect modem (example: Google Fi)
     765{{{#!bash
     766root@ventana:~# mmcli --modem 0 --simple-connect="apn=h2g2"
     767successfully connected the modem
     768}}}
     769- Get IP Configuration:
     770{{{
     771root@ventana:~# mmcli --modem 0 | grep Bearers
     772  Bearers  |          paths: '/org/freedesktop/ModemManager1/Bearer/0'
     773root@ventana:~# mmcli --bearer 0
     774Bearer '/org/freedesktop/ModemManager1/Bearer/0'
     775  -------------------------
     776  Status             |   connected: 'yes'
     777                     |   suspended: 'no'
     778                     |   interface: 'wwan0'
     779                     |  IP timeout: '20'
     780  -------------------------
     781  Properties         |         apn: 'h2g2'
     782                     |     roaming: 'allowed'
     783                     |     IP type: 'none'
     784                     |        user: 'none'
     785                     |    password: 'none'
     786                     |      number: 'none'
     787                     | Rm protocol: 'unknown'
     788  -------------------------
     789  IPv4 configuration |   method: 'static'
     790                     |  address: '30.58.51.96'
     791                     |   prefix: '30'
     792                     |  gateway: '30.58.51.97'
     793                     |      DNS: '10.177.0.34', '10.177.0.210'
     794                     |      MTU: '1430'
     795  -------------------------
     796  IPv6 configuration |   method: 'unknown'
     797  -------------------------
     798  Stats              |          Duration: '30'
     799                     |    Bytes received: 'N/A'
     800                     | Bytes transmitted: 'N/A'
     801root@ventana:~# ifconfig wwan0 30.58.51.96/30
     802root@ventana:~# route add default gw 30.58.51.97 wwan0
     803root@ventana:~# echo "nameserver 10.177.0.34" > /etc/resolv.conf
     804root@ventana:~# echo "nameserver 10.177.0.210" >> /etc/resolv.conf
     805root@ventana:~# ping www.google.com
     806}}}
     807 * Some modem drivers provide 'raw-ip' instead of 802.3 link layer which DHCP doesn't support requiring you to manually configure as above. If your modem provides an 802.3 channel you can run dhcp via 'dhclient wwan0'
     808
     809Some modems that support GNSS provide access to global positioning via !ModemManager. For example, the Huawei MU609:
     810{{{#!bash
     811# enable GPS based location with NMEA trace info
     812root@ventana:~# mmcli --modem 0 --location-enable-gps-nmea
     813successfully setup location gathering
     814# get GPS NMEA location info
     815root@ventana:~# mmcli --modem 0 --location-get-gps-nmea
     816
     817/org/freedesktop/ModemManager1/Modem/0
     818  -------------------------
     819  GPS NMEA traces | $GPGGA,153824.0,3515.484477,N,12040.136651,W,1,06,1.3,47.8,M,-31.0,M,,*58
     820                  | $GPGSA,A,3,05,07,08,09,28,30,,,,,,,2.7,1.3,2.4*39
     821                  | $GPVTG,,T,0.0,M,0.0,N,0.0,K,A*0D
     822                  | $GPRMC,153824.0,A,3515.484477,N,12040.136651,W,0.0,,200617,,,A*56
     823                  | $GPGSV,2,1,07,05,17,289,36,07,60,040,40,08,35,064,32,09,47,154,35*78
     824                  | $GPGSV,2,2,07,28,54,239,38,30,54,319,39,23,15,146,*43
     825
     826# enable GPS based location with raw trace info
     827root@ventana:~# mmcli --modem 0 --location-enable-gps-raw
     828successfully setup location gathering
     829root@ventana:~# mmcli --modem 0 --location-get-gps-raw
     830
     831/org/freedesktop/ModemManager1/Modem/0
     832  -------------------------
     833  Raw GPS         |  UTC time: '153938.0'
     834                  | Longitude: '-120.668886'
     835                  |  Latitude: '35.258143'
     836                  |  Altitude: '46.100000'
     837
     838root@ventana:~# mmcli --modem 0 --location-get
     839
     840/org/freedesktop/ModemManager1/Modem/0
     841  -------------------------
     842  3GPP location   | Mobile country code: '310'
     843                  | Mobile network code: '410'
     844                  |  Location area code: '55562'
     845                  |             Cell ID: '53228154'
     846  -------------------------
     847  GPS NMEA traces | $GPGGA,153938.0,3515.488596,N,12040.133136,W,1,06,1.3,46.1,M,-31.0,M,,*5D
     848                  | $GPGSA,A,3,05,07,08,09,28,30,,,,,,,2.7,1.3,2.3*3E
     849                  | $GPVTG,,T,0.0,M,0.0,N,0.0,K,A*0D
     850                  | $GPRMC,153938.0,A,3515.488596,N,12040.133136,W,0.0,,200617,,,A*5B
     851                  | $GPGSV,2,1,07,05,17,289,35,07,60,042,41,08,35,063,34,09,46,154,35*78
     852                  | $GPGSV,2,2,07,28,54,240,40,30,55,320,40,23,15,146,*47
     853  -------------------------
     854  Raw GPS         |  UTC time: '153938.0'
     855                  | Longitude: '-120.668886'
     856                  |  Latitude: '35.258143'
     857                  |  Altitude: '46.100000'
     858  -------------------------
     859  CDMA BS         | Not available
     860}}}
     861
     862Controlling the !ModemManager service:
     863 * Ubuntu 16.04 (use systemctl)
     864{{{#!bash
     865# stop ModemManager
     866systemctl stop ModemManager
     867# disable ModemManager at boot
     868systemctl disable ModemManager
     869# enable ModemManager at boot
     870systemctl enable ModemManager
     871# start ModemManager
     872systemctl start ModemManager
     873}}}
     874
     875Debugging with !ModemManager can be done by running !ModemManager with the '--debug' flag. For example, on Ubuntu 16.04:
     876{{{#!bash
     877# stop ModemManager
     878systemctl stop ModemManager
     879# run manually with debug
     880ModemManager --debug --log-level=DEBUG
     881# set logging level to max
     882mmcli -G DEBUG
     883# set logging level to minimum
     884mmcli -G ERR
     885# AT commands can be sent when in debug mode
     886mmcli --modem 0 --timeout=120 --command="ATI" # Ident
     887}}}
     888
     889
     890References:
     891 * [https://www.freedesktop.org/software/ModemManager/man/latest/mmcli.8.html mmcli man page]
     892 * [https://docs.ubuntu.com/core/en/stacks/network/network-manager/docs/configure-cellular-connections Ubuntu Core - Configuring Cellular Connections]
     893
     894
     895[=#networkmanager]
     896=== !NetworkManager ===
     897!NetworkManager is a package containing a background service/daemon and a command-line-interfalce (nmcli) that can be used to configure and connect network interfaces. It is often used in conjunction with !ModemManager for Cellular modems.
     898
     899Notes:
     900- network-manager-1.2.6 (Ubuntu 16.04) has a different cmdline syntax for nmcli than network-manager-0.9.8.8 (Ubuntu 14.04). The following examples are for network-manager-1.2.6+
     901
     902Example usage:
     903- Show version:
     904{{{#!bash
     905root@ventana:~# nmcli --version
     906nmcli tool, version 1.2.6
     907}}}
     908- Show Device Status:
     909{{{#!bash
     910# show status
     911root@ventana:~# nmcli device status
     912DEVICE    TYPE      STATE         CONNECTION       
     913eth0      ethernet  connected     Wired connection 1
     914cdc-wdm0  gsm       disconnected  --               
     915eth1      ethernet  unavailable   --               
     916can0      can       unmanaged     --               
     917lo        loopback  unmanaged     --               
     918}}}
     919- Bring down Wired Connection 1:
     920{{{#!bash
     921root@ventana:~# nmcli connection down id 'Wired connection 1'
     922Connection 'Wired connection 1' successfully deactivated
     923}}}
     924- Add a modem:
     925 * Example: QMI controlled modem with an APN=h2g2 (Google Fi):
     926{{{#!bash
     927root@ventana:~# nmcli connection add type gsm ifname cdc-wdm0 con-name mymodem apn h2g2
     928Connection 'mymodem ' (6d89ff6e-6eb6-4f0f-80d1-fb081165f710) successfully added.
     929}}}
     930 * Example: AT controlled modem with a Verizon Dynamic IP SIM:
     931{{{#!bash
     932root@ventana:~# nmcli connection add type gsm ifname ttyACM0 con-name mymodem apn vzwinternet
     933Connection 'mymodem ' (6d89ff6e-6eb6-4f0f-80d1-fb081165f710) successfully added.
     934}}}
     935- Connect to mymodem device:
     936{{{#!bash
     937root@ventana:~# nmcli connection up id mymodem
     938Connection successfully activated
     939}}}
     940
     941Controlling the !NetworkManager service:
     942 * Ubuntu 16.04 (use systemctl)
     943{{{#!bash
     944# stop NetworkManager
     945systemctl stop NetworkManager
     946# disable NetworkManager at boot
     947systemctl disable NetworkManager
     948# enable NetworkManager at boot
     949systemctl enable NetworkManager
     950# start NetworkManager
     951systemctl start NetworkManager
     952}}}
     953
     954Troubleshooting:
     955 * if you find your modem's primary interface that !ModemManager detects is inconsistent you will want to remove the {{{interface-name=}}} line from the {{{[conneciton]}}} section of your modem configuration in the {{{/etc/NetworkManager/system-connections/}}} file for your modem and add a {{{device-id=}}} line to the {{{[gsm]}}} section that refers to the unique modem id string that !ModemManager defines for the modem shown on the 2nd line output from {{{mmcli -m 0}}}. You can also use dbus to get the {{{device-id}}} as such:
     956{{{#!bash
     957root@ventana:~# dbus-send --print-reply --system \
     958   --dest=org.freedesktop.ModemManager1 \
     959   /org/freedesktop/ModemManager1/Modem/0 \
     960   org.freedesktop.DBus.Properties.Get \
     961   string:org.freedesktop.ModemManager1.Modem string:DeviceIdentifier
     962method return time=1504221807.956321 sender=:1.3 -> destination=:1.27 serial=41 reply_serial=2
     963   variant       string "ce4335fc20b8e7d2bf65f68483b79e78216e0256"
     964}}}
     965
     966[=#modemmanager-ppa]
     967=== Installing pre-built latest stable libqmi/libmbim/modemmanager via PPA ===
     968Aleksander Morgado (https://aleksander.es), a key developer behind the !ModemManager, libqmi, and libmbim projects that provide modem support on Ubuntu provides up-to-date Ubuntu PPA's for 14.04 trusty and 16.04 xenial. Instructions on how to add the PPA feeds and update the packages exist there:
     969 - [https://launchpad.net/~aleksander-m/+archive/ubuntu/modemmanager-xenial modemmanager/libqmi/libmbim PPA xenial]
     970 - [https://launchpad.net/~aleksander-m/+archive/ubuntu/modemmanager-trusty modemmanager/libqmi/libmbim PPA trusty]
     971
     972Xenial:
     973{{{#!bash
     974apt-get install software-properties-common # contains add-apt-repository
     975add-apt-repository ppa:aleksander-m/modemmanager-xenial
     976apt-get update
     977apt-get install modemmanager libqmi-utils libmbim-utils
     978}}}
     979
     980Trusty:
     981{{{#!bash
     982add-apt-repository ppa:aleksander-m/modemmanager-trusty
     983apt-get update
     984apt-get install modemmanager libqmi-utils libmbim-utils
     985}}}
     986
     987
     988[=#building-from-source]
     989=== Building libqmi/libmbim/modemmanager from source ===
     990You can also build the latest modemmanager, libqmi, libmbim easily from source on an Ubuntu system. It is recommended to use stable releases which you can easily do from the PPA's provided above however if you wish to debug, contribute patches, or try patches from the various mailing lists you will need to build from the git repo sources.
     991
     992For example the following was done on Ubuntu 16.04 (xenial):
     993* libqmi:
     994{{{#!bash
     995apt-get install build-essential git pkg-config automake autoconf intltool libtool gtk-doc-tools
     996apt-get install libglib2.0-dev libgudev-1.0-dev
     997git clone git://anongit.freedesktop.org/libqmi && cd libqmi && ./autogen.sh
     998make
     999make install
     1000ldconfig
     1001cd ..
     1002}}}
     1003 - you can find the latest 'stable' release from https://www.freedesktop.org/software/libqmi/ (untar and run configure)
     1004* libmbim:
     1005{{{#!bash
     1006apt-get install build-essential git pkg-config automake autoconf intltool libtool gtk-doc-tools
     1007apt-get install libglib2.0-dev libgudev-1.0-dev
     1008git clone git://anongit.freedesktop.org/libmbim/libmbim && cd libmbim && ./autogen.sh
     1009make
     1010make install
     1011ldconfig
     1012cd ..
     1013}}}
     1014 - you can find the latest 'stable' release from https://www.freedesktop.org/software/libmbim/ (untar and run configure)
     1015* modemmanager:
     1016{{{#!bash
     1017git clone git://anongit.freedesktop.org/ModemManager/ModemManager && cd ModemManager && ./autogen.sh
     1018make
     1019make install
     1020ldconfig
     1021cd ..
     1022}}}
     1023 - you can find the latest 'stable' release from https://www.freedesktop.org/software/ModemManager/ (untar and run configure)
     1024
     1025Notes:
     1026 - if you are building and installing from source you should remove all other packages that install libmbim or libqmi:
     1027{{{#!bash
     1028apt-get purge libmbim-glib-dev llibmbim-glib-doc libmbim-glib4 libmbim-glib4-dbg libmbim-proxy libmbim-utils
     1029apt-get purge libqmi-glib-dev libqmi-glib-doc libqmi-glib1 libqmi-glib1-dbg libqmi-proxy libqmi-utils
     1030}}}
     1031
     1032
     1033[=#troubleshooting]
     1034=== Troubleshooting Modem support on Ubuntu ===
     1035Because modem technology is constantly changing it is often best to try to get it working on the most modern Linux system possible with up to date kernel drivers and libraries. Often this is easily accomplished with Ubuntu under the following circumstances:
     1036 - use the latest mainline Linux kernel if you can, otherwise use the most recent available Ubuntu kernel
     1037 - use the latest !ModemManager, libqmi, and libmbim PPA's (see above)
     1038
     1039Use !ModemManager to see if your modem is detected and attempt connecting. Querying a modem with !ModemManager will also tell you what control interfaces exist and what type of control they use which is critical to understanding the requirements for your modem.
     1040
     1041Troubleshooting steps:
     1042 * Determine what devices you have present and what drivers are being used to possibly support them:
     1043{{{#!bash
     1044root@ventana:~# lsusb
     1045Bus 001 Device 003: ID 1199:9071 Sierra Wireless, Inc.
     1046Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
     1047Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
     1048root@ventana:~# dmesg | egrep -ie qualcom\|mbim\|sierra\|wdm
     1049[   11.253539] usb 1-1.2: Product: Sierra Wireless MC7455 Qualcomm® Snapdragon™ X7 LTE-A
     1050[   11.253546] usb 1-1.2: Manufacturer: Sierra Wireless, Incorporated
     1051[   11.378483] usbcore: registered new interface driver cdc_wdm
     1052[   11.395365] usbserial: USB Serial support registered for Qualcomm USB modem
     1053[   11.397829] qcserial 1-1.2:1.0: Qualcomm USB modem converter detected
     1054[   11.398318] usb 1-1.2: Qualcomm USB modem converter now attached to ttyUSB0
     1055[   11.400563] qcserial 1-1.2:1.2: Qualcomm USB modem converter detected
     1056[   11.402218] usb 1-1.2: Qualcomm USB modem converter now attached to ttyUSB1
     1057[   11.404332] qcserial 1-1.2:1.3: Qualcomm USB modem converter detected
     1058[   11.406082] usb 1-1.2: Qualcomm USB modem converter now attached to ttyUSB2
     1059[   11.408664] qmi_wwan 1-1.2:1.8: cdc-wdm0: USB WDM device
     1060[   11.412510] qmi_wwan 1-1.2:1.10: cdc-wdm1: USB WDM device
     1061}}}
     1062  - Note that the 'usbcore: registered' messages simply indicate a driver is loaded not that it has detected a supported device
     1063   - if qmi_wwan detects your modem it speaks QMI (example above)
     1064   - if cdc_mbim detects your modem it speaks MBIM
     1065  - you can also look at what driver module is bound to a device (QMI example):
     1066{{{#!bash
     1067root@ventana:~# ls -l /sys/class/usbmisc/cdc-wdm0/device/driver/ | grep module
     1068lrwxrwxrwx 1 root root    0 Mar  7 22:20 module -> ../../../../module/qmi_wwan
     1069}}}
     1070 * Use !ModemManager to see what ports and driver are detetcted/supported:
     1071{{{#!bash
     1072root@ventana:~# mmcli --modem 0 | grep  -i -E ports\|driver
     1073           |        drivers: 'qmi_wwan, qcserial'
     1074           |          ports: 'ttyUSB0 (qcdm), ttyUSB2 (at), cdc-wdm0 (qmi), wwan0 (net), wwan1 (net), cdc-wdm1 (qmi)'
     1075}}}
     1076  - here we see that the modem in the system is supported by the 'qcserial' driver and the 'qmi_wwan' driver, it speaks 'qcdm', 'at', and 'qmi' control protocols, and it uses the 'wwan0' network device for data
     1077 * Check PIN status, power state, registration state, and signal quality by looking at the 'Numbers' and 'Status' section of !ModemManager output:
     1078{{{#!bash
     1079root@ventana:~# mmcli --modem 0
     1080...
     1081  -------------------------
     1082  Numbers  |           own : '18052959083'
     1083  -------------------------
     1084  Status   |           lock: 'sim-pin2'
     1085           | unlock retries: 'sim-pin (3), sim-pin2 (10), sim-puk (10), sim-puk2 (10)'
     1086           |          state: 'registered'
     1087           |    power state: 'on'
     1088           |    access tech: 'umts'
     1089           | signal quality: '31' (recent)
     1090  -------------------------
     1091  Modes    |      supported: 'allowed: 2g, 3g, 4g; preferred: none'
     1092           |        current: 'allowed: 2g, 3g, 4g; preferred: none'
     1093  -------------------------
     1094...
     1095}}}
     1096
     1097Getting help:
     1098- When asking for help make sure to provide the following details:
     1099 * Modem make/model
     1100 * Output of lsusb showing modem
     1101 * Output of {{{mmcli --modem 0}}} to show detected modem details
     1102 * Output of {{{dmesg | egrep -ie qualcom\|mbim\|sierra\|wdm}}} to show driver messages
     1103 * Output of {{{uname -r}}} to show kernel version
     1104 * Output of {{{qmicli --version}}} and {{{mbimcli --version}}} to show what versions you have
     1105- for QMI: post to libqmi-devel with details
     1106 * Add Output of {{{qmicli --dms-get-{manufacturer,model,revision,capabilities} }}}
     1107     - revision is firmware
     1108     - capabilities shows if SIM is supported
     1109     - capabilities shows networks
     1110- for MBIM: post to libmbim-devel with details
     1111
     1112
     1113
     1114[=#openwrt]
     1115== OpenWrt Cellular Modem Support ==
     1116OpenWrt supports a wide range of cellular modems. Depending on the modem, a different software package / driver will be used:
     1117 * [#comgtpackage comgt] : Most GSM / 3G modems : Uses AT commands through the {{{comgt}}} package.
     1118 * [#uqmipackage uqmi] : Newer modems using Qualcomm chipsets : For modems that speak QMI (Quallcom MSM Interface) such as many of the 4G/LTE modems, use uqmi.
     1119
     1120
     1121[=#openwrt-comgt]
     1122=== comgt package ===
     1123The {{{comgt}}} package (http://comgt.sourceforge.net/) supports configuration of various cellular modems that use AT commands such as the Sierra Wireless, Novatel, and Option modems. This package supports startup scripts that are used for network interfaces specified with proto=3g. When a network interface is configured with proto=3g then the following things will occur when that interface is brought up (by virtue of {{{/lib/netifd/proto/3g.sh}}}):
     1124 1. the {{{gcom}}} app is used on the interface 'device' to determine what card is being used. Depending on the card and the service various AT commands may be sent for modem configuration.
     1125 2. the {{{chat}}} application application will run with a {{{chat}}} script (from {{{/etc/chatscripts}}}) which depends on the card type. This script is what connects to the network by using AT commands to specify the APN etc
     1126 3. The {{{pppd}}} daemon is run on the 'device' which creates a 'point to point' network interface (named 3g-<interface>) over the serial connection
     1127
     1128
     1129==== Example configurations ====
     1130UCI is a configuration system for OpenWrt. More information can be found [http://wiki.openwrt.org/doc/uci here]
     1131
     1132A modem must be configured in OpenWrt. The following uci properties are used by {{{comgt}}} and the 3g proto:
     1133 * proto - must be 3g
     1134 * device - the serial device (modem dependent) used for both data/control (used by {{{gcom}}}/{{{chat}}}/{{{pppd}}}).  Consult the modem information below to determine what device to use for your modem
     1135 * service - umts|cdma|evdo - the service type (which dictates the {{{chat}}} script used)
     1136 * apn - the APN of your provider
     1137 * pincode - the PIN (if required) to use your SIM
     1138
     1139Examples:
     1140 * An example configuration for a Sierra Wireless MC9870 3G UMTS modem (ie AT&T Carrier using the ISP.CINGULAR APN):
     1141{{{#!bash
     1142uci set network.wan=interface
     1143uci set network.wan.proto=3g
     1144uci set network.wan.service=umts
     1145uci set network.wan.apn=ISP.CINGULAR
     1146uci set network.wan.device=/dev/ttyUSB4
     1147uci commit network
     1148}}}
     1149  * Note that UMTS/GSM providers sometimes require a user and password. In this case the ppp scripts require this information in your network interface. If your user is 'user' and password is 'pass' you can set this via:
     1150{{{#!bash
     1151uci set network.wan.username=user
     1152uci set network.wan.password=pass
     1153}}}
     1154 * An example configuration for a Sierra Wireless MC5728 3G CDMA/EVDO modem (ie Sprint/Verizon Carriers):
     1155{{{#!bash
     1156uci set network.wan=interface
     1157uci set network.wan.proto=3g
     1158uci set network.wan.service=cdma
     1159uci set network.wan.device=/dev/ttyUSB0
     1160uci commit network
     1161}}}
     1162  * Note that CDMA/EVDO modules need to be 'activated' (one-time) before they can connect to he carrier's network. This is best done using the Windows software from the module vendor (For Verizon this is VZAccess Manager bundled with the CDMA Watcher drivers/application)
     1163 * An example configuration for a Sierra Wireless MC9870 3G UMTS modem (ie AT&T Carrier using the ISP.CINGULAR APN):
     1164{{{#!bash
     1165uci set network.wan=interface
     1166uci set network.wan.proto=3g
     1167uci set network.wan.service=umts
     1168uci set network.wan.apn=ISP.CINGULAR
     1169uci set network.wan.device=/dev/ttyUSB4
     1170uci commit network
     1171}}}
     1172 * An example configuration for a Sierra Wireless MC7700 LTE/HSPA+ Gobi modem (ie AT&T Carrier using the ISP.CINGULAR APN):
     1173{{{#!bash
     1174uci set network.wan=interface
     1175uci set network.wan.proto=3g
     1176uci set network.wan.service=umts
     1177uci set network.wan.apn=ISP.CINGULAR
     1178uci set network.wan.device=/dev/ttyUSB3
     1179uci commit network
     1180}}}
     1181 * An example configuration for an Option Module:
     1182{{{#!bash
     1183uci set network.wan=interface
     1184uci set network.wan.proto=3g
     1185uci set network.wan.service=umts
     1186uci set network.wan.apn=ISP.CINGULAR
     1187uci set network.wan.device=/dev/ttyHS5
     1188uci commit network
     1189}}}
     1190
     1191
     1192==== Using {{{gcom}}} to see things like: modem info, SIM state, and signal strength ====
     1193The {{{comgt}}} package has an application installed to {{{/usr/bin/gcom}}} that uses {{{chat}}} scripts installed in {{{/etc/gcom}}} to perform common tasks with supported 3G devices (assuming {{{/dev/ttyUSB3}}} is the control channel as in a MC8790):
     1194 * report SIM status, connection status, and signal quality:
     1195{{{#!bash
     1196# gcom -d /dev/ttyUSB3
     1197SIM ready
     1198Waiting for Registration..(120 sec max)
     1199Registered on Home network: "AT&T",2
     1200Signal Quality: 12,99
     1201}}}
     1202 * for Option GTM671WFS (on ttyHS3)
     1203{{{#!bash
     1204# gcom -d /dev/ttyHS3
     1205SIM ready
     1206Waiting for Registration..(120 sec max)
     1207Registered on Home network: "AT&T",2
     1208Signal Quality: 17,99
     1209}}}
     1210 * report just signal strength:
     1211{{{#!bash
     1212# gcom -d /dev/ttyUSB3 sig
     1213Signal Quality: 12,99
     1214}}}
     1215 * report card info (mfg strings):
     1216{{{#!bash
     1217# gcom -d /dev/ttyUSB3 info
     1218##### Wireless WAN Modem Configuration #####
     1219Product text:
     1220====
     1221
     1222Manufacturer: Sierra Wireless, Inc.
     1223Model: MC8790
     1224Revision: K1_0_2_8AP C:/WS/FW/K1_0_2_8AP/MSM6290/SRC 2008/09/17 14:00:22
     1225IMEI: 352974021856935
     1226IMEI SV: 3
     1227FSN: D661380183210
     12283GPP Release 6
     1229+GCAP: +CGSM,+DS,+ES
     1230OK
     1231====
     1232Manufacturer:           Sierra Wireless, Inc.
     1233IMEI and Serial Number: 352974021856935
     1234Manufacturer's Revision:
     1235K1_0_2_8AP C:/WS/FW/K1_0_2_8AP/MSM6290/SRC 2008/09/17 14:00:
     1236Hardware Revision:
     1237
     1238Network Locked:         0
     1239Customisation:
     1240
     1241Band settings:          (
     1242)
     1243APN:                    1,"IP","ISP.CINGULAR","0.0.0.0",0,0
     1244##### END #####
     1245}}}
     1246
     1247
     1248[=#uqmi]
     1249=== uqmi package ===
     1250Modems that speak the QMI protocol for configuration/connection require a driver such as qcserial that exposes the modem's serial interfaces, as well as the qmi_wwan driver, which exposes a network interface and a QMI interface, along with userspace tools that speak to the QMI interface.
     1251 * qcserial driver exposes the modem's serial interfaces
     1252 * qmi_wwan driver which exposes a network interface
     1253
     1254OpenWrt has a written the uqmi application from scratch which replaces the more bulky (~1.4MB) libqmi and also includes netifd protocol handler support (meaning you can use UCI for configuration).
     1255
     1256Known devices that use QMI (Note that some of these support both QMI or AT control via different firmware from Carriers):
     1257 * Sierra Wireless MC77xx series
     1258 * Sierra Wireless MC7354
     1259
     1260OpenWrt Packages:
     1261 * kmod-usb-serial-qualcomm - qcserial.ko
     1262 * kmod-usb-net-qmi-wwan - qmi_wwan.ko
     1263 * uqmi
     1264
     1265Notes:
     1266 * There is no luci web-admin protocol support for QMI currently which means you cannot configure a QMI modem via the web-admin
     1267
     1268
     1269==== Example QMI modem configurations ====
     1270* An example configuration for a Sierra Wireless MC7354 modem configured for AT&T UMTS (which is the 2nd wwan device):
     1271{{{#!bash
     1272uci set network.wan=interface
     1273uci set network.wan.ifname=wwan1
     1274uci set network.wan.proto=qmi
     1275uci set network.wan.apn=ISP.CINGULAR
     1276uci set network.wan.device=/dev/cdc-wdm1
     1277uci set network.wan.delay=90
     1278uci commit network
     1279}}}
     1280* The GSM/UMTS modem is the 2nd device ({{{/dev/wwan1}}}, {{{/dev/cdc/wdm1}}})
     1281* This modem needed a 90 second delay before trying to connect
     1282* Example {{{/etc/config/network}}} content for uqmi modem
     1283{{{#!bash
     1284config interface 'wan'
     1285        option ifname 'wwan1'
     1286        option proto 'qmi'
     1287        option apn 'ISP.CINGULAR'
     1288        option device '/dev/cdc-wdm1'
     1289        option delay '90'
     1290}}}
     1291
     1292==== uqmi usage and troubleshooting ====
     1293Examples:
     1294 * Check SIM status:
     1295{{{#!bash
     1296root@OpenWrt:/# uqmi -d /dev/cdc-wdm0 --get-pin-status
     1297{
     1298        "pin1_status": "disabled",
     1299        "pin1_verify_tries": 3,
     1300        "pin1_unblock_tries": 10,
     1301        "pin2_status": "not_verified",
     1302        "pin2_verify_tries": 10,
     1303        "pin2_unblock_tries": 10
     1304}
     1305}}}
     1306  - if you see a 'UIM uninitialized' you have a SIM issue such as SIM not inserted
     1307 * Check for available networks:
     1308{{{#!bash
     1309root@OpenWrt:/# uqmi -d /dev/cdc-wdm0 --get-serving-system
     1310{
     1311        "registration": "registered",
     1312        "plmn_mcc": 310,
     1313        "plmn_mnc": 260,
     1314        "plmn_description": "Project Fi",
     1315        "roaming": false
     1316}
     1317}}}
     1318  - above shows we are registered on the providers network (in this case Google Fi)
     1319 * Check data status:
     1320{{{#!bash
     1321root@OpenWrt:/# uqmi -d /dev/cdc-wdm0 --get-data-status
     1322"connected"
     1323}}}
     1324 * Get signal info:
     1325{{{#!bash
     1326root@OpenWrt:/# uqmi -d /dev/cdc-wdm0 --get-signal-info
     1327{
     1328        "type": "hdr",
     1329        "rssi": -125,
     1330        "ecio": 5,
     1331        "io": -106,
     1332        "type": "wcdma",
     1333        "rssi": -99,
     1334        "ecio": 19
     1335}
     1336}}}
     1337 * Scan networks:
     1338{{{#!bash
     1339root@OpenWrt:/# uqmi -d /dev/cdc-wdm0 --network-scan
     1340{
     1341        "network_info": [
     1342                {
     1343                        "mcc": 310,
     1344                        "mnc": 260,
     1345                        "description": "T-Mobile",
     1346                        "status": [
     1347                                "available",
     1348                                "home",
     1349                                "not_forbidden",
     1350                                "preferred"
     1351                        ]
     1352                },
     1353                {
     1354                        "mcc": 310,
     1355                        "mnc": 260,
     1356                        "description": "Project Fi",
     1357                        "status": [
     1358                                "current_serving",
     1359                                "home",
     1360                                "not_forbidden",
     1361                                "preferred"
     1362                        ]
     1363                },
     1364                {
     1365                        "mcc": 310,
     1366                        "mnc": 260,
     1367                        "description": "T-Mobile",
     1368                        "status": [
     1369                                "available",
     1370                                "home",
     1371                                "not_forbidden",
     1372                                "preferred"
     1373                        ]
     1374                },
     1375                {
     1376                        "mcc": 310,
     1377                        "mnc": 410,
     1378                        "description": "AT&T",
     1379                        "status": [
     1380                                "available",
     1381                                "roaming",
     1382                                "not_forbidden",
     1383                                "not_preferred"
     1384                        ]
     1385                },
     1386                {
     1387                        "mcc": 310,
     1388                        "mnc": 410,
     1389                        "description": "AT&T",
     1390                        "status": [
     1391                                "available",
     1392                                "roaming",
     1393                                "not_forbidden",
     1394                                "not_preferred"
     1395                        ]
     1396                },
     1397                {
     1398                        "mcc": 311,
     1399                        "mnc": 480,
     1400                        "description": "Verizon",
     1401                        "status": [
     1402                                "available",
     1403                                "roaming",
     1404                                "forbidden",
     1405                                "not_preferred"
     1406                        ]
     1407                },
     1408                {
     1409                        "mcc": 312,
     1410                        "mnc": 770,
     1411                        "description": "312-770",
     1412                        "status": [
     1413                                "available",
     1414                                "roaming",
     1415                                "forbidden",
     1416                                "not_preferred"
     1417                        ]
     1418                }
     1419        ],
     1420        "radio_access_technology": [
     1421                {
     1422                        "mcc": 310,
     1423                        "mnc": 260,
     1424                        "radio": "lte"
     1425                },
     1426                {
     1427                        "mcc": 310,
     1428                        "mnc": 260,
     1429                        "radio": "umts"
     1430                },
     1431                {
     1432                        "mcc": 310,
     1433                        "mnc": 260,
     1434                        "radio": "gsm"
     1435                },
     1436                {
     1437                        "mcc": 310,
     1438                        "mnc": 410,
     1439                        "radio": "lte"
     1440                },
     1441                {
     1442                        "mcc": 310,
     1443                        "mnc": 410,
     1444                        "radio": "umts"
     1445                },
     1446                {
     1447                        "mcc": 311,
     1448                        "mnc": 480,
     1449                        "radio": "lte"
     1450                },
     1451                {
     1452                        "mcc": 312,
     1453                        "mnc": 770,
     1454                        "radio": "lte"
     1455                }
     1456        ]
     1457}
     1458}}}
     1459 * Get current IP settings:
     1460{{{#!bash
     1461root@OpenWrt:/# uqmi -d /dev/cdc-wdm0 --get-current-settings
     1462{
     1463        "pdp-type": "ipv4",
     1464        "ip-family": "ipv4",
     1465        "mtu": 1430,
     1466        "ipv4": {
     1467                "ip": "25.232.251.49",
     1468                "dns1": "10.177.0.34",
     1469                "dns2": "10.177.0.210",
     1470                "gateway": "25.232.251.50",
     1471                "subnet": "255.255.255.252"
     1472        },
     1473        "ipv6": {
     1474
     1475        },
     1476        "domain-names": {
     1477
     1478        }
     1479}
     1480}}}
     1481  - note that some QMI modems use raw-ip and thus DHCP will not work. This command can be used to determine the IP settings provided by the provider
     1482
     1483If all is well, you will see your wwan interface with an IP address via ifconfig. If things don't work examine the logs to see what failed:
     1484{{{#!bash
     1485logread | grep qmi
     1486}}}
     1487
     1488You you see 'Unable to connect, check APN and authentication' in the log, then you either have an invalid APN or auth credentials or you need to increase the delay config parameter.
     1489
     1490
     1491[=#init-scripts]
     1492=== Additional init scripts for some devices ===
     1493Note that some devices require some additional manipulation to be used for cellular communications which the {{{comgt}}} scripts may not handle. In these cases you can create an init script to configure the device properly:
     1494 * typically USB dongles, require the 'setmode' application to be used to switch the devices from a USB Mass Storage device configuration to a 3G modem configuration
     1495 * some devices have AT commands that are required to take them out of low-power modes. For example, Sierra Wireless modems are shipped configured in low-power (airplane) mode. A startup script can be used to always set full power mode on bootup (Note: it appears this is just the way they are shipped - this setting is persistent so you should only need to set it once).
     1496
     1497The following shell commands will create an init script that will ensure a sierra wireless modem is taken out of 'Airplane' mode on bootup (assuming 'modem control' device is {{{/dev/ttyUSB3}}} - change appropriately for your device):
     1498{{{#!bash
     1499# set Modem data/control device in /etc/config/gpsd
     1500uci set network.wan.ctrl_device=/dev/ttyUSB3
     1501uci commit
     1502
     1503# create an init script that enables full power on bootup for all 3g devices
     1504cat << EOF > /etc/init.d/3g_power_enable
     1505#!/bin/sh /etc/rc.common
     1506
     1507START=80
     1508DEV=0
     1509
     1510start(){
     1511
     1512        include /lib/network
     1513        scan_interfaces
     1514
     1515        local ifc
     1516        for ifc in \$interfaces; do
     1517                local proto
     1518                config_get proto "\$ifc" proto
     1519                [ "\$proto" == "3g" ] && {
     1520                        local device
     1521                        config_get device "\$ifc" ctrl_device
     1522                        [ "\$device" -a -c "\$device" ] && {
     1523                                logger -t "3g" "Enabling full power mode for \$device"
     1524                                echo -e -n "at+cfun=1\015" > \$device
     1525                        }
     1526                }
     1527        done
     1528}
     1529chmod +x /etc/init.d/3g_power_enable
     1530/etc/init.d/3g_power_enable enable
     1531}}}
     1532
     1533
     1534[=#luci]
     1535=== LuCI Web-Admin Configuration for Cellular Cards ===
     1536The following instructions detail how to configure a cellular card using the LuCI web-admin:
     1537 1. Access the board's web interface. For instructions: [wiki:access Accessing the Web Interface]
     1538 2. Go to the Network tab, then the Interfaces tab.
     1539[[Image(modem1.jpg,800px)]]
     1540 3. Click on "Add new interface..." at the bottom left of the screen.
     1541 4. Name the interface. Here it is named "wan"
     1542 5. Check "Custom Interface" with nothing entered in the text box.
     1543[[Image(modem2.jpg,800px)]]
     1544 6. Under the Protocol field, select "UMTS/3G from the drop down menu.
     1545 7. Continue to fill out the remaining fields.
     1546[[Image(modem3.jpg,800px)]]
     1547 8. Click on Save & Apply at the bottom right of the screen.
     1548 9. Reboot the board. The modem should be woken up from the {{{/etc/init.d/3g}}} script a few seconds after the board boots.
     1549[[Image(modem4.jpg,800px)]]
     1550
     1551
     1552[=#usb-routing]
     1553== USB Routing Notes for Gateworks products ==
     1554Some of the Gateworks boards have options to physically route USB signals to either front-panel connectors (the default configured by the bootloader and/or kernel) or a PCI slot for use with a PCI-to-PCIe carrier for PCIe USB products like cellular modems.
     1555
     1556Please refer to the [wiki:USB#usb-devices Gateworks USB Device Table] and [wiki:USB#steering USB Steering] pages for details for each board.
     1557
     1558
     1559[=#sms]
     1560== Sending a SMS / Text Message ==
     1561Depending on the carrier and plan, SMS messages can be sent from Gateworks boards via a Cellular Modem.
     1562
     1563Gateworks has tested and verify this works sending to a normal handset.
     1564
     1565The example shown is using AT commands which could be turned into a script if desired.
     1566
     15671. Connect to the modem where you can send AT commands. For AT Command instructions, see here: [wiki:3g#ATCommands AT Commands]
     15682. Verify that your modem supports SMS messages by typing the following AT command. If you see '''+CMGF: (0-1)''' then it is supported.
     1569{{{#!bash
     1570at+cmgf=?
     1571+CMGF: (0-1)
     1572
     1573OK
     1574}}}
     15753. Switch the modem into SMS Message Sending mode:
     1576{{{#!bash
     1577AT+CMGF=1
     1578OK
     1579}}}
     15804. Enter the cellular number to send the SMS to as well as the message:
     1581{{{#!bash
     1582AT+CMGW="0661326109"
     1583
     1584> This is a test message from a Gateworks Single Board Computer sending SMS.
     1585>                    # hit ctrl+z to end SMS here
     1586
     1587+CMGW: 9
     1588}}}
     15895.  Note that after hitting ctrl+z CMGW shows a numerical number. This number is the ID of the SMS to be sent.
     15906. Send the SMS message with the following command, where the number matches the ID from Step 4&5
     1591{{{#!bash
     1592AT+CMSS=9
     1593OK
     1594}}}
     15957.  OK Should appear after hitting enter for the send command. If ok appears, please check receiving handset. The 'from' number will be from whatever number is registered with the SIM.
     1596
     1597
     1598
     1599== Specific Modem Notes ==
     1600
     1601[=#mtpcieh5]
     1602=== !MultiTech MTPCIe-H5 Modules (GSM/CDMA) ===
     1603The [http://www.multitech.com/en_US/PRODUCTS/Families/MultiConnectPCIe/ MTPCIe-H5] PCIe modules offer Agency Approved Cellular cards (this is important because it can save you a costly certification effort if you wish to embed 3G in your product). Please consult with Multitech to see which carriers are Agency Approved.
     1604
     1605Gateworks has tested a MTPCIe-H5 with an AT&T SIM in office and it works properly.
     1606
     1607Driver:
     1608 * cdc_acm driver (CONFIG_USB_ACM, cdc-acm.ko) exposes 7 tty devices:
     1609  * {{{/dev/ttyACM0}}} -
     1610  * {{{/dev/ttyACM1}}} -
     1611  * {{{/dev/ttyACM2}}} -
     1612  * {{{/dev/ttyACM3}}} - control/data
     1613  * {{{/dev/ttyACM4}}} -
     1614  * {{{/dev/ttyACM5}}} -
     1615  * {{{/dev/ttyACM6}}} -
     1616 * OpenWrt package support: kmod-usb-acm
     1617
     1618To configure, modify the {{{/etc/config/network}}} file to include the following:
     1619{{{#!bash
     1620config interface 'wan'
     1621        option proto '3g'
     1622        option service 'umts'
     1623        option apn 'ISP.CINGULAR'
     1624        option device '/dev/ttyACM3'
     1625
     1626}}}
     1627
     1628Antenna Connector Detail:
     1629{{{
     1630  |-------------------------|
     1631  |                         |=
     1632  | o Aux                   |=
     1633  |                         |=
     1634  | o CELL                  |=
     1635  |                         |=
     1636  | o GPS                   |=
     1637  |-------------------------|
     1638}}}
     1639
     1640Additional Documentation:
     1641 * ftp://ftp.multitech.com/docs/MT%20H5%20AT%20Commands/MT%20H5%20AT%20Commands.pdf - AT commands
     1642
     1643 * Note: The MultiTech MTPCIe-H5-V-BW module that has Wifi/Bluetooth is not compatible with the Gateworks boards because of their non-standard pinout.
     1644
     1645
     1646[=#sierra-wireless]
     1647=== Sierra Wireless Modems ===
     1648''' ****Please check with Sierra Wireless for availability and EOL status **** '''
     1649
     1650Commonly used Modules known to work on Gateworks products:
     1651 * MC8790/MC8790V UTMS/HSPA and quad-band GSM/GPRS/EDGE modem
     1652 * MC5728/MC5728V CDMA modem
     1653 * MC7700/MC77xx LTE/HSPA+ Gobi API modem with GPS
     1654 * MC8090/ HSPA+ and quad-band GSM/GPRS/EDGE modem
     1655
     1656'''General Notes:'''
     1657 * The 'V' version of the modules (ie MC8790V and MC5728V) support external audio in/out signals and interfaces (Handset/Headset/Car kit/Speakerphone/AUX/TTY) that the non-V modules do not.
     1658 * The 'V' version of the modules (ie MC8790V and MC5728V) use pin22 for an auxiliary voltage that must be between 0 and 2.6V. Pin22 however in the Mini-PCIe standard is PERST# (PCI reset) and thus depending on the board and socket will likely be driven or pulled up to 3.3V which will cause issues with these '-V' devices. See [#vaux1 below]
     1659 * The LED output (pin 42) indicates the module state according to the PCI-Express Mini Card specification:
     1660   * Off - module not powered
     1661   * On - module powered and connected but not transmitting or receiving
     1662   * slow blink - module powered and searching for a connection (250ms on at 0.2Hz)
     1663   * fast blink - module is transmitting or receiving (3Hz blink rate)
     1664
     1665The MC77xx Family provides:
     1666 * LTE,HSPA+,GSM/GPRS/EDGE,EV-DO Rev A (MC7750), 1xRTT (MC7750)
     1667 * 100mbps peak download rate
     1668 * 50mbps peek upload rate
     1669 * LTE:
     1670  * MC7700: 2100(B1), AWS(B4), 700(B17)
     1671  * MC7710: 2100(B1), 1800(B3), 2600(B7), 900(B8), 800(B20)
     1672  * MC7750: 700(B13)
     1673 * WCDMA:
     1674  * MC7700: 2100(B1), 1900(B2), 850(B5)
     1675  * MC7710: 2100(B1), 900(B8)
     1676 * CDMA 1xRTT/EV-DO Rev A:
     1677  * MC7750: 800(BC0), 1900(BC1)
     1678 * GSP/GPRS/EDGE:
     1679  * quad-band
     1680 * Refer to Sierra Wireless AirPrime MC Series documentation for more details
     1681
     1682
     1683[=#mc8790]
     1684==== MC8790 / MC8790V ====
     1685Driver:
     1686 * sierra - USB_SERIAL_SIERRAWIRELESS
     1687 * OpenWrt package support: kmod-usb-sierra
     1688 * exposes 7 serial devices:
     1689  * {{{/dev/ttyUSB0}}}
     1690  * {{{/dev/ttyUSB1}}}
     1691  * {{{/dev/ttyUSB2}}}
     1692  * {{{/dev/ttyUSB3}}} - control/data
     1693  * {{{/dev/ttyUSB4}}} - control/data
     1694  * {{{/dev/ttyUSB5}}} - control/data
     1695  * {{{/dev/ttyUSB6}}} - control/data
     1696  * {{{/dev/ttyUSB7}}}
     1697
     1698Notes:
     1699 * power mode - The MC8970/MC8970V has a power-mode setting to put the card in 'low-power' (aka 'airplane') mode where the module is active but RF is disabled. These cards seem to ship configured for 'airplane' mode (CFUN=0).  The setting is persistent and must be set via the AT+CFUN command at least once:
     1700{{{#!bash
     1701AT+CFUN?
     1702+CFUN: 0
     1703
     1704OK
     1705AT+CFUN=1
     1706OK
     1707}}}
     1708  * CFUN=0 is low power mode or 'airplane' mode where RF is disabled
     1709  * CFUN=1 is full power mode
     1710 * if {{{gcom -d /dev/ttyUSB3 info}}} reports 'Network locked: 1' then your module is locked to a network carrier's specific plan and can only be used with a SIM for that network carriers plan. Take care to use the right SIM plan or to purchase an unlocked or 'generic' module.
     1711
     1712 * OpenWrt Sample Config:
     1713{{{#!bash
     1714config interface 'wan'
     1715        option proto '3g'
     1716        option apn 'internet'
     1717        option device '/dev/ttyUSB3'
     1718        option service 'utms'
     1719}}}
     1720
     1721
     1722[=#mc8090]
     1723==== MC8090 ====
     1724Driver:
     1725 * sierra - USB_SERIAL_SIERRAWIRELESS
     1726 * OpenWrt package support: kmod-usb-sierra
     1727 * exposes 6 serial devices:
     1728  * {{{/dev/ttyUSB0}}}
     1729  * {{{/dev/ttyUSB1}}}
     1730  * {{{/dev/ttyUSB2}}}
     1731  * {{{/dev/ttyUSB3}}}
     1732  * {{{/dev/ttyUSB4}}} - data (ppp)
     1733  * {{{/dev/ttyUSB5}}} - control (AT commands)
     1734
     1735
     1736[=#mc7700]
     1737==== MC7700 / MC7710 ====
     1738AirPrime 3G/4G/LTE wireless module
     1739
     1740Carrier:
     1741 * MC7700 (US)
     1742  * AT&T
     1743  * NTT Docomo
     1744  * Bell
     1745  * Tellus
     1746  * Roger
     1747 * MC7710:
     1748  * T-Mobile
     1749
     1750Driver:
     1751 * sierra - USB_SERIAL_SIERRAWIRELESS
     1752 * OpenWrt package support: kmod-usb-sierra
     1753 * exposes 5 serial devices:
     1754  * {{{/dev/ttyUSB0}}}
     1755  * {{{/dev/ttyUSB1}}}
     1756  * {{{/dev/ttyUSB2}}}
     1757  * {{{/dev/ttyUSB3}}} - control (AT commands)
     1758  * {{{/dev/ttyUSB4}}} - control/data
     1759
     1760Known USB IDs:
     1761 * 1199:68a3 (Shows up as MC8700 Modem in {{{lsusb}}}, but this is an error in the usb id file and does not relate to drivers)
     1762
     1763References:
     1764 * [http://www.sierrawireless.com/en/productsandservices/AirPrime_Wireless_Modules/Essential_Modules/MC_Series.aspx Product Brief]
     1765 * [http://www.sierrawireless.com/en/productsandservices/AirPrime_Wireless_Modules/Essential_Modules/~/media/Data%20Sheet/AirPrime_datasheets/Sierra_Wireless_AirPrime_MC_Series_Intelligent_Embedded_Modules.ashx Datasheet]
     1766
     1767
     1768[=#mc7750]
     1769==== MC7750 ====
     1770!AirPrime 3G/4G/LTE wireless module
     1771
     1772Carrier:
     1773 * MC7750 (US)
     1774  * Verizon
     1775
     1776Bands:
     1777 * LTE: 700MHz(B13)
     1778 * CDMA 1xRTT/EV-DO Rev A: 800MHz(BC0), 1900MHz(BC1)
     1779
     1780This card uses the QMI protocol (Qualcomm MSM Interface) for modem/connection - see [wiki:3g#uqmipackage uqmi]
     1781
     1782Drivers:
     1783 * qcserial (CONFIG_USB_SERIAL_QUALCOMM) exposes serial interfaces:
     1784  * {{{/dev/ttyUSB0}}} - management
     1785  * {{{/dev/ttyUSB1}}} - GPS (NMEA)
     1786  * {{{/dev/ttyUSB2}}} - modem
     1787 * qmi_wwan (USB_NET_QMI_WWAN) exposes network interface and QMI interface:
     1788  * {{{/dev/cdc-wdm0}}} - QMI - use with libqmi
     1789  * {{{/sys/class/net/wwan0}}}
     1790
     1791GPS:
     1792 * To enable NMEA messages on {{{/dev/ttyUSB1}}}:
     1793{{{#!bash
     1794stty raw -F /dev/ttyUSB1; echo \$GPS_START >/dev/ttyUSB1
     1795}}}
     1796 * To disable NMEA messages on {{{/dev/ttyUSB1}}}:
     1797{{{#!bash
     1798stty raw -F /dev/ttyUSB1; echo \$GPS_STOP >/dev/ttyUSB1
     1799}}}
     1800
     1801References:
     1802 * [http://www.sierrawireless.com/en/productsandservices/AirPrime_Wireless_Modules/Essential_Modules/MC_Series.aspx Product Brief]
     1803 * [http://www.sierrawireless.com/en/productsandservices/AirPrime_Wireless_Modules/Essential_Modules/~/media/Data%20Sheet/AirPrime_datasheets/Sierra_Wireless_AirPrime_MC_Series_Intelligent_Embedded_Modules.ashx Datasheet]
     1804
     1805
     1806[=#mc7354]
     1807==== MC7354 ====
     1808!AirPrime 3G/4G/LTE wireless module - One design for global markets - Multi-carrier support
     1809
     1810Details:
     1811 * LTE,HSPA+,GSM/GPRS/EDGE,EV-DO Rev A, 1xRTT
     1812 * 100mbps peak download rate
     1813 * 50mbps peak upload rate
     1814 * USB 2.0 High Speed
     1815 * -40C to +85C
     1816
     1817Carriers:
     1818 * Verizon (CDMA/LTE)
     1819 * AT&T (UMTS)
     1820 * Sprint
     1821
     1822Bands:
     1823 * LTE: 1900(B2), AWS(B4), 850(B5), 700(B13), 700(B17), 1900(B25)
     1824 * WCDMA: 2100(B1), 1900(B2), AWS(B4), 850(B5), 900(B8)
     1825 * CDMA 1xRTT/EV-DO Rev A: 800MHz(BC0), 1900MHz(BC1), 1700(BC10)
     1826 * GSM/GPRS/EDGE: Quad-Band
     1827
     1828This card uses the QMI protocol (Qualcomm MSM Interface) for modem/connection - see [wiki:3g#uqmipackage uqmi]
     1829
     1830Drivers:
     1831 * qcserial (CONFIG_USB_SERIAL_QUALCOMM) exposes serial interfaces:
     1832  * {{{/dev/ttyUSB0}}} - management (QMI)
     1833  * {{{/dev/ttyUSB1}}} - GPS (NMEA)
     1834  * {{{/dev/ttyUSB2}}} - modem data
     1835 * qmi_wwan (USB_NET_QMI_WWAN) exposes network interface and QMI interface:
     1836  * {{{/dev/cdc-wdm0}}} - control (QMI)
     1837  * {{{/dev/cdc-wdm1}}} - control (QMI) for GSM
     1838  * {{{/dev/cdc-wdm2}}} - control (QMI)
     1839  * {{{/sys/class/net/wwan0}}}
     1840  * {{{/sys/class/net/wwan1}}} - data for GSM
     1841  * {{{/sys/class/net/wwan2}}}
     1842
     1843Modem:
     1844For using with GSM, please use these lines inside the /etc/config/network file.
     1845{{{#!bash
     1846config 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}}}
     1853
     1854GPS:
     1855 * To enable NMEA messages on {{{/dev/ttyUSB1}}}:
     1856{{{#!bash
     1857stty raw -F /dev/ttyUSB1; echo \$GPS_START >/dev/ttyUSB1
     1858}}}
     1859 * To disable NMEA messages on {{{/dev/ttyUSB1}}}:
     1860{{{#!bash
     1861stty raw -F /dev/ttyUSB1; echo \$GPS_STOP >/dev/ttyUSB1
     1862}}}
     1863
     1864References:
     1865 * [http://www.sierrawireless.com/en/productsandservices/AirPrime_Wireless_Modules/Essential_Modules/MC_Series.aspx Product Brief]
     1866 * [http://www.sierrawireless.com/en/productsandservices/AirPrime_Wireless_Modules/Essential_Modules/~/media/Data%20Sheet/AirPrime_datasheets/Sierra_Wireless_AirPrime_MC_Series_Intelligent_Embedded_Modules.ashx Datasheet]
     1867
     1868
     1869[=#mc7455]
     1870==== MC7455 ====
     1871
     1872 ** WARNING: This modem is ** NOT ** well supported **
     1873
     1874!AirPrime MC 4G LTE Cat-6, Cat-3 / 3G Fallback wireless module - One design for America/EMEA - Multi-carrier support
     1875
     1876Bands:
     1877 * LTE-A: B1-B5, B7, B8, B12, B13, B20, B25, B26, B29, B30, B41
     1878 * LTE-FDD, LTE-TDD HSPA+
     1879
     1880 * This modem is ** NOT ** well supported
     1881  * Different firmware on the modem either puts the modem into QMI or MBIM mode, determined [#troubleshooting here]
     1882  * Depending on firmware, modem may not be supported on Gateworks OpenWrt 16.02 with 4.4 kernel
     1883 * This modem supports USB 3.0 which is **NOT** available on the Ventana Mini-PCIe pins
     1884  * Read more in discussion forum regarding pinout here: https://forum.sierrawireless.com/viewtopic.php?f=117&t=9636&p=38401#p38401
     1885  * USB 3.0 pins 23, 25, 31 and 33 are for USB 3.0 and are sometimes masked on the modem
     1886 * USB ID:  1199:9071 & 1199:9070
     1887 * The second SIM pins on the modem, (11 & 13) are not supported by Gateworks boards
     1888 * Customer provided commands if USB ID is missing:
     1889   {{{
     1890echo '1199 9071' > /sys/bus/usb-serial/drivers/option1/new_id  (for generic USB driver)
     1891echo '1199 9071' > /sys/bus/usb-serial/drivers/sierra/new_id (for sierra usb-serial)
     1892echo '1199 9071' > /sys/bus/usb/drivers/qmi_wwan/new_id (for Qualcomm qmi)
     1893   }}}
     1894
     1895 * Software Drivers:
     1896  * qcserial
     1897  * qmi_wwan
     1898  * cdc_mbim * Depending on firmware
     1899  * usbserial
     1900  * usbcore
     1901
     1902
     1903Software Drivers:
     1904 * qcserial (CONFIG_USB_SERIAL_QUALCOMM) exposes serial interfaces:
     1905  * {{{/dev/ttyUSB0}}}
     1906  * {{{/dev/ttyUSB1}}}
     1907  * {{{/dev/ttyUSB2}}}
     1908 * qmi_wwan (USB_NET_QMI_WWAN) exposes network interface and QMI interface:
     1909  * {{{/dev/cdc-wdm0}}}
     1910  * {{{/dev/cdc-wdm1}}}
     1911  * {{{/sys/class/net/wwan0}}}
     1912  * {{{/sys/class/net/wwan1}}}
     1913
     1914
     1915Software utilties:
     1916 * libqmi-1.17.901 or newer
     1917 * libmbim 1.15.0 (1.14.0+ required) * Depending on firmware
     1918
     1919Kernel version:
     1920 * Typically requires 4.10 or higher
     1921
     1922References:
     1923 * [https://source.sierrawireless.com/devices/mc-series/mc7455/ Sierra Wireless]
     1924
     1925
     1926
     1927[=#mc5828]
     1928==== MC5828 / MC5728V ====
     1929Driver:
     1930 * exposes 4 serial devices:
     1931  * {{{/dev/ttyUSB0}}} - control/data
     1932  * {{{/dev/ttyUSB1}}} -
     1933  * {{{/dev/ttyUSB2}}} -
     1934  * {{{/dev/ttyUSB3}}} -
     1935
     1936
     1937[=#gtm671wfs]
     1938=== (EOL) Option Globetrotter Multi-function Modules (GSM/CDMA/WiFi/GPS/uSD) GTM671WFS EOL ===
     1939This module is EOL - End of life.
     1940
     1941The [http://www.option.com/en/products/products/ Option Globetrotter modules] provide multi-function capability including GSM, CDMA, WiFi (ath9k 11abgn 1x1), GPS, uSD, and local SIM carrier all in one module.
     1942
     1943Driver:
     1944 * hso (CONFIG_USB_HSO) exposes 6 serial ports:
     1945  * {{{/dev/ttyHS0}}} - Diagnostic (proprietary Option)
     1946  * {{{/dev/ttyHS1}}} - GPS (ie for {{{gpsd}}})
     1947  * {{{/dev/ttyHS2}}} - GPS Control
     1948  * {{{/dev/ttyHS3}}} - Application (proprietary Option)
     1949  * {{{/dev/ttyHS4}}} - control (ie for {{{gcom}}})
     1950  * {{{/dev/ttyHS5}}} - control/data (ie for ppp)
     1951 * OpenWrt package: usb-net-hso
     1952
     1953USB ID:
     1954 * 0af0:9200
     1955
     1956GPS:
     1957 * For GPS you need to use some AT commands (over {{{/dev/ttyHS2}}}) to enable NMEA messages (over {{{/dev/ttyHS1}}}). The following shell commands will accomplish this:
     1958{{{#!bash
     1959echo -e -n "AT_OGPSMODE=1\015" > /dev/ttyHS2
     1960echo -e -n "AT_OGPS=2\015" > /dev/ttyHS2
     1961}}}
     1962 * You should then be able to see the GPS on {{{/dev/ttyHS1}}}:
     1963{{{#!bash
     1964stty -F /dev/ttyHS1 9600
     1965cat /dev/ttyHS1
     1966}}}
     1967 * or use screen:
     1968{{{#!bash
     1969screen /dev/ttyHS1 9600,cs8
     1970}}}
     1971
     1972The Option GTM671WFS contains 4 U.FL antenna connections for cellular, wifi and GPS.
     1973
     1974Here is the location for these (looking at top of card with PCIe edge fingers to right)
     1975
     1976{{{
     1977  |-------------------------|
     1978  | o Cellular Main         |=
     1979  |                         |=
     1980  | o 802.11 aux            |=
     1981  |                         |=
     1982  | o Cellular Aux/GPS      |=
     1983  |                         |=
     1984  | o 802.11 main           |=
     1985  |-------------------------|
     1986}}}
     1987
     1988To insert the SIM card in the Option's SIM carrier, you slide the top to lock/unlock the metal top cover (see picture).
     1989
     1990[[Image(Option_SIM.jpg,100px)]]
     1991
     1992Troubleshooting:
     1993 * If the SIM is not registered, configured correctly or the data plan has expired/run out of data, the console output will show the following error message indicating that a connection has not been established with the carrier.
     1994{{{#!bash
     1995root@OpenWrt:/# [62.860000] usb 1-1: hso received invalid serial state notification
     1996}}}
     1997
     1998
     1999[=#mu609]
     2000=== Huawei MU609 ===
     2001Driver:
     2002 * option.ko (CONFIG_USB_SERIAL_OPTION) exposes 6 serial ports:
     2003  * {{{/dev/ttyUSB0}}} - modem (ie for qcom)
     2004  * {{{/dev/ttyUSB1}}} -
     2005  * {{{/dev/ttyUSB2}}} - AT Commands
     2006  * {{{/dev/ttyUSB3}}} -
     2007 * OpenWrt package: usb-serial-option
     2008
     2009USB ID:
     2010 * 12d1:1573: Huawei Technologies:HUAWEI Mobile
     2011
     2012{{{lsusb}}} output:
     2013{{{#!bash
     201412d1:1573 Huawei Technologies Co., Ltd.
     2015
     2016usb 2-1: New USB device found, idVendor=12d1, idProduct=1573
     2017usb 2-1: New USB device strings: Mfr=5, Product=4, SerialNumber=0
     2018usb 2-1: Product: HUAWEI Mobile
     2019usb 2-1: Manufacturer: Huawei Technologies
     2020}}}
     2021
     2022OpenWrt {{{/etc/config/network}}}:
     2023{{{#!bash
     2024config interface 'wan'
     2025        option proto '3g'
     2026        option service 'umts'
     2027        option apn 'ISP.CINGULAR'
     2028        option device '/dev/ttyUSB0'
     2029}}}
     2030
     2031Link [http://consumer.huawei.com/en/solutions/m2m-solutions/products/tech-specs/mu609mini-pcie-en.htm]
     2032
     2033
     2034[=#sim5360]
     2035=== Simcom SIM5360E ===
     2036 ***Evaluation***
     2037
     2038 * ID 05c6:9000 Qualcomm, Inc.
     2039 * SIMCom SIM5218 modem
     2040  * {{{/dev/ttyUSB0}}} -
     2041  * {{{/dev/ttyUSB1}}} -
     2042  * {{{/dev/ttyUSB2}}} -  AT Commands
     2043  * {{{/dev/ttyUSB3}}} -  AT Commands
     2044  * {{{/dev/cdc-wdm0}}}
     2045
     2046 * USB ID [http://lxr.free-electrons.com/source/drivers/usb/serial/option.c?v=3.14#L1036]
     2047
     2048
     2049=== Nimbelink NL-SW-LTE-TSVG / Telit LE910-SVG ===
     2050
     2051*** Still in testing, contact support@gateworks.com ***
     2052
     2053 * Details
     2054  * 4G LTE CAT 3
     2055  * Pre-Certified Verizon Modem
     2056  * 100Mbps download and 50Mbps upload speeds
     2057 * Carriers
     2058  * USA : Verizon
     2059 * USB ID 1bc7:1201 Telit Wireless Solutions
     2060
     2061Drivers:
     2062 * option.ko (CONFIG_USB_SERIAL_OPTION) exposes 5 serial ports:
     2063  * {{{/dev/ttyUSB0}}} - qcdm
     2064  * {{{/dev/ttyUSB1}}} - at
     2065  * {{{/dev/ttyUSB2}}} -
     2066  * {{{/dev/ttyUSB3}}} - at
     2067  * {{{/dev/ttyUSB4}}} -
     2068 * qmi_wwan (USB_NET_QMI_WWAN) exposes network interface and QMI interface:
     2069  * {{{/dev/cdc-wdm0}}} - control (QMI)
     2070
     2071Links:
     2072 *[http://nimbelink.com/skywire-cellular-modem-lte/]
     2073
     2074
     2075[=#troubleshooting]
     2076== Troubleshooting ==
     2077Here are some troubleshooting tips with regards to cellular modems:
     2078 * Make sure your modem is being recognized on the USB bus with {{{lsusb}}}
     2079  - if not, check that the USB bus is correctly steered to the miniPCIe socket the modem is installed in (see the [wiki:USB#steering USB Steering] wiki page)
     2080  - make sure the modem supports USB 2.0
     2081  - check the modem pinout and ensure that it is compatible with PCIe signalling if used on a miniPCIe socket with PCIe (Sierra Wireless -V modems can not have the PERST# signal at 3p3V - see [#vaux1 here])
     2082 * Does your modem require a driver or driver update that is not available in the Linux kernel version you are using?
     2083  - a {{{lsusb}}} will show the Vendor ID and Product ID of your device which typically need to match known ID's in drivers (some newer devices match USB class ID's and are more forgiving)
     2084  - look at the kernel messages from the {{{dmesg}}} command for messages that might indicate a modem is not supported or lack of a known driver supporting that device. Most modem drivers will create a number of 'tty' devices in /dev/tty* - if you see no messages about this you may be missing driver support.
     2085 * Make sure no other processes are interacting with your M2M device communication ports (ie mis-configured {{{gpsd}}})
     2086 * Is your GSM module locked to a Carrier/Network/SIM/PIN? - if so you have to unlock it (if possible/allowed)
     2087 * Is your module in low-power / airplane mode?
     2088 * Can you not send AT commands to a card? Try hotswapping the card
     2089 * Is your modem a Sierra Wireless *-V modem with Voice audio capabilities? See [#vaux1 below]
     2090 * Have you specified the correct APN for your GSM module? - Your carrier can provide you with the proper APN
     2091 * Are you using the correct serial device? - most modules provide several, not all of which can be used with {{{pppd}}}/{{{chat}}}/{{{gcom}}}
     2092 * Is your CDMA/EVDO module 'activated'? - you may need to do this on a Windows system with vendor-supplied application/drivers
     2093 * Issue a reset command to the card when starting up (varies by card)
     2094{{{#!bash
     2095[ -e /dev/ttyUSBX ] && echo -e -n "AT~RESET\015" > /dev/ttyUSBX
     2096}}}
     2097
     2098
     2099For low level troubleshooting it may be useful to use a serial comm program (such as {{{screen}}}) to connect to the M2M device control port and issue AT commands directly:
     2100 * AT+CREG? will return your network registration state: 0 - registered to home network, 1 - roaming, -1 not registered
     2101 * AT+COPS? will return the operator selection: <mode>[,<format>,<operator>
     2102
     2103See http://ernstagn.home.xs4all.nl/GPRS-HOWTO/GPRS-HOWTO.html for more info
     2104
     2105General Reference:
     2106 * AT Commands (Note GSM 07.07, GSM 07.05, V.25ter and T.32 specifications can be obtained from http://www.etsi.org or http://www.3gpp.org)
     2107 * [[http://www.sierrawireless.com/Support/Downloads/AirPrime/SL_Series/~/media/Support_Downloads/AirPrime/Software/2130617%20AirCard-AirPrime%20Supported%20AT%20Commands%20v4.ashx AT Command Reference for AirCard-AirPrime Modems]]
     2108 * http://www.canarysystems.com/nsupport/CDMA_AT_Commands.pdf
     2109
     2110
     2111[=#vaux1]
     2112=== Sierra Wireless Voice Audio Modem conflicts with PERST# ===
     2113Sierra Wireless modems with the 'V' at the end of the part number have added audio capabilities that provide a differential MIC input (pins 1,3) and differential SPK output (pins 5,6). These cards require that Pin 22  (AUXV1) Auxiliary Voltage 1 analog input needing to be 0 to 2.6V. Because Pin 22 is used for PERST# (PCI Reset) on sockets with a PCI bus this can cause compatibility issues.
     2114
     2115The documentation on this is sparse in the Sierra Wireless tech specs however from what we've found if this is pulled up to 3.3V it causes 'unexpected issues' with the card (likely caused by voltage backfeed).
     2116
     2117You may find that you can't use these modems without either:
     2118 a) Disable PCI on the board if not needed and drive the pin low (contact support@gateworks.com with the model of the board you are using and what socket you want to use it in to see if this is possible)
     2119 b) Disabling the PERST# (contact support@gateworks.com with the model of the board you are using and what socket you want to use it in to see if this is possible).
     2120 c) Mask off the pin on the card or cut the trace on the card
     2121
     2122[=#at]
     2123=== AT Commands ===
     2124Many cellular modems use AT commands for control. Examples shown on this page are a quick and easy way to issue commands, however, no responses can be seen. While many model and brands use similar AT commands you need to contact the modem vendor or search the Internet for a complete list for that particular brand and model.
     2125
     2126To get to a console where AT commands and their responses can be seen, a serial program needs to be used, such as minicom or screen.
     2127
     2128For AT commands, the correct port must be used. It will be one of the enumerated ports such as {{{/dev/ttyUSB0}}}, {{{/dev/ttyUSB1}}}, {{{/dev/ttyUSB2}}}, {{{/dev/ttyUSB3}}}, etc
     2129{{{#!bash
     2130screen /dev/ttyUSB3
     2131}}}
     2132
     2133This will open a window where one can start typing AT commands. Example shown below:
     2134{{{#!bash
     2135at+cgmi
     2136Sierra Wireless, Incorporated
     2137
     2138OK
     2139at+cgmm
     2140MC7700
     2141
     2142OK
     2143at+csq
     2144ERROR
     2145
     2146}}}
     2147
     2148To send AT Commands from the Linux Shell, use echo with -e -n and terminate with \015. Example below:
     2149{{{#!bash
     2150echo -e -n "at+cfun=1\015" > /dev/ttyUSB3
     2151}}}
     2152
     2153
     2154[=#reset-via-at]
     2155==== Resetting a Modem with AT Commands ====
     2156The following AT commands can be used to perform a soft reset on particular modems:
     2157 * ZTE:
     2158{{{#!bash
     2159AT+ZRST
     2160}}}
     2161 * Sierra Wireless:
     2162{{{#!bash
     2163AT!RESET
     2164}}}
     2165  or
     2166{{{#!bash
     2167AT+CFUN=1,1
     2168}}}
     2169 * Huawei and others:
     2170{{{#!bash
     2171AT+CFUN=4
     2172AT+CFUN=6
     2173}}}
     2174
     2175Consult your modem documentation for AT commands for that device and firmware.
     2176
     2177[=#reset-sim]
     2178=== Reset for SIM Read ===
     2179Most Modem firmware will only check a SIM on power-up. If a SIM is activated or inserted after the cellular card is powered, the cellular may need to be re-powered or re-initialized to recognize the SIM. While each modem likely has a unique way to do this via an AT command, a QMI command, or an MBIM command resetting the modem is always another option.
     2180
     2181Refer to the [wiki:USB#reset USB reset] wiki page for details on how to do this on various boards and miniPCIe sockets.
     2182
     2183
     2184[=#testing]
     2185=== Testing a Connection ===
     2186A quick way to verify the module has connected up to the cellular carrier
     2187and has received an IP address is to run the ifconfig command from the Linux console.
     2188The following is an example output, note the 3g-wan entry, this will not show up if
     2189a connection has not been established. In this example 32.177.140.183 is the IP address.
     2190Once a connection is established, you should also be able to ping to the internet.
     2191
     2192{{{#!bash
     2193root@OpenWrt:/# ifconfig
     21943g-wan    Link encap:Point-to-Point Protocol
     2195          inet addr:32.177.140.183  P-t-P:10.64.64.64  Mask:255.255.255.255
     2196          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
     2197          RX packets:70 errors:0 dropped:0 overruns:0 frame:0
     2198          TX packets:72 errors:0 dropped:0 overruns:0 carrier:0
     2199          collisions:0 txqueuelen:3
     2200          RX bytes:5842 (5.7 KiB)  TX bytes:5000 (4.8 KiB)
     2201
     2202br-lan    Link encap:Ethernet  HWaddr 00:0C:E3:70:DA:17
     2203          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
     2204          inet6 addr: fe80::20c:e3ff:fe70:da17/64 Scope:Link
     2205          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
     2206          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
     2207          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
     2208          collisions:0 txqueuelen:0
     2209          RX bytes:0 (0.0 B)  TX bytes:408 (408.0 B)
     2210
     2211eth0      Link encap:Ethernet  HWaddr 00:D0:12:56:EE:6A
     2212          UP BROADCAST MULTICAST  MTU:1500  Metric:1
     2213          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
     2214          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
     2215          collisions:0 txqueuelen:1000
     2216          RX bytes:0 (0.0 B)  TX bytes:168 (168.0 B)
     2217
     2218lo        Link encap:Local Loopback
     2219          inet addr:127.0.0.1  Mask:255.0.0.0
     2220          inet6 addr: ::1/128 Scope:Host
     2221          UP LOOPBACK RUNNING  MTU:16436  Metric:1
     2222          RX packets:61 errors:0 dropped:0 overruns:0 frame:0
     2223          TX packets:61 errors:0 dropped:0 overruns:0 carrier:0
     2224          collisions:0 txqueuelen:0
     2225          RX bytes:6044 (5.9 KiB)  TX bytes:6044 (5.9 KiB)
     2226
     2227mon.wlan0 Link encap:UNSPEC  HWaddr 00-0C-E3-70-DA-17-00-00-00-00-00-00-00-00-00-00
     2228          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
     2229          RX packets:1 errors:0 dropped:0 overruns:0 frame:0
     2230          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
     2231          collisions:0 txqueuelen:32
     2232          RX bytes:145 (145.0 B)  TX bytes:0 (0.0 B)
     2233
     2234wlan0     Link encap:Ethernet  HWaddr 00:0C:E3:70:DA:17
     2235          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
     2236          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
     2237          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
     2238          collisions:0 txqueuelen:32
     2239          RX bytes:0 (0.0 B)  TX bytes:772 (772.0 B)
     2240
     2241root@OpenWrt:/# ping google.com
     2242PING google.com (74.125.224.71): 56 data bytes
     224364 bytes from 74.125.224.71: seq=0 ttl=51 time=176.596 ms
     224464 bytes from 74.125.224.71: seq=1 ttl=51 time=166.074 ms
     224564 bytes from 74.125.224.71: seq=2 ttl=51 time=155.902 ms
     2246^C
     2247--- google.com ping statistics ---
     22483 packets transmitted, 3 packets received, 0% packet loss
     2249round-trip min/avg/max = 155.902/166.190/176.596 ms
     2250}}}
     2251
     2252
     2253[=#sim]
     2254== SIM Card use on PCI Express form-factor modems ==
     2255PCI Express form-factor GSM Modems require SIM (Subscriber Identity Module) cards in order to connect to the providers network. There are several different methods for accessing SIM cards depending on hardware:
     2256 * Some modems have a SIM slot on them (ie [wiki:3g#OptionGlobetrotterMulti-functionModulesGSMCDMAWiFiGPSuSD Option Globetrotter])
     2257 * Others use sideband signals on the PCIe connector that route to an external SIM slot:
     2258  * The GW17005 can be used with these however it is not recommended in an environment with shock and vibe
     2259  * The [wiki:3g#GW17005Instructions GW16038/GW16062] carriers can be used in specific slots of the Gateworks Avila, Cambria, Laguna product families.
     2260  * The [http://shop.gateworks.com/index.php?route=product/product&product_id=146&search=gw16103=GW16103 GW16103] Mini-PCIe SIM, uSD and USB expansion board can be used to provide SIM support for boards with Mini-PCIe sockets.
     2261
     2262
     2263=== MiniPCI to Mini-PCIe Multiple SIM Card Access ===
     2264Gateworks has several mini-PCI to PCI Express Mini Card adapters specifically designed for PCI Express Mini Card Standard GSM/GPRS/EDGE/UMTS/HSPA wireless radio modules on the Avila, Cambria, Laguna platforms:
     2265 * [http://shop.gateworks.com/index.php?route=product/search&search=GW16049 GW16049] - USB routed, No SIM connectors (Can't be used for GSM Modules)
     2266 * [http://shop.gateworks.com/index.php?route=product/search&search=GW16038 GW16038] - USB routed, has SIM connectors
     2267 * [http://shop.gateworks.com/index.php?route=product/search&search=GW16059 GW16059] - PCIe and USB routed, No SIM connectors (Can't be used for GSM Modules)
     2268 * [http://shop.gateworks.com/index.php?route=product/search&search=GW16062 GW16062] - PCIe and USB routed, has SIM connectors
     2269 * [http://shop.gateworks.com/index.php?route=product/search&search=GW17005 GW17005] - SIM carrier for cellular cards without SIM or boards with PCIe slots (ie. GW2380, GW23882, GW2383, GW2391)
     2270
     2271The GW16038/GW16062 carriers have 3 SIM connector sites (labeled USIMA, USIMB, USIMC) which can be selected depending on jumper position and software controlled GPIO steering. Jumper block W1 can set SEL0/SEL1 signals low/high or GPIO controlled. The card selection is shown in a table on the PCB silkscreen. You can set the jumpers to a specific SIM connector or allow 2 GPIO signals from the baseboard to select the location (useful for example in a product that needs to select a specific SIM based on other criteria such as geographic location).
     2272
     2273Note that the GSMSEL0 and GSMSEL1 GPIO's differ per board which can be found in the board's User Manual but are summarized here for convenience:
     2274 * Laguna GW2388-x (Bottom MiniPCI socket J4):
     2275  * GPIO7 - GSMSEL0
     2276  * GPIO8 - GSMSEL1
     2277 * Laguna 2382
     2278  * Turn on USB by enabling GPIO10 as noted in the troubleshooting section above [#Troubleshooting:]
     2279 * Cambria GW2358-x (Bottom MiniPCI socket J8):
     2280  * GPIO10 - GSMSEL0
     2281  * GPIO11 - GSMSEL1
     2282 * Avila (Bottom MiniPCI socket J4):
     2283  * GPIO2 - GSMSEL0
     2284  * GPIO1 - GSMSEL1
     2285
     2286Examples:
     2287 * Laguna GW2388 using bottom-right miniPCI socket for GSM radio - select SIM site:
     2288{{{#!bash
     2289echo 1 > /sys/class/gpio/gpio7/value; echo 1 > /sys/class/gpio/gpio8/value  ;# sel SELE1/SEL0 1,1 for SIMC
     2290echo 1 > /sys/class/gpio/gpio7/value; echo 0 > /sys/class/gpio/gpio8/value  ;# sel SELE1/SEL0 1,0 for SIMB
     2291echo 0 > /sys/class/gpio/gpio7/value; echo 1 > /sys/class/gpio/gpio8/value  ;# sel SELE1/SEL0 0,1 for SIMA
     2292echo 0 > /sys/class/gpio/gpio7/value; echo 0 > /sys/class/gpio/gpio8/value  ;# sel SELE1/SEL0 0,0 for None
     2293}}}
     2294
     2295Images:
     2296 * GW16062 showing SIM card insertion
     2297[[Image(16062.JPG,400px)]]
     2298 * GW16038 showing SIM card selection jumper block
     2299[[Image(20131029_083627.jpg,400px)]]
     2300
     2301
     2302[=#gw17005]
     2303=== GW17005 Instructions ===
     2304The GW17005 provides a SIM card connector on a flex-cable which can inserted into the MiniPCI Express connector slot with the cellular modem. This may not be suitable for high shock and vibe environments.
     2305
     2306[[Image(gw17005.jpg,200px)]]
     2307
     2308
     2309== Other Helpful Links ==
     2310 * [http://m2msupport.net/m2msupport/search-page/?Form!Factor=PCIe A M2M site for looking at modems]
     2311 * [http://www.att.com/edo/mmt/matching-tools-form.jsp AT&T Module Picker]
     2312 * [http://http://ei.att.com/modules/ATT_Approved_3G_4G_Modules.xlsx AT&T Reference Sheet]