wiki:wireless/modem

Version 2 (modified by Chris Lang, 7 years ago) ( diff )

--


M2M 3G / 4G support on Gateworks products (GSM/GPRS/EDGE/UMTS/HSPA)

  1. M2M 3G / 4G support on Gateworks products (GSM/GPRS/EDGE/UMTS/HSPA)
    1. Carrier Approval / Certification
    2. Recommended Modems
    3. Modem Firmware
    4. Modem Terminology
    5. Modem Control
      1. AT commands
      2. Mobile Interface Broadband Model (MBIM)
      3. Qualcomm MSM Interface (QMI)
        1. Link Protocols
        2. IP Family
        3. Client ID
      4. Gateworks BSP Support
    6. Linux Drivers
    7. Ubuntu Cellular Modem Support (libqmi/libmbim/modemmanager)
      1. libmbim
      2. libqmi
        1. Command Line Examples
      3. ModemManager
      4. NetworkManager
      5. Installing pre-built latest stable libqmi/libmbim/modemmanager via PPA
      6. Building libqmi/libmbim/modemmanager from source
      7. Troubleshooting Modem support on Ubuntu
    8. OpenWrt Cellular Modem Support
      1. comgt package
        1. Example configurations
        2. Using gcom to see things like: modem info, SIM state, and signal …
      2. uqmi package
        1. Example QMI modem configurations
        2. uqmi usage and troubleshooting
      3. Additional init scripts for some devices
      4. LuCI Web-Admin Configuration for Cellular Cards
    9. USB Routing Notes for Gateworks products
    10. Sending a SMS / Text Message
    11. Specific Modem Notes
      1. MultiTech MTPCIe-H5 Modules (GSM/CDMA)
      2. Sierra Wireless Modems
        1. MC8790 / MC8790V
        2. MC8090
        3. MC7700 / MC7710
        4. MC7750
        5. MC7354
        6. MC7455
        7. MC5828 / MC5728V
      3. (EOL) Option Globetrotter Multi-function Modules …
      4. Huawei MU609
      5. Simcom SIM5360E
      6. Nimbelink NL-SW-LTE-TSVG / Telit LE910-SVG
    12. Troubleshooting
      1. Sierra Wireless Voice Audio Modem conflicts with PERST#
      2. AT Commands
        1. Resetting a Modem with AT Commands
      3. Reset for SIM Read
      4. Testing a Connection
    13. SIM Card use on PCI Express form-factor modems
      1. MiniPCI to Mini-PCIe Multiple SIM Card Access
      2. GW17005 Instructions
    14. Other Helpful Links

M2M 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.

You will find below many examples and setup instructions for many devices Gateworks has qualified.

Please check with Sierra Wireless for availability and EOL status.

M2M 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.

As a general rule, you need to have obtained the following from your Service Provider to use M2M devices in linux:

  • GSM modems:
    • A SIM card and the following details:
      • APN - Access Point Name
      • unlocked - or you need the PIN to unlock it (the SIM must not be locked to another device)
      • username - often optional but may be required by your provider
      • password - often optional but may be required by your provider
  • UMTS modems:
    • 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)

This 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.

Gateworks SBCs can be viewed at the following link: http://www.gateworks.com

http://trac.gateworks.com/raw-attachment/wiki/OpenWrt/wireless/relayd/gw5100realsmall.png

Carrier Approval / Certification

Production 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.

FCC Certification should be considered as well.

The 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.

Products that use USA cellular networks typically need to be certified with the network.

Some Mini-PCIe modems are pre-certified, however the product as a whole (enclosure, SBC, antenna) may still need to be certified.

Gateworks recommends contacting the network provider of choice for more information.

Additional links:

Recommended Modems

Gateworks has modems they recommend based on their experience and compatibility with their devices.

Modem Firmware

Modems 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.

Often 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.

Qualcomm's QMI based modems can update their firmware using libqmi-firmware

Modem Terminology

  • 3G : 3G has an average speed of around 1Mb/s
  • 4G : 4th Generation of mobile communications technology meeting requirements defined by ITU (International Telecommunications Union) in IMT Advanced. LTE or WiMax.
  • LTE : (Long Term Evolution) - Considered 4G.
  • HSPA+ :High Speed Packet Access Plus - Considered 3G. theoretical top speed of 21Mb/s. Average is around 4Mb/s.
  • 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.

Modem Control

Unlike 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:

  • Dialing - in the old days for dial-up modems
  • SIM pin control and unlocking (security)
  • Network provider registration
  • Data Protocol selection

Once all of the above is complete a modem driver will provide a network interface to the Linux OS:

  • IP over ethernet
  • raw IP
  • IP over serial (sometimes via PPP daemon)

And 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)

Over the years various different modem control protocols have been developed:

  • AT commands (text commands and responses typically preceded by 'AT' and terminated with a CR (carriage return or 0x0d)
  • QMI - Qualcomm Modem Interface (A binary protocol used for modern Qualcomm based modems)
  • 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

AT commands

If 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.

You 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).

Modems 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).

Some examples (assuming /dev/ttyUSB0 is your modem's control interface)

  • screen
    screen /dev/ttyUSB0 57600
    
  • minicom
    minicom --device /dev/ttyUSB0 --baudrate 57600
    
  • picocom
    picocom /dev/ttyUSB0 --baud 57600
    
  • stty/cat/echo:
    stty -F /dev/ttyUSB0 ignbrk -brkint -icrnl -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke
    cat /dev/ttyUSB0 &
    echo -e "ATI\n" > /dev/ttyUSB0
    

Mobile Interface Broadband Model (MBIM)

Mobile 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.

See also:

Qualcomm MSM Interface (QMI)

The Qualcomm MSM Interface (QMI) is a modem control protocol that appears in many modern Qualcomm based modems.

QMI defines different services:

  • DMS: Device Management - load device info
  • NAS: Network Access - register in the network
  • WDS: - request data connections
  • PDS: - setup GPS location reporting
  • UIM: - manage internals of the user identity module

See also:

Link Protocols

QMI modems support multiple link protocols:

  • 802-3: wraps IP packets within Ethernet frames (similar to an Ethernet device) like traditional modems
  • raw-ip: does away with the Ethernet layer and provides raw IP frames which is more efficient and allows higher throughput, but disallows things that rely on 802-3 such as DHCP

Some QMI modem/firmware/SIM combinations support 802-3 only, others support raw-ip only, and some support both. It is important to make sure the driver and the network device are configured to use the same link protocol.

IP Family

QMI modem/firmware/SIM combinations can support IPv4, IPv6, or both IP families. If you are trying to connect and receive an error related to IP family check that your asking for something supported.

Client ID

To use QMI services you need a 'Client ID' or CID. The CID's can be created then released when they are no longer needed. When working with sessions the CID is what allows QMI services to be operated on the right session. Both libqmi and uqmi userspace applications allow you to issue QMI commands by using an existing specified CID and to not release CID upon completion. It is important to use this when configuring and starting connections. For example, you can have an ipv4 session concurrent with an ipv6 session, each must have their own CID that is not released (until the connection is closed) and must be used when referring to those sessions.

When using qmicli}} you do this with the {{{--client-cid=<cid> and the --client-no-release-cid options.

When using uqmi you obtain a client-id with the --get-client-id option and use an existing one with the --get-client-id option and release a CID with the ---release-client-id option.

Gateworks BSP Support

Gateworks supports multiple Board Support Packages. The following table shows details on modem support for each:

BSP Product Families AT QMI MBIM Drivers Notes
Android Ventana No No No None See Freescale information
Yocto Ventana manual No No Minimal
OpenWrt All comgt uqmi umbim Many
Ubuntu Ventana ModemManager libqmi libmbim Many https://wiki.ubuntu.com/ConnMan/Hardware/3G
Debian Ventana ModemManager libqmi libmbim Many https://wiki.debian.org/Modem/3G

If you are looking for additional support please contact support@…

Linux Drivers

There are several Linux kernel drivers used for modem technology. You should enable all of these depending on your device needs:

  • qcserial / USB_SIERIAL_QUALCOMM - Provides serial tty devices for Qualcomm modems
  • sierra / USB_SERIAL_SIERRAWIRELESS - Provides serial tty devices for Sierra Wireless modems
  • option / USB_SERIAL_OPTION - USB driver for GSM and CDMA modems with built-in OHCI-USB adapter (Option, Huawei, Audiovox, Novatel, Anydata)
  • sierra_net / USB_SIERRA_NET - USB-to-WWAN driver for Sierra Wireless modems
  • cdc-acm / USB_ACM - USB Modem (CDC ACM) support
  • qmi_wwan / USB_NET_QMI_WWAN - QMI WWAN driver for Qualcomm modems based on QMI (Qualcomm Messaging Interface)
  • cdc_mbim / USB_NET_CDC_MBIM - CDC MBIM support: Provides support for CDC MBIM (Mobile Broadband Interface modem) devices.

These all depend on the following Kernel features:

  • NETDEVICES=y
  • USB_NET_DRIVERS=y
  • USB_USBNET=y
  • USB_SERIAL

Ubuntu Cellular Modem Support (libqmi/libmbim/modemmanager)

Ubuntu Linux systems utilize the following opensource projects for modem control and management:

  • libmbim
  • libqmi
  • modemmanager
  • networkmanager

libmbim

The 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

Useful Examples:

  • show status (useful for verifying SIM):
    mbimcli --device /dev/cdc-wdm0 --query-subscriber-ready-status # should show "Ready state: 'initialized'"
    
  • radio state (should show 'on')
    mbimcli --device /dev/cdc-wdm0 --query-radio-state # should show on
    
    • if not use '--set-radio-state=on'
  • enable FCCAuth (required on many Sierra Wireless devices)
    qmicli --device /dev/cdc-wdm0 --device-open-proxy --device-open-mbim --dms-set-fcc-authentication
    
  • verify signal state:
    mbimcli --device /dev/cdc-wdm0 --device-open-proxy --query-signal-state # RSSI=99 is no signal
    
  • Network
    mbimcli --device /dev/cdc-wdm0 --device-open-proxy --query-preferred-providers
    mbimcli --device /dev/cdc-wdm0 --device-open-proxy --query-home-provider
    mbimcli --device /dev/cdc-wdm0 --device-open-proxy --query-visible-providers
    mbimcli --device /dev/cdc-wdm0 --device-open-proxy --query-registration-state
    [/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'
    
  • connect:
    • using mbim-network
      root@ventana:~# echo "APN=h2g2" > /etc/mbim-network.conf # specify APN
      root@ventana:~# echo "PROXY=yes" >> /etc/mbim-network.conf # allow ports to be shared by multiple libmbim apps
      root@ventana:~# mbim-network /dev/cdc-wdm0 start
      Loading profile at /etc/mbim-network.conf...
          APN: h2g2
          APN auth protocol: unset
          APN user: unset
          APN password: unset
          mbim-proxy: no
      Querying subscriber ready status 'mbimcli -d /dev/cdc-wdm0 --query-subscriber-ready-status --no-close '...
      [/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'
      Saving state at /tmp/mbim-network-state-cdc-wdm0... (TRID: 3)
      Querying registration state 'mbimcli -d /dev/cdc-wdm0 --query-registration-state --no-open=3 --no-close '...
      [/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'
      Saving state at /tmp/mbim-network-state-cdc-wdm0... (TRID: 4)
      Attaching to packet service with 'mbimcli -d /dev/cdc-wdm0 --attach-packet-service --no-open=4 --no-close '...
      Saving state at /tmp/mbim-network-state-cdc-wdm0... (TRID: 5)
      Starting network with 'mbimcli -d /dev/cdc-wdm0 --connect=apn='h2g2' --no-open=5 --no-close '...
      Network started successfully
      Saving state at /tmp/mbim-network-state-cdc-wdm0... (TRID: 7)
      
    • or manually
      mbimcli --device /dev/cdc-wdm0 --device-open-proxy --connect=apn='h2g2' --no-open=5 --no-close
      

Notes:

  • 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

References:

libqmi

The 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.

Command Line Examples

If 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!):

  • SIM details (UIM service):
    root@ventana:~# qmicli -d /dev/cdc-wdm0 --uim-get-card-status
    [/dev/cdc-wdm0] Successfully got card status
    Provisioning applications:
            Primary GW:   slot '0', application '0'
            Primary 1X:   session doesn't exist
            Secondary GW: session doesn't exist
            Secondary 1X: session doesn't exist
    Card [0]:
            Card state: 'present'
            UPIN state: 'not-initialized'
                    UPIN retries: '0'
                    UPUK retries: '0'
            Application [0]:
                    Application type:  'usim (2)'
                    Application state: 'ready'
                    Application ID:
                            A0:00:00:00:87:10:02:FF:FF:FF:FF:89:06:19:00:00
                    Personalization state: 'ready'
                    UPIN replaces PIN1: 'no'
                    PIN1 state: 'disabled'
                            PIN1 retries: '3'
                            PUK1 retries: '10'
                    PIN2 state: 'enabled-not-verified'
                            PIN2 retries: '10'
                            PUK2 retries: '10'
            Application [1]:
                    Application type:  'isim (5)'
                    Application state: 'detected'
                    Application ID:
                            A0:00:00:00:87:10:04:FF:FF:FF:FF:89:07:03:00:00
                    Personalization state: 'unknown'
                    UPIN replaces PIN1: 'no'
                    PIN1 state: 'disabled'
                            PIN1 retries: '3'
                            PUK1 retries: '10'
                    PIN2 state: 'not-initialized'
                            PIN2 retries: '0'
                            PUK2 retries: '0'
    
  • Signal strength:
    root@ventana:~# qmicli -d /dev/cdc-wdm0 --nas-get-signal-info
    [/dev/cdc-wdm0] Successfully got signal info
    WCDMA:
            RSSI: '-96 dBm'
            ECIO: '-12.0 dBm'
    root@ventana:~# qmicli -d /dev/cdc-wdm0 --nas-get-signal-strength
    [/dev/cdc-wdm0] Successfully got signal strength
    Current:
            Network 'umts': '-96 dBm'
    RSSI:
            Network 'umts': '-96 dBm'
    ECIO:
            Network 'umts': '-11.0 dBm'
    IO: '-106 dBm'
    SINR (8): '9.0 dB'
    
  • Network details (NAS service):
    root@ventana:~# qmicli -d /dev/cdc-wdm0 --nas-get-system-selection-preference
    [/dev/cdc-wdm0] Successfully got system selection preference
            Emergency mode: 'no'
            Mode preference: 'umts, lte'
            Band preference: 'wcdma-2100, wcdma-pcs-1900, wcdma-dcs-1800, wcdma-1700-us, wcdma-850-us, wcdma-900'
            LTE band preference: '1, 2, 3, 4, 5, 7, 8, 12, 13, 20, 25, 41'
            TD-SCDMA band preference: '(null)'
            Roaming preference: 'any'
            Network selection preference: 'automatic'
            Service domain preference: 'cs-ps'
            Service selection preference: 'automatic'
    root@ventana:~# qmicli -d /dev/cdc-wdm0 --nas-network-scan
    [/dev/cdc-wdm0] Successfully scanned networks
    Network [0]:
            MCC: '310'
            MNC: '260'
            Status: 'available, home, not-forbidden, preferred'
            Description: 'T-Mobile'
    Network [1]:
            MCC: '310'
            MNC: '260'
            Status: 'current-serving, home, not-forbidden, preferred'
            Description: 'Project F'
    Network [2]:
            MCC: '312'
            MNC: '770'
            Status: 'available, roaming, not-forbidden, not-preferred'
            Description: '312 770'
    Network [3]:
            MCC: '310'
            MNC: '410'
            Status: 'available, roaming, not-forbidden, not-preferred'
            Description: 'AT&T'
    Network [4]:
            MCC: '310'
            MNC: '410'
            Status: 'available, roaming, not-forbidden, not-preferred'
            Description: 'AT&T'
    Network [5]:
            MCC: '311'
            MNC: '480'
            Status: 'available, roaming, forbidden, not-preferred'
            Description: 'Verizon'
    Network [0]:
            MCC: '310'
            MNC: '260'
            RAT: 'lte'
    Network [1]:
            MCC: '310'
            MNC: '260'
            RAT: 'umts'
    Network [2]:
            MCC: '312'
            MNC: '770'
            RAT: 'lte'
    Network [3]:
            MCC: '310'
            MNC: '410'
            RAT: 'lte'
    Network [4]:
            MCC: '310'
            MNC: '410'
            RAT: 'umts'
    Network [5]:
            MCC: '311'
            MNC: '480'
            RAT: 'lte'
    Network [0]:
            MCC: '310'
            MNC: '260'
            MCC with PCS digit: 'yes'
    Network [1]:
            MCC: '310'
            MNC: '260'
            MCC with PCS digit: 'yes'
    Network [2]:
            MCC: '312'
            MNC: '770'
            MCC with PCS digit: 'yes'
    Network [3]:
            MCC: '310'
            MNC: '410'
            MCC with PCS digit: 'yes'
    Network [4]:
            MCC: '310'
            MNC: '410'
            MCC with PCS digit: 'yes'
    Network [5]:
            MCC: '311'
            MNC: '480'
            MCC with PCS digit: 'yes'
    root@ventana:~# qmicli -d /dev/cdc-wdm0 --nas-get-operator-name
    [/dev/cdc-wdm0] Successfully got operator name data
    PLMN List:
            MCC/MNC: '310-DDD' LAC Range: 0->65279  PNN Record: 1
            MCC/MNC: '311-DDD' LAC Range: 0->65279  PNN Record: 1
            MCC/MNC: '312-DDD' LAC Range: 0->65279  PNN Record: 1
            MCC/MNC: '313-DDD' LAC Range: 0->65279  PNN Record: 1
            MCC/MNC: '314-DDD' LAC Range: 0->65279  PNN Record: 1
            MCC/MNC: '315-DDD' LAC Range: 0->65279  PNN Record: 1
            MCC/MNC: '316-DDD' LAC Range: 0->65279  PNN Record: 1
    PLMN Names:
            0: 'Project Fi' ('Project Fi')          Country: 'initials-do-not-add'
    root@ventana:~# qmicli -d /dev/cdc-wdm0 --nas-get-serving-system
    [/dev/cdc-wdm0] Successfully got serving system:
            Registration state: 'registered'
            CS: 'attached'
            PS: 'attached'
            Selected network: '3gpp'
            Radio interfaces: '1'
                    [0]: 'umts'
            Roaming status: 'off'
            Data service capabilities: '3'
                    [0]: 'hsdpa'
                    [1]: 'hsupa'
                    [2]: 'wcdma'
            Current PLMN:
                    MCC: '310'
                    MNC: '260'
                    Description: 'Project Fi'
            Roaming indicators: '1'
                    [0]: 'off' (umts)
            3GPP location area code: '26289'
            3GPP cell ID: '85367600'
            Detailed status:
                    Status: 'available'
                    Capability: 'cs-ps'
                    HDR Status: 'none'
                    HDR Hybrid: 'no'
                    Forbidden: 'no'
            Call barring status:
                    Circuit switched: 'all-calls'
                    Packet switched: 'all-calls'
            UMTS primary scrambling code: '61'
            Full operator code info:
                    MCC: '310'
                    MNC: '260'
                    MNC with PCS digit: 'yes'
    root@ventana:~# qmicli -d /dev/cdc-wdm0 --nas-get-home-network
    [/dev/cdc-wdm0] Successfully got home network:
            Home network:
                    MCC: '310'
                    MNC: '260'
                    Description: 'Project F'
    root@ventana:~# qmicli -d /dev/cdc-wdm0 --nas-get-system-info
    [/dev/cdc-wdm0] Successfully got system info:
            WCDMA service:
                    Status: 'available'
                    True Status: 'available'
                    Preferred data path: 'no'
                    Domain: 'cs-ps'
                    Service capability: 'cs-ps'
                    Roaming status: 'off'
                    Forbidden: 'no'
                    Location Area Code: '26289'
                    Cell ID: '85367600'
                    MCC: '310'
                    MNC: '260'
                    HS call status: 'hsdpa-hsupa-unsupported'
                    HS service: 'hsdpa-hsupa-supported'
                    Primary scrambling code: '61'
                    Cell broadcast support: 'off'
                    Call barring status (CS): 'all-calls'
                    Call barring status (PS): 'all-calls'
                    Cipher Domain: 'none'
            LTE service:
                    Status: 'none'
                    True Status: 'none'
                    Preferred data path: 'no'
            SIM reject info: 'available'
    
  • Configure Link Protocol:
    root@ventana:~# qmicli -p -d /dev/cdc-wdm0 --wda-set-data-format=802-3 # set data format (raw-ip/802-3)
    root@ventana:~# qmicli -p -d /dev/cdc-wdm0 --set-expected-data-format=802-3 # set expected format, should match above
    
    • Make sure you choose a link protocol (802-3 or raw-ip) that is compatible with your modem/firmware/SIM
  • Connect to Google Fi network (WDS service):
    root@ventana:~# echo "APN=h2g2" > /etc/qmi-network.conf # specify APN
    root@ventana:~# echo "PROXY=yes" >> /etc/qmi-network.conf # allow ports to be shared by multiple libqmi apps
    root@ventana:~# qmi-network /dev/cdc-wdm0 start
    Loading profile at /etc/qmi-network.conf...
        APN: h2g2
        APN user: unset
        APN password: unset
        qmi-proxy: no
    Checking data format with 'qmicli -d /dev/cdc-wdm0 --wda-get-data-format --device-open-proxy'...
    Device link layer protocol retrieved: raw-ip
    Getting expected data format with 'qmicli -d /dev/cdc-wdm0 --get-expected-data-format'...
    Expected link layer protocol retrieved: 802-3
    Updating kernel link layer protocol with 'qmicli -d /dev/cdc-wdm0 --set-expected-data-format=raw-ip'...
    Kernel link layer protocol updated
    Starting network with 'qmicli -d /dev/cdc-wdm0 --wds-start-network=apn='h2g2'  --client-no-release-cid '...
    Saving state at /tmp/qmi-network-state-cdc-wdm0... (CID: 35)
    Saving state at /tmp/qmi-network-state-cdc-wdm0... (PDH: 62482624)
    Network started successfully
    
  • Configuring IP:
    • If your modem/firmware/SIM combination supports 802-3 link protocol and is configured to do so, you can use DHCP:
      root@ventana:~# dhclient wwan0
      
    • or, you can use -wds-get-current-settings to obtain the settings provided to the conneciton from the carrier and configure them manually. Take care to use the same client-cid that was returned from the -wds-start-network command and to not release the client-id:
      root@ventana:~# qmicli --device /dev/cdc-wdm0 --client-no-release-cid --client-cid=35 --wds-get-current-settings
      [/dev/cdc-wdm0] Current settings retrieved:
                 IP Family: IPv4
              IPv4 address: 100.69.157.123
          IPv4 subnet mask: 255.255.255.248
      IPv4 gateway address: 100.69.157.124
          IPv4 primary DNS: 10.177.0.34
        IPv4 secondary DNS: 10.177.0.210
                       MTU: 1500
                   Domains: none
      [/dev/cdc-wdm0] Client ID not released:
              Service: 'wds'
                  CID: '35'
      root@ventana:~# ifconfig wwan0 100.69.157.123 netmask 255.255.255.248
      root@ventana:~# route add default gw 100.69.157.124 wwan0
      root@ventana:~# echo "nameserver 10.177.0.34" > /etc/resolv.conf
      root@ventana:~# echo "nameserver 10.177.0.210" >> /etc/resolv.conf
      root@ventana:~# ping www.google.com
      

Troubleshooting QMI connection issues:

  • make sure you are using a Link Protocol compatible with your modem/firmware/SIM
  • make sure you are using an IP Family compatible with your modem/firmware/SIM
  • don't use DHCP if its not supported by your carrier or if your not using the 802-3 link protocol - instead use 'wds-get-current-settings' and manually configure the interface
  • make sure you are not releasing the Client ID when connecting to the network

Firmware related commands:

  • Show firmware versions
    root@ventana:~# qmicli -d /dev/cdc-wdm0 --dms-get-firmware-preference
    firmware preference successfully retrieved:
    [image 0]
            Image type: 'modem'
            Unique ID:  '005.010_001'
            Build ID:   '05.05.16.02_ATT'
    [image 1]
            Image type: 'pri'
            Unique ID:  '005.010_001'
            Build ID:   '05.05.16.02_ATT'
    
  • update firmware:
    root@ventana:~/mc7354/firmware# qmi-firmware-update --update -d 1199:68c0 9999999_9902196_SWI9X15C_05.05.58.00_00_ATT_005.026_000-field.spk
    loading device information before the update...
    setting firmware preference:
      firmware version: '05.05.58.00'
      config version:   '005.026_000'
      carrier:          'ATT'
    rebooting in download mode...
    download mode detected
    downloading cwe image: 9999999_9902196_SWI9X15C_05.05.58.00_00_ATT_005.026_000-field.spk (34.8 MB)...
    finalizing download... (may take more than one minute, be patient)
    successfully downloaded in 11.31s (3.1 MB/s)
    rebooting in normal mode...
    normal mode detected
    
    ------------------------------------------------------------------------
        NOTE: in order to validate which is the firmware running in the
        module, the program will wait for a complete boot; this process
        may take some time and several retries.
    ------------------------------------------------------------------------
    
    waiting some time for the device to boot...
    loading device information after the update (1/12)...
    waiting some time for the device to boot...
    loading device information after the update (2/12)...
    waiting some time for the device to boot...
    loading device information after the update (3/12)...
    
    ------------------------------------------------------------------------
    
       original firmware revision was:
          SWI9X15C_05.05.16.02 r21040 carmd-fwbuild1 2014/03/17 23:49:48
       original running firmware details:
          Model: MC7354
          Boot version: SWI9X15C_05.05.16.02 r21040 carmd-fwbuild1 2014/03/17 23:49:48
          AMSS version: SWI9X15C_05.05.16.02 r21040 carmd-fwbuild1 2014/03/17 23:49:48
          SKU ID: 1102016
          Package ID: 1102016_9903211_SWI9X15C_05.05.16.02_00_Generic_005.006_000
          Carrier ID: 4
       original firmware preference details:
          image 'modem': unique id '005.010_001', build id '05.05.16.02_ATT'
          image 'pri': unique id '005.010_001', build id '05.05.16.02_ATT'
    
       new firmware revision is:
          SWI9X15C_05.05.58.00 r27038 carmd-fwbuild1 2015/03/04 21:30:23
       new running firmware details:
          Model: MC7354
          Boot version: SWI9X15C_05.05.58.00 r27038 carmd-fwbuild1 2015/03/04 18:38:46
          AMSS version: SWI9X15C_05.05.58.00 r27038 carmd-fwbuild1 2015/03/04 21:30:23
          SKU ID: 1102016
          Package ID: 1102016_9903211_SWI9X15C_05.05.16.02_00_Generic_005.006_000
          Carrier ID: 4
       new firmware preference details:
          image 'modem': unique id '005.026_000', build id '05.05.58.00_ATT'
          image 'pri': unique id '005.026_000', build id '05.05.58.00_ATT'
    
       NOTE: this device supports firmware preference management
       with qmicli operations:
          --dms-get-firmware-preference
          --dms-set-firmware-preference
    
    ------------------------------------------------------------------------
    
    firmware update operation finished successfully
    

References:

ModemManager

ModemManager is a package containing a background service/daemon and a command-line-interfalce (mmcli) that can be used to configure and connect modems.

Note that after starting the service (if manually started) it does take 20 to 30 seconds to finish modem detection.

Example usage:

  • List detected modems
    root@ventana:~# mmcli --list-modems
    
    No modems were found
    
    root@ventana:~# mmcli --list-modems
    
    Found 1 modems:
            /org/freedesktop/ModemManager1/Modem/0 [Sierra Wireless, Incorporated] MC7455
    
    
  • Show details for the first modem:
    root@ventana:~# mmcli --modem 0
    
    /org/freedesktop/ModemManager1/Modem/0 (device id '86bde2905ff6f63bbefcfa457fe8f9221b76e968')
      -------------------------
      Hardware |   manufacturer: 'Sierra Wireless, Incorporated'
               |          model: 'MC7455'
               |       revision: 'SWI9X30C_02.08.02.00 r5428 CARMD-EV-FRMWR2 2016/01/06 20:38:53'
               |      supported: 'gsm-umts
               |                  lte
               |                  gsm-umts, lte'
               |        current: 'gsm-umts, lte'
               |   equipment id: '359072060290422'
      -------------------------
      System   |         device: '/sys/devices/soc0/soc/2100000.aips-bus/2184200.usb/ci_hdrc.1/usb1/1-1/1-1.2'
               |        drivers: 'qmi_wwan, qcserial'
               |         plugin: 'Sierra'
               |   primary port: 'cdc-wdm0'
               |          ports: 'ttyUSB0 (qcdm), ttyUSB2 (at), cdc-wdm0 (qmi), wwan0 (net), wwan1 (net), cdc-wdm1 (qmi)'
      -------------------------
      Numbers  |           own : '18057812000'
      -------------------------
      Status   |           lock: 'sim-pin2'
               | unlock retries: 'sim-pin (3), sim-pin2 (10), sim-puk (10), sim-puk2 (10)'
               |          state: 'disabled'
               |    power state: 'on'
               |    access tech: 'unknown'
               | signal quality: '0' (cached)
      -------------------------
      Modes    |      supported: 'allowed: 2g, 3g, 4g; preferred: none'
               |        current: 'allowed: 2g, 3g, 4g; preferred: none'
      -------------------------
      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'
               |        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'
      -------------------------
      IP       |      supported: 'ipv4, ipv6, ipv4v6'
      -------------------------
      3GPP     |           imei: '359072060290555'
               |  enabled locks: 'none'
               |    operator id: 'unknown'
               |  operator name: 'unknown'
               |   subscription: 'unknown'
               |   registration: 'unknown'
      -------------------------
      SIM      |           path: '/org/freedesktop/ModemManager1/SIM/0'
    
      -------------------------
      Bearers  |          paths: 'none'
    
    
    • 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
  • 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>
    root@ventana:~# mmcli --pin=1234
    successfully sent PIN code to the SIM
    
    • 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 (Personal unblocking code) SIM.
  • Enable first modem:
    root@ventana:~# mmcli --modem 0 --enable
    successfully enabled the modem
    
    • Now a status will show the following different info under status
        -------------------------
        Status   |           lock: 'sim-pin2'
                 | unlock retries: 'sim-pin (3), sim-pin2 (10), sim-puk (10), sim-puk2 (10)'
                 |          state: 'registered'
                 |    power state: 'on'
                 |    access tech: 'umts'
                 | signal quality: '26' (recent)
      
      
  • Scan available networks:
    root@ventana:~# mmcli --modem 0 --3gpp-scan --timeout=300
    
    Found 5 networks:
    310410 - AT&T (umts, available)
    310410 - AT&T (lte, available)
    310260 - T-Mobile (gsm, available)
    310260 - Project Fi (umts, current)
    310260 - T-Mobile (lte, available)
    
  • Connect modem (example: Google Fi)
    root@ventana:~# mmcli --modem 0 --simple-connect="apn=h2g2"
    successfully connected the modem
    
  • Get IP Configuration:
    root@ventana:~# mmcli --modem 0 | grep Bearers
      Bearers  |          paths: '/org/freedesktop/ModemManager1/Bearer/0'
    root@ventana:~# mmcli --bearer 0
    Bearer '/org/freedesktop/ModemManager1/Bearer/0'
      -------------------------
      Status             |   connected: 'yes'
                         |   suspended: 'no'
                         |   interface: 'wwan0'
                         |  IP timeout: '20'
      -------------------------
      Properties         |         apn: 'h2g2'
                         |     roaming: 'allowed'
                         |     IP type: 'none'
                         |        user: 'none'
                         |    password: 'none'
                         |      number: 'none'
                         | Rm protocol: 'unknown'
      -------------------------
      IPv4 configuration |   method: 'static'
                         |  address: '30.58.51.96'
                         |   prefix: '30'
                         |  gateway: '30.58.51.97'
                         |      DNS: '10.177.0.34', '10.177.0.210'
                         |      MTU: '1430'
      -------------------------
      IPv6 configuration |   method: 'unknown'
      -------------------------
      Stats              |          Duration: '30'
                         |    Bytes received: 'N/A'
                         | Bytes transmitted: 'N/A'
    root@ventana:~# ifconfig wwan0 30.58.51.96/30
    root@ventana:~# route add default gw 30.58.51.97 wwan0
    root@ventana:~# echo "nameserver 10.177.0.34" > /etc/resolv.conf
    root@ventana:~# echo "nameserver 10.177.0.210" >> /etc/resolv.conf
    root@ventana:~# ping www.google.com
    
    • 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'

Some modems that support GNSS provide access to global positioning via ModemManager. For example, the Huawei MU609:

# enable GPS based location with NMEA trace info
root@ventana:~# mmcli --modem 0 --location-enable-gps-nmea
successfully setup location gathering
# get GPS NMEA location info
root@ventana:~# mmcli --modem 0 --location-get-gps-nmea

/org/freedesktop/ModemManager1/Modem/0
  -------------------------
  GPS NMEA traces | $GPGGA,153824.0,3515.484477,N,12040.136651,W,1,06,1.3,47.8,M,-31.0,M,,*58
                  | $GPGSA,A,3,05,07,08,09,28,30,,,,,,,2.7,1.3,2.4*39
                  | $GPVTG,,T,0.0,M,0.0,N,0.0,K,A*0D
                  | $GPRMC,153824.0,A,3515.484477,N,12040.136651,W,0.0,,200617,,,A*56
                  | $GPGSV,2,1,07,05,17,289,36,07,60,040,40,08,35,064,32,09,47,154,35*78
                  | $GPGSV,2,2,07,28,54,239,38,30,54,319,39,23,15,146,*43

# enable GPS based location with raw trace info
root@ventana:~# mmcli --modem 0 --location-enable-gps-raw
successfully setup location gathering
root@ventana:~# mmcli --modem 0 --location-get-gps-raw

/org/freedesktop/ModemManager1/Modem/0
  -------------------------
  Raw GPS         |  UTC time: '153938.0'
                  | Longitude: '-120.668886'
                  |  Latitude: '35.258143'
                  |  Altitude: '46.100000'

root@ventana:~# mmcli --modem 0 --location-get

/org/freedesktop/ModemManager1/Modem/0
  -------------------------
  3GPP location   | Mobile country code: '310'
                  | Mobile network code: '410'
                  |  Location area code: '55562'
                  |             Cell ID: '53228154'
  -------------------------
  GPS NMEA traces | $GPGGA,153938.0,3515.488596,N,12040.133136,W,1,06,1.3,46.1,M,-31.0,M,,*5D
                  | $GPGSA,A,3,05,07,08,09,28,30,,,,,,,2.7,1.3,2.3*3E
                  | $GPVTG,,T,0.0,M,0.0,N,0.0,K,A*0D
                  | $GPRMC,153938.0,A,3515.488596,N,12040.133136,W,0.0,,200617,,,A*5B
                  | $GPGSV,2,1,07,05,17,289,35,07,60,042,41,08,35,063,34,09,46,154,35*78
                  | $GPGSV,2,2,07,28,54,240,40,30,55,320,40,23,15,146,*47
  -------------------------
  Raw GPS         |  UTC time: '153938.0'
                  | Longitude: '-120.668886'
                  |  Latitude: '35.258143'
                  |  Altitude: '46.100000'
  -------------------------
  CDMA BS         | Not available

Controlling the ModemManager service:

  • Ubuntu 16.04 (use systemctl)
    # stop ModemManager
    systemctl stop ModemManager
    # disable ModemManager at boot
    systemctl disable ModemManager
    # enable ModemManager at boot
    systemctl enable ModemManager
    # start ModemManager
    systemctl start ModemManager
    

Debugging with ModemManager can be done by running ModemManager with the '--debug' flag. For example, on Ubuntu 16.04:

# stop ModemManager
systemctl stop ModemManager
# run manually with debug
ModemManager --debug --log-level=DEBUG
# set logging level to max
mmcli -G DEBUG
# set logging level to minimum
mmcli -G ERR
# AT commands can be sent when in debug mode
mmcli --modem 0 --timeout=120 --command="ATI" # Ident

References:

NetworkManager

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.

Notes:

  • 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+

Example usage:

  • Show version:
    root@ventana:~# nmcli --version
    nmcli tool, version 1.2.6
    
  • Show Device Status:
    # show status
    root@ventana:~# nmcli device status
    DEVICE    TYPE      STATE         CONNECTION        
    eth0      ethernet  connected     Wired connection 1
    cdc-wdm0  gsm       disconnected  --                
    eth1      ethernet  unavailable   --                
    can0      can       unmanaged     --                
    lo        loopback  unmanaged     --                
    
  • Bring down Wired Connection 1:
    root@ventana:~# nmcli connection down id 'Wired connection 1'
    Connection 'Wired connection 1' successfully deactivated
    
  • Add a modem:
    • Example: QMI controlled modem with an APN=h2g2 (Google Fi):
      root@ventana:~# nmcli connection add type gsm ifname cdc-wdm0 con-name mymodem apn h2g2
      Connection 'mymodem ' (6d89ff6e-6eb6-4f0f-80d1-fb081165f710) successfully added.
      
    • Example: AT controlled modem with a Verizon Dynamic IP SIM:
      root@ventana:~# nmcli connection add type gsm ifname ttyACM0 con-name mymodem apn vzwinternet
      Connection 'mymodem ' (6d89ff6e-6eb6-4f0f-80d1-fb081165f710) successfully added.
      
  • Connect to mymodem device:
    root@ventana:~# nmcli connection up id mymodem 
    Connection successfully activated
    

Controlling the NetworkManager service:

  • Ubuntu 16.04 (use systemctl)
    # stop NetworkManager
    systemctl stop NetworkManager
    # disable NetworkManager at boot
    systemctl disable NetworkManager
    # enable NetworkManager at boot
    systemctl enable NetworkManager
    # start NetworkManager
    systemctl start NetworkManager
    

Troubleshooting:

  • 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:
    root@ventana:~# dbus-send --print-reply --system \
       --dest=org.freedesktop.ModemManager1 \
       /org/freedesktop/ModemManager1/Modem/0 \
       org.freedesktop.DBus.Properties.Get \
       string:org.freedesktop.ModemManager1.Modem string:DeviceIdentifier
    method return time=1504221807.956321 sender=:1.3 -> destination=:1.27 serial=41 reply_serial=2
       variant       string "ce4335fc20b8e7d2bf65f68483b79e78216e0256"
    

Installing pre-built latest stable libqmi/libmbim/modemmanager via PPA

Aleksander 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:

Xenial:

apt-get install software-properties-common # contains add-apt-repository
add-apt-repository ppa:aleksander-m/modemmanager-xenial
apt-get update
apt-get install modemmanager libqmi-utils libmbim-utils

Trusty:

add-apt-repository ppa:aleksander-m/modemmanager-trusty
apt-get update
apt-get install modemmanager libqmi-utils libmbim-utils

Building libqmi/libmbim/modemmanager from source

You 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.

For example the following was done on Ubuntu 16.04 (xenial):

  • libqmi:
    apt-get install build-essential git pkg-config automake autoconf intltool libtool gtk-doc-tools
    apt-get install libglib2.0-dev libgudev-1.0-dev
    git clone git://anongit.freedesktop.org/libqmi && cd libqmi && ./autogen.sh
    make
    make install
    ldconfig
    cd ..
    
  • libmbim:
    apt-get install build-essential git pkg-config automake autoconf intltool libtool gtk-doc-tools
    apt-get install libglib2.0-dev libgudev-1.0-dev
    git clone git://anongit.freedesktop.org/libmbim/libmbim && cd libmbim && ./autogen.sh
    make
    make install
    ldconfig
    cd ..
    
  • modemmanager:
    git clone git://anongit.freedesktop.org/ModemManager/ModemManager && cd ModemManager && ./autogen.sh
    make
    make install
    ldconfig
    cd ..
    

Notes:

  • if you are building and installing from source you should remove all other packages that install libmbim or libqmi:
    apt-get purge libmbim-glib-dev llibmbim-glib-doc libmbim-glib4 libmbim-glib4-dbg libmbim-proxy libmbim-utils
    apt-get purge libqmi-glib-dev libqmi-glib-doc libqmi-glib1 libqmi-glib1-dbg libqmi-proxy libqmi-utils
    

Troubleshooting Modem support on Ubuntu

Because 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:

  • use the latest mainline Linux kernel if you can, otherwise use the most recent available Ubuntu kernel
  • use the latest ModemManager, libqmi, and libmbim PPA's (see above)

Use 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.

Troubleshooting steps:

  • Determine what devices you have present and what drivers are being used to possibly support them:
    root@ventana:~# lsusb
    Bus 001 Device 003: ID 1199:9071 Sierra Wireless, Inc. 
    Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    root@ventana:~# dmesg | egrep -ie qualcom\|mbim\|sierra\|wdm
    [   11.253539] usb 1-1.2: Product: Sierra Wireless MC7455 Qualcomm® Snapdragon™ X7 LTE-A
    [   11.253546] usb 1-1.2: Manufacturer: Sierra Wireless, Incorporated
    [   11.378483] usbcore: registered new interface driver cdc_wdm
    [   11.395365] usbserial: USB Serial support registered for Qualcomm USB modem
    [   11.397829] qcserial 1-1.2:1.0: Qualcomm USB modem converter detected
    [   11.398318] usb 1-1.2: Qualcomm USB modem converter now attached to ttyUSB0
    [   11.400563] qcserial 1-1.2:1.2: Qualcomm USB modem converter detected
    [   11.402218] usb 1-1.2: Qualcomm USB modem converter now attached to ttyUSB1
    [   11.404332] qcserial 1-1.2:1.3: Qualcomm USB modem converter detected
    [   11.406082] usb 1-1.2: Qualcomm USB modem converter now attached to ttyUSB2
    [   11.408664] qmi_wwan 1-1.2:1.8: cdc-wdm0: USB WDM device
    [   11.412510] qmi_wwan 1-1.2:1.10: cdc-wdm1: USB WDM device
    
    • Note that the 'usbcore: registered' messages simply indicate a driver is loaded not that it has detected a supported device
      • if qmi_wwan detects your modem it speaks QMI (example above)
      • if cdc_mbim detects your modem it speaks MBIM
    • you can also look at what driver module is bound to a device (QMI example):
      root@ventana:~# ls -l /sys/class/usbmisc/cdc-wdm0/device/driver/ | grep module
      lrwxrwxrwx 1 root root    0 Mar  7 22:20 module -> ../../../../module/qmi_wwan
      
  • Use ModemManager to see what ports and driver are detetcted/supported:
    root@ventana:~# mmcli --modem 0 | grep  -i -E ports\|driver
               |        drivers: 'qmi_wwan, qcserial'
               |          ports: 'ttyUSB0 (qcdm), ttyUSB2 (at), cdc-wdm0 (qmi), wwan0 (net), wwan1 (net), cdc-wdm1 (qmi)'
    
    • 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
  • Check PIN status, power state, registration state, and signal quality by looking at the 'Numbers' and 'Status' section of ModemManager output:
    root@ventana:~# mmcli --modem 0
    ...
      -------------------------
      Numbers  |           own : '18052959083'
      -------------------------
      Status   |           lock: 'sim-pin2'
               | unlock retries: 'sim-pin (3), sim-pin2 (10), sim-puk (10), sim-puk2 (10)'
               |          state: 'registered'
               |    power state: 'on'
               |    access tech: 'umts'
               | signal quality: '31' (recent)
      -------------------------
      Modes    |      supported: 'allowed: 2g, 3g, 4g; preferred: none'
               |        current: 'allowed: 2g, 3g, 4g; preferred: none'
      -------------------------
    ...
    

Getting help:

  • When asking for help make sure to provide the following details:
    • Modem make/model
    • Output of lsusb showing modem
    • Output of mmcli --modem 0 to show detected modem details
    • Output of dmesg | egrep -ie qualcom\|mbim\|sierra\|wdm to show driver messages
    • Output of uname -r to show kernel version
    • Output of qmicli --version and mbimcli --version to show what versions you have
  • for QMI: post to libqmi-devel with details
    • Add Output of qmicli --dms-get-{manufacturer,model,revision,capabilities}
      • revision is firmware
      • capabilities shows if SIM is supported
      • capabilities shows networks
  • for MBIM: post to libmbim-devel with details

OpenWrt Cellular Modem Support

OpenWrt supports a wide range of cellular modems. Depending on the modem, a different software package / driver will be used:

  • comgt : Most GSM / 3G modems : Uses AT commands through the comgt package.
  • uqmi : Newer modems using Qualcomm chipsets : For modems that speak QMI (Quallcom MSM Interface) such as many of the 4G/LTE modems, use uqmi.

comgt package

The 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):

  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.
  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
  3. The pppd daemon is run on the 'device' which creates a 'point to point' network interface (named 3g-<interface>) over the serial connection

Example configurations

UCI is a configuration system for OpenWrt. More information can be found here

A modem must be configured in OpenWrt. The following uci properties are used by comgt and the 3g proto:

  • proto - must be 3g
  • 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
  • service - umts|cdma|evdo - the service type (which dictates the chat script used)
  • apn - the APN of your provider
  • pincode - the PIN (if required) to use your SIM

Examples:

  • An example configuration for a Sierra Wireless MC9870 3G UMTS modem (ie AT&T Carrier using the ISP.CINGULAR APN):
    uci set network.wan=interface
    uci set network.wan.proto=3g
    uci set network.wan.service=umts
    uci set network.wan.apn=ISP.CINGULAR
    uci set network.wan.device=/dev/ttyUSB4
    uci commit network
    
    • 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:
      uci set network.wan.username=user
      uci set network.wan.password=pass
      
  • An example configuration for a Sierra Wireless MC5728 3G CDMA/EVDO modem (ie Sprint/Verizon Carriers):
    uci set network.wan=interface
    uci set network.wan.proto=3g
    uci set network.wan.service=cdma
    uci set network.wan.device=/dev/ttyUSB0
    uci commit network
    
    • 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)
  • An example configuration for a Sierra Wireless MC9870 3G UMTS modem (ie AT&T Carrier using the ISP.CINGULAR APN):
    uci set network.wan=interface
    uci set network.wan.proto=3g
    uci set network.wan.service=umts
    uci set network.wan.apn=ISP.CINGULAR
    uci set network.wan.device=/dev/ttyUSB4
    uci commit network
    
  • An example configuration for a Sierra Wireless MC7700 LTE/HSPA+ Gobi modem (ie AT&T Carrier using the ISP.CINGULAR APN):
    uci set network.wan=interface
    uci set network.wan.proto=3g
    uci set network.wan.service=umts
    uci set network.wan.apn=ISP.CINGULAR
    uci set network.wan.device=/dev/ttyUSB3
    uci commit network
    
  • An example configuration for an Option Module:
    uci set network.wan=interface
    uci set network.wan.proto=3g
    uci set network.wan.service=umts
    uci set network.wan.apn=ISP.CINGULAR
    uci set network.wan.device=/dev/ttyHS5
    uci commit network
    

Using gcom to see things like: modem info, SIM state, and signal strength

The 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):

  • report SIM status, connection status, and signal quality:
    # gcom -d /dev/ttyUSB3
    SIM ready
    Waiting for Registration..(120 sec max)
    Registered on Home network: "AT&T",2
    Signal Quality: 12,99
    
  • for Option GTM671WFS (on ttyHS3)
    # gcom -d /dev/ttyHS3
    SIM ready
    Waiting for Registration..(120 sec max)
    Registered on Home network: "AT&T",2
    Signal Quality: 17,99
    
  • report just signal strength:
    # gcom -d /dev/ttyUSB3 sig
    Signal Quality: 12,99
    
  • report card info (mfg strings):
    # gcom -d /dev/ttyUSB3 info
    ##### Wireless WAN Modem Configuration #####
    Product text:
    ====
    
    Manufacturer: Sierra Wireless, Inc.
    Model: MC8790
    Revision: K1_0_2_8AP C:/WS/FW/K1_0_2_8AP/MSM6290/SRC 2008/09/17 14:00:22
    IMEI: 352974021856935
    IMEI SV: 3
    FSN: D661380183210
    3GPP Release 6
    +GCAP: +CGSM,+DS,+ES
    OK
    ====
    Manufacturer:           Sierra Wireless, Inc.
    IMEI and Serial Number: 352974021856935
    Manufacturer's Revision:
    K1_0_2_8AP C:/WS/FW/K1_0_2_8AP/MSM6290/SRC 2008/09/17 14:00:
    Hardware Revision:
    
    Network Locked:         0
    Customisation:
    
    Band settings:          (
    )
    APN:                    1,"IP","ISP.CINGULAR","0.0.0.0",0,0
    ##### END #####
    

uqmi package

Modems 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.

  • qcserial driver exposes the modem's serial interfaces
  • qmi_wwan driver which exposes a network interface

OpenWrt 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).

Known devices that use QMI (Note that some of these support both QMI or AT control via different firmware from Carriers):

  • Sierra Wireless MC77xx series
  • Sierra Wireless MC7354

OpenWrt Packages:

  • kmod-usb-serial-qualcomm - qcserial.ko
  • kmod-usb-net-qmi-wwan - qmi_wwan.ko
  • uqmi

Notes:

  • There is no luci web-admin protocol support for QMI currently which means you cannot configure a QMI modem via the web-admin

Example QMI modem configurations

  • An example configuration for a Sierra Wireless MC7354 modem configured for AT&T UMTS (which is the 2nd wwan device):
    uci set network.wan=interface
    uci set network.wan.ifname=wwan1
    uci set network.wan.proto=qmi
    uci set network.wan.apn=ISP.CINGULAR
    uci set network.wan.device=/dev/cdc-wdm1
    uci set network.wan.delay=90
    uci commit network
    
  • The GSM/UMTS modem is the 2nd device (/dev/wwan1, /dev/cdc/wdm1)
  • This modem needed a 90 second delay before trying to connect
  • Example /etc/config/network content for uqmi modem
    config interface 'wan'
            option ifname 'wwan1'
            option proto 'qmi'
            option apn 'ISP.CINGULAR'
            option device '/dev/cdc-wdm1'
            option delay '90'
    

uqmi usage and troubleshooting

Examples:

  • Check SIM status:
    root@OpenWrt:/# uqmi -d /dev/cdc-wdm0 --get-pin-status
    {
            "pin1_status": "disabled",
            "pin1_verify_tries": 3,
            "pin1_unblock_tries": 10,
            "pin2_status": "not_verified",
            "pin2_verify_tries": 10,
            "pin2_unblock_tries": 10
    }
    
    • if you see a 'UIM uninitialized' you have a SIM issue such as SIM not inserted
  • Check for available networks:
    root@OpenWrt:/# uqmi -d /dev/cdc-wdm0 --get-serving-system
    {
            "registration": "registered",
            "plmn_mcc": 310,
            "plmn_mnc": 260,
            "plmn_description": "Project Fi",
            "roaming": false
    }
    
    • above shows we are registered on the providers network (in this case Google Fi)
  • Check data status:
    root@OpenWrt:/# uqmi -d /dev/cdc-wdm0 --get-data-status
    "connected"
    
  • Get signal info:
    root@OpenWrt:/# uqmi -d /dev/cdc-wdm0 --get-signal-info
    {
            "type": "hdr",
            "rssi": -125,
            "ecio": 5,
            "io": -106,
            "type": "wcdma",
            "rssi": -99,
            "ecio": 19
    }
    
  • Scan networks:
    root@OpenWrt:/# uqmi -d /dev/cdc-wdm0 --network-scan
    {
            "network_info": [
                    {
                            "mcc": 310,
                            "mnc": 260,
                            "description": "T-Mobile",
                            "status": [
                                    "available",
                                    "home",
                                    "not_forbidden",
                                    "preferred"
                            ]
                    },
                    {
                            "mcc": 310,
                            "mnc": 260,
                            "description": "Project Fi",
                            "status": [
                                    "current_serving",
                                    "home",
                                    "not_forbidden",
                                    "preferred"
                            ]
                    },
                    {
                            "mcc": 310,
                            "mnc": 260,
                            "description": "T-Mobile",
                            "status": [
                                    "available",
                                    "home",
                                    "not_forbidden",
                                    "preferred"
                            ]
                    },
                    {
                            "mcc": 310,
                            "mnc": 410,
                            "description": "AT&T",
                            "status": [
                                    "available",
                                    "roaming",
                                    "not_forbidden",
                                    "not_preferred"
                            ]
                    },
                    {
                            "mcc": 310,
                            "mnc": 410,
                            "description": "AT&T",
                            "status": [
                                    "available",
                                    "roaming",
                                    "not_forbidden",
                                    "not_preferred"
                            ]
                    },
                    {
                            "mcc": 311,
                            "mnc": 480,
                            "description": "Verizon",
                            "status": [
                                    "available",
                                    "roaming",
                                    "forbidden",
                                    "not_preferred"
                            ]
                    },
                    {
                            "mcc": 312,
                            "mnc": 770,
                            "description": "312-770",
                            "status": [
                                    "available",
                                    "roaming",
                                    "forbidden",
                                    "not_preferred"
                            ]
                    }
            ],
            "radio_access_technology": [
                    {
                            "mcc": 310,
                            "mnc": 260,
                            "radio": "lte"
                    },
                    {
                            "mcc": 310,
                            "mnc": 260,
                            "radio": "umts"
                    },
                    {
                            "mcc": 310,
                            "mnc": 260,
                            "radio": "gsm"
                    },
                    {
                            "mcc": 310,
                            "mnc": 410,
                            "radio": "lte"
                    },
                    {
                            "mcc": 310,
                            "mnc": 410,
                            "radio": "umts"
                    },
                    {
                            "mcc": 311,
                            "mnc": 480,
                            "radio": "lte"
                    },
                    {
                            "mcc": 312,
                            "mnc": 770,
                            "radio": "lte"
                    }
            ]
    }
    
  • Get current IP settings:
    root@OpenWrt:/# uqmi -d /dev/cdc-wdm0 --get-current-settings
    {
            "pdp-type": "ipv4",
            "ip-family": "ipv4",
            "mtu": 1430,
            "ipv4": {
                    "ip": "25.232.251.49",
                    "dns1": "10.177.0.34",
                    "dns2": "10.177.0.210",
                    "gateway": "25.232.251.50",
                    "subnet": "255.255.255.252"
            },
            "ipv6": {
    
            },
            "domain-names": {
    
            }
    }
    
    • 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

If 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:

logread | grep qmi

You 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.

Additional init scripts for some devices

Note 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:

  • 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
  • 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).

The 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):

# set Modem data/control device in /etc/config/gpsd
uci set network.wan.ctrl_device=/dev/ttyUSB3
uci commit

# create an init script that enables full power on bootup for all 3g devices
cat << EOF > /etc/init.d/3g_power_enable
#!/bin/sh /etc/rc.common

START=80
DEV=0

start(){

        include /lib/network
        scan_interfaces

        local ifc
        for ifc in \$interfaces; do
                local proto
                config_get proto "\$ifc" proto
                [ "\$proto" == "3g" ] && {
                        local device
                        config_get device "\$ifc" ctrl_device
                        [ "\$device" -a -c "\$device" ] && {
                                logger -t "3g" "Enabling full power mode for \$device"
                                echo -e -n "at+cfun=1\015" > \$device
                        }
                }
        done
}
chmod +x /etc/init.d/3g_power_enable
/etc/init.d/3g_power_enable enable

LuCI Web-Admin Configuration for Cellular Cards

The following instructions detail how to configure a cellular card using the LuCI web-admin:

  1. Access the board's web interface. For instructions: Accessing the Web Interface
  2. Go to the Network tab, then the Interfaces tab.

  1. Click on "Add new interface..." at the bottom left of the screen.
  2. Name the interface. Here it is named "wan"
  3. Check "Custom Interface" with nothing entered in the text box.

  1. Under the Protocol field, select "UMTS/3G from the drop down menu.
  2. Continue to fill out the remaining fields.

  1. Click on Save & Apply at the bottom right of the screen.
  2. Reboot the board. The modem should be woken up from the /etc/init.d/3g script a few seconds after the board boots.

USB Routing Notes for Gateworks products

Some 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.

Please refer to the Gateworks USB Device Table and USB Steering pages for details for each board.

Sending a SMS / Text Message

Depending on the carrier and plan, SMS messages can be sent from Gateworks boards via a Cellular Modem.

Gateworks has tested and verify this works sending to a normal handset.

The example shown is using AT commands which could be turned into a script if desired.

  1. Connect to the modem where you can send AT commands. For AT Command instructions, see here: AT Commands
  2. Verify that your modem supports SMS messages by typing the following AT command. If you see +CMGF: (0-1) then it is supported.
    at+cmgf=?
    +CMGF: (0-1)
    
    OK
    
  3. Switch the modem into SMS Message Sending mode:
    AT+CMGF=1
    OK
    
  4. Enter the cellular number to send the SMS to as well as the message:
    AT+CMGW="0661326109"
    
    > This is a test message from a Gateworks Single Board Computer sending SMS.
    >                    # hit ctrl+z to end SMS here
    
    +CMGW: 9
    
  5. Note that after hitting ctrl+z CMGW shows a numerical number. This number is the ID of the SMS to be sent.
  6. Send the SMS message with the following command, where the number matches the ID from Step 4&5
    AT+CMSS=9
    OK
    
  7. 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.

Specific Modem Notes

MultiTech MTPCIe-H5 Modules (GSM/CDMA)

The 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.

Gateworks has tested a MTPCIe-H5 with an AT&T SIM in office and it works properly.

Driver:

  • cdc_acm driver (CONFIG_USB_ACM, cdc-acm.ko) exposes 7 tty devices:
    • /dev/ttyACM0 -
    • /dev/ttyACM1 -
    • /dev/ttyACM2 -
    • /dev/ttyACM3 - control/data
    • /dev/ttyACM4 -
    • /dev/ttyACM5 -
    • /dev/ttyACM6 -
  • OpenWrt package support: kmod-usb-acm

To configure, modify the /etc/config/network file to include the following:

config interface 'wan'
        option proto '3g'
        option service 'umts'
        option apn 'ISP.CINGULAR'
        option device '/dev/ttyACM3'

Antenna Connector Detail:

  |-------------------------|
  |                         |=
  | o Aux                   |=
  |                         |=
  | o CELL                  |=
  |                         |=
  | o GPS                   |=
  |-------------------------|

Additional Documentation:

  • 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.

Sierra Wireless Modems

Please check with Sierra Wireless for availability and EOL status

Commonly used Modules known to work on Gateworks products:

  • MC8790/MC8790V UTMS/HSPA and quad-band GSM/GPRS/EDGE modem
  • MC5728/MC5728V CDMA modem
  • MC7700/MC77xx LTE/HSPA+ Gobi API modem with GPS
  • MC8090/ HSPA+ and quad-band GSM/GPRS/EDGE modem

General Notes:

  • 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.
  • 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 below
  • The LED output (pin 42) indicates the module state according to the PCI-Express Mini Card specification:
    • Off - module not powered
    • On - module powered and connected but not transmitting or receiving
    • slow blink - module powered and searching for a connection (250ms on at 0.2Hz)
    • fast blink - module is transmitting or receiving (3Hz blink rate)

The MC77xx Family provides:

  • LTE,HSPA+,GSM/GPRS/EDGE,EV-DO Rev A (MC7750), 1xRTT (MC7750)
  • 100mbps peak download rate
  • 50mbps peek upload rate
  • LTE:
    • MC7700: 2100(B1), AWS(B4), 700(B17)
    • MC7710: 2100(B1), 1800(B3), 2600(B7), 900(B8), 800(B20)
    • MC7750: 700(B13)
  • WCDMA:
    • MC7700: 2100(B1), 1900(B2), 850(B5)
    • MC7710: 2100(B1), 900(B8)
  • CDMA 1xRTT/EV-DO Rev A:
    • MC7750: 800(BC0), 1900(BC1)
  • GSP/GPRS/EDGE:
    • quad-band
  • Refer to Sierra Wireless AirPrime MC Series documentation for more details

MC8790 / MC8790V

Driver:

  • sierra - USB_SERIAL_SIERRAWIRELESS
  • OpenWrt package support: kmod-usb-sierra
  • exposes 7 serial devices:
    • /dev/ttyUSB0
    • /dev/ttyUSB1
    • /dev/ttyUSB2
    • /dev/ttyUSB3 - control/data
    • /dev/ttyUSB4 - control/data
    • /dev/ttyUSB5 - control/data
    • /dev/ttyUSB6 - control/data
    • /dev/ttyUSB7

Notes:

  • 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:
    AT+CFUN?
    +CFUN: 0
    
    OK
    AT+CFUN=1
    OK
    
    • CFUN=0 is low power mode or 'airplane' mode where RF is disabled
    • CFUN=1 is full power mode
  • 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.
  • OpenWrt Sample Config:
    config interface 'wan'
            option proto '3g'
            option apn 'internet'
            option device '/dev/ttyUSB3'
            option service 'utms'
    

MC8090

Driver:

  • sierra - USB_SERIAL_SIERRAWIRELESS
  • OpenWrt package support: kmod-usb-sierra
  • exposes 6 serial devices:
    • /dev/ttyUSB0
    • /dev/ttyUSB1
    • /dev/ttyUSB2
    • /dev/ttyUSB3
    • /dev/ttyUSB4 - data (ppp)
    • /dev/ttyUSB5 - control (AT commands)

MC7700 / MC7710

AirPrime 3G/4G/LTE wireless module

Carrier:

  • MC7700 (US)
    • AT&T
    • NTT Docomo
    • Bell
    • Tellus
    • Roger
  • MC7710:
    • T-Mobile

Driver:

  • sierra - USB_SERIAL_SIERRAWIRELESS
  • OpenWrt package support: kmod-usb-sierra
  • exposes 5 serial devices:
    • /dev/ttyUSB0
    • /dev/ttyUSB1
    • /dev/ttyUSB2
    • /dev/ttyUSB3 - control (AT commands)
    • /dev/ttyUSB4 - control/data

Known USB IDs:

  • 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)

References:

MC7750

AirPrime 3G/4G/LTE wireless module

Carrier:

  • MC7750 (US)
    • Verizon

Bands:

  • LTE: 700MHz(B13)
  • CDMA 1xRTT/EV-DO Rev A: 800MHz(BC0), 1900MHz(BC1)

This card uses the QMI protocol (Qualcomm MSM Interface) for modem/connection - see uqmi

Drivers:

  • qcserial (CONFIG_USB_SERIAL_QUALCOMM) exposes serial interfaces:
    • /dev/ttyUSB0 - management
    • /dev/ttyUSB1 - GPS (NMEA)
    • /dev/ttyUSB2 - modem
  • qmi_wwan (USB_NET_QMI_WWAN) exposes network interface and QMI interface:
    • /dev/cdc-wdm0 - QMI - use with libqmi
    • /sys/class/net/wwan0

GPS:

  • To enable NMEA messages on /dev/ttyUSB1:
    stty raw -F /dev/ttyUSB1; echo \$GPS_START >/dev/ttyUSB1
    
  • To disable NMEA messages on /dev/ttyUSB1:
    stty raw -F /dev/ttyUSB1; echo \$GPS_STOP >/dev/ttyUSB1
    

References:

MC7354

AirPrime 3G/4G/LTE wireless module - One design for global markets - Multi-carrier support

Details:

  • LTE,HSPA+,GSM/GPRS/EDGE,EV-DO Rev A, 1xRTT
  • 100mbps peak download rate
  • 50mbps peak upload rate
  • USB 2.0 High Speed
  • -40C to +85C

Carriers:

  • Verizon (CDMA/LTE)
  • AT&T (UMTS)
  • Sprint

Bands:

  • LTE: 1900(B2), AWS(B4), 850(B5), 700(B13), 700(B17), 1900(B25)
  • WCDMA: 2100(B1), 1900(B2), AWS(B4), 850(B5), 900(B8)
  • CDMA 1xRTT/EV-DO Rev A: 800MHz(BC0), 1900MHz(BC1), 1700(BC10)
  • GSM/GPRS/EDGE: Quad-Band

This modem uses the QMI protocol (Qualcomm MSM Interface) for modem/connection:

This modem has been found to work well for:

  • Ubuntu: Verizon/ATT/Fi
  • LEDE/OpenWrt 16.02: Verizon/ATT/Fi

Drivers:

  • qcserial (CONFIG_USB_SERIAL_QUALCOMM) exposes serial interfaces:
    • /dev/ttyUSB0 - management (QMI)
    • /dev/ttyUSB1 - GPS (NMEA)
    • /dev/ttyUSB2 - modem data
  • qmi_wwan (USB_NET_QMI_WWAN) exposes network interface and QMI interface:
    • /dev/cdc-wdm0 - control (QMI)
    • /dev/cdc-wdm1 - control (QMI)
    • /sys/class/net/wwan0
    • /sys/class/net/wwan1

OpenWrt configuration:

uci set network.wan=interface
uci set network.wan.ifname=wwan0
uci set network.wan.proto=qmi
uci set network.wan.apn=vzwinternet
uci set network.wan.device=/dev/cdc-wdm0
uci set network.wan.autoconnect=0
uci commit network
  • it is important to configure autoconnect=0 as shown above for OpenWrt otherwise qmi.sh will not connect

GPS:

  • To enable NMEA messages on /dev/ttyUSB1:
    stty raw -F /dev/ttyUSB1; echo \$GPS_START >/dev/ttyUSB1
    
  • To disable NMEA messages on /dev/ttyUSB1:
    stty raw -F /dev/ttyUSB1; echo \$GPS_STOP >/dev/ttyUSB1
    

References:

MC7455

WARNING: This modem is NOT well supported

AirPrime MC 4G LTE Cat-6, Cat-3 / 3G Fallback wireless module - One design for America/EMEA - Multi-carrier support

Bands:

  • LTE-A: B1-B5, B7, B8, B12, B13, B20, B25, B26, B29, B30, B41
  • LTE-FDD, LTE-TDD HSPA+
  • This modem is NOT well supported
    • Different firmware on the modem either puts the modem into QMI or MBIM mode, determined here
    • Depending on firmware, modem may not be supported on Gateworks OpenWrt 16.02 with 4.4 kernel
  • This modem supports USB 3.0 which is NOT available on the Ventana Mini-PCIe pins
  • USB ID: 1199:9071 & 1199:9070
  • The second SIM pins on the modem, (11 & 13) are not supported by Gateworks boards
  • Customer provided commands if USB ID is missing:
    echo '1199 9071' > /sys/bus/usb-serial/drivers/option1/new_id  (for generic USB driver)
    echo '1199 9071' > /sys/bus/usb-serial/drivers/sierra/new_id (for sierra usb-serial)
    echo '1199 9071' > /sys/bus/usb/drivers/qmi_wwan/new_id (for Qualcomm qmi)
    
  • Software Drivers:
    • qcserial
    • qmi_wwan
    • cdc_mbim * Depending on firmware
    • usbserial
    • usbcore

Software Drivers:

  • qcserial (CONFIG_USB_SERIAL_QUALCOMM) exposes serial interfaces:
    • /dev/ttyUSB0
    • /dev/ttyUSB1
    • /dev/ttyUSB2
  • qmi_wwan (USB_NET_QMI_WWAN) exposes network interface and QMI interface:
    • /dev/cdc-wdm0
    • /dev/cdc-wdm1
    • /sys/class/net/wwan0
    • /sys/class/net/wwan1

Software utilties:

  • libqmi-1.17.901 or newer
  • libmbim 1.15.0 (1.14.0+ required) * Depending on firmware

Kernel version:

  • Typically requires 4.10 or higher

References:

MC5828 / MC5728V

Driver:

  • exposes 4 serial devices:
    • /dev/ttyUSB0 - control/data
    • /dev/ttyUSB1 -
    • /dev/ttyUSB2 -
    • /dev/ttyUSB3 -

(EOL) Option Globetrotter Multi-function Modules (GSM/CDMA/WiFi/GPS/uSD) GTM671WFS EOL

This module is EOL - End of life.

The Option Globetrotter modules provide multi-function capability including GSM, CDMA, WiFi (ath9k 11abgn 1x1), GPS, uSD, and local SIM carrier all in one module.

Driver:

  • hso (CONFIG_USB_HSO) exposes 6 serial ports:
    • /dev/ttyHS0 - Diagnostic (proprietary Option)
    • /dev/ttyHS1 - GPS (ie for gpsd)
    • /dev/ttyHS2 - GPS Control
    • /dev/ttyHS3 - Application (proprietary Option)
    • /dev/ttyHS4 - control (ie for gcom)
    • /dev/ttyHS5 - control/data (ie for ppp)
  • OpenWrt package: usb-net-hso

USB ID:

  • 0af0:9200

GPS:

  • 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:
    echo -e -n "AT_OGPSMODE=1\015" > /dev/ttyHS2
    echo -e -n "AT_OGPS=2\015" > /dev/ttyHS2
    
  • You should then be able to see the GPS on /dev/ttyHS1:
    stty -F /dev/ttyHS1 9600
    cat /dev/ttyHS1
    
  • or use screen:
    screen /dev/ttyHS1 9600,cs8
    

The Option GTM671WFS contains 4 U.FL antenna connections for cellular, wifi and GPS.

Here is the location for these (looking at top of card with PCIe edge fingers to right)

  |-------------------------|
  | o Cellular Main         |=
  |                         |=
  | o 802.11 aux            |=
  |                         |=
  | o Cellular Aux/GPS      |=
  |                         |=
  | o 802.11 main           |=
  |-------------------------|

To insert the SIM card in the Option's SIM carrier, you slide the top to lock/unlock the metal top cover (see picture).

Troubleshooting:

  • 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.
    root@OpenWrt:/# [62.860000] usb 1-1: hso received invalid serial state notification
    

Huawei MU609

Driver:

  • option.ko (CONFIG_USB_SERIAL_OPTION) exposes 6 serial ports:
    • /dev/ttyUSB0 - modem (ie for qcom)
    • /dev/ttyUSB1 -
    • /dev/ttyUSB2 - AT Commands
    • /dev/ttyUSB3 -
  • pinout concerns:
    • Pin 20 (W_DISABLE#) is W_DISABLE_E active-low input on 1.8V domain with a max of 2.1V (violated when we drive this high) (not supported by current firmware accoring to MiniPCIe hardware guide)
    • Pin 22 (PERST#) is RESIN_N active-low input on 1.8V domain with max of 2.1V (violated when we drive this high)
  • OpenWrt package: usb-serial-option
  • USB2.0: 12d1:1573: Huawei Technologies:HUAWEI Mobile
  • Testing:
    12d1:1573 Huawei Technologies Co., Ltd.
    
    usb 2-1: New USB device found, idVendor=12d1, idProduct=1573
    usb 2-1: New USB device strings: Mfr=5, Product=4, SerialNumber=0
    usb 2-1: Product: HUAWEI Mobile
    usb 2-1: Manufacturer: Huawei Technologies
    

OpenWrt /etc/config/network:

config interface 'wan'
        option proto '3g'
        option service 'umts'
        option apn 'ISP.CINGULAR'
        option device '/dev/ttyUSB0'

Link http://consumer.huawei.com/en/solutions/m2m-solutions/products/tech-specs/mu609mini-pcie-en.htm

Simcom SIM5360E

*Evaluation*

  • ID 05c6:9000 Qualcomm, Inc.
  • SIMCom SIM5218 modem
    • /dev/ttyUSB0 -
    • /dev/ttyUSB1 -
    • /dev/ttyUSB2 - AT Commands
    • /dev/ttyUSB3 - AT Commands
    • /dev/cdc-wdm0

Nimbelink NL-SW-LTE-TSVG / Telit LE910-SVG

* Still in testing, contact support@… *

  • Details
    • 4G LTE CAT 3
    • Pre-Certified Verizon Modem
    • 100Mbps download and 50Mbps upload speeds
  • Carriers
    • USA : Verizon
  • USB ID 1bc7:1201 Telit Wireless Solutions

Drivers:

  • option.ko (CONFIG_USB_SERIAL_OPTION) exposes 5 serial ports:
    • /dev/ttyUSB0 - qcdm
    • /dev/ttyUSB1 - at
    • /dev/ttyUSB2 -
    • /dev/ttyUSB3 - at
    • /dev/ttyUSB4 -
  • qmi_wwan (USB_NET_QMI_WWAN) exposes network interface and QMI interface:
    • /dev/cdc-wdm0 - control (QMI)

Links:

*http://nimbelink.com/skywire-cellular-modem-lte/

Troubleshooting

Here are some troubleshooting tips with regards to cellular modems:

  • Make sure your modem is being recognized on the USB bus with lsusb
    • if not, check that the USB bus is correctly steered to the miniPCIe socket the modem is installed in (see the USB Steering wiki page)
    • make sure the modem supports USB 2.0
    • 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 here)
  • Does your modem require a driver or driver update that is not available in the Linux kernel version you are using?
    • 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)
    • 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.
  • Make sure no other processes are interacting with your M2M device communication ports (ie mis-configured gpsd)
  • Is your GSM module locked to a Carrier/Network/SIM/PIN? - if so you have to unlock it (if possible/allowed)
  • Is your module in low-power / airplane mode?
  • Can you not send AT commands to a card? Try hotswapping the card
  • Is your modem a Sierra Wireless *-V modem with Voice audio capabilities? See below
  • Have you specified the correct APN for your GSM module? - Your carrier can provide you with the proper APN
  • Are you using the correct serial device? - most modules provide several, not all of which can be used with pppd/chat/gcom
  • Is your CDMA/EVDO module 'activated'? - you may need to do this on a Windows system with vendor-supplied application/drivers
  • Issue a reset command to the card when starting up (varies by card)
    [ -e /dev/ttyUSBX ] && echo -e -n "AT~RESET\015" > /dev/ttyUSBX
    

For 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:

  • AT+CREG? will return your network registration state: 0 - registered to home network, 1 - roaming, -1 not registered
  • AT+COPS? will return the operator selection: <mode>[,<format>,<operator>

See http://ernstagn.home.xs4all.nl/GPRS-HOWTO/GPRS-HOWTO.html for more info

General Reference:

Sierra Wireless Voice Audio Modem conflicts with PERST#

Sierra 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.

The 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).

You may find that you can't use these modems without either:

a) Disable PCI on the board if not needed and drive the pin low (contact support@… with the model of the board you are using and what socket you want to use it in to see if this is possible) b) Disabling the PERST# (contact support@… with the model of the board you are using and what socket you want to use it in to see if this is possible). c) Mask off the pin on the card or cut the trace on the card

AT Commands

Many 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.

To 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.

For 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

screen /dev/ttyUSB3

This will open a window where one can start typing AT commands. Example shown below:

at+cgmi
Sierra Wireless, Incorporated

OK
at+cgmm
MC7700

OK
at+csq
ERROR

To send AT Commands from the Linux Shell, use echo with -e -n and terminate with \015. Example below:

echo -e -n "at+cfun=1\015" > /dev/ttyUSB3

Resetting a Modem with AT Commands

The following AT commands can be used to perform a soft reset on particular modems:

  • ZTE:
    AT+ZRST
    
  • Sierra Wireless:
    AT!RESET
    
    or
    AT+CFUN=1,1
    
  • Huawei and others:
    AT+CFUN=4
    AT+CFUN=6
    

Consult your modem documentation for AT commands for that device and firmware.

Reset for SIM Read

Most 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.

Refer to the USB reset wiki page for details on how to do this on various boards and miniPCIe sockets.

Testing a Connection

A quick way to verify the module has connected up to the cellular carrier and has received an IP address is to run the ifconfig command from the Linux console. The following is an example output, note the 3g-wan entry, this will not show up if a connection has not been established. In this example 32.177.140.183 is the IP address. Once a connection is established, you should also be able to ping to the internet.

root@OpenWrt:/# ifconfig
3g-wan    Link encap:Point-to-Point Protocol
          inet addr:32.177.140.183  P-t-P:10.64.64.64  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:70 errors:0 dropped:0 overruns:0 frame:0
          TX packets:72 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:5842 (5.7 KiB)  TX bytes:5000 (4.8 KiB)

br-lan    Link encap:Ethernet  HWaddr 00:0C:E3:70:DA:17
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:e3ff:fe70:da17/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:408 (408.0 B)

eth0      Link encap:Ethernet  HWaddr 00:D0:12:56:EE:6A
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:168 (168.0 B)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:61 errors:0 dropped:0 overruns:0 frame:0
          TX packets:61 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:6044 (5.9 KiB)  TX bytes:6044 (5.9 KiB)

mon.wlan0 Link encap:UNSPEC  HWaddr 00-0C-E3-70-DA-17-00-00-00-00-00-00-00-00-00-00
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:32
          RX bytes:145 (145.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 00:0C:E3:70:DA:17
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:32
          RX bytes:0 (0.0 B)  TX bytes:772 (772.0 B)

root@OpenWrt:/# ping google.com
PING google.com (74.125.224.71): 56 data bytes
64 bytes from 74.125.224.71: seq=0 ttl=51 time=176.596 ms
64 bytes from 74.125.224.71: seq=1 ttl=51 time=166.074 ms
64 bytes from 74.125.224.71: seq=2 ttl=51 time=155.902 ms
^C
--- google.com ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 155.902/166.190/176.596 ms

SIM Card use on PCI Express form-factor modems

PCI 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:

  • Some modems have a SIM slot on them (ie Option Globetrotter)
  • Others use sideband signals on the PCIe connector that route to an external SIM slot:
    • The GW17005 can be used with these however it is not recommended in an environment with shock and vibe
    • The GW16038/GW16062 carriers can be used in specific slots of the Gateworks Avila, Cambria, Laguna product families.
    • The GW16103 Mini-PCIe SIM, uSD and USB expansion board can be used to provide SIM support for boards with Mini-PCIe sockets.

MiniPCI to Mini-PCIe Multiple SIM Card Access

Gateworks 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:

  • GW16049 - USB routed, No SIM connectors (Can't be used for GSM Modules)
  • GW16038 - USB routed, has SIM connectors
  • GW16059 - PCIe and USB routed, No SIM connectors (Can't be used for GSM Modules)
  • GW16062 - PCIe and USB routed, has SIM connectors
  • GW17005 - SIM carrier for cellular cards without SIM or boards with PCIe slots (ie. GW2380, GW23882, GW2383, GW2391)

The 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).

Note 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:

  • Laguna GW2388-x (Bottom MiniPCI socket J4):
    • GPIO7 - GSMSEL0
    • GPIO8 - GSMSEL1
  • Laguna 2382
    • Turn on USB by enabling GPIO10 as noted in the troubleshooting section above #Troubleshooting:
  • Cambria GW2358-x (Bottom MiniPCI socket J8):
    • GPIO10 - GSMSEL0
    • GPIO11 - GSMSEL1
  • Avila (Bottom MiniPCI socket J4):
    • GPIO2 - GSMSEL0
    • GPIO1 - GSMSEL1

Examples:

  • Laguna GW2388 using bottom-right miniPCI socket for GSM radio - select SIM site:
    echo 1 > /sys/class/gpio/gpio7/value; echo 1 > /sys/class/gpio/gpio8/value  ;# sel SELE1/SEL0 1,1 for SIMC
    echo 1 > /sys/class/gpio/gpio7/value; echo 0 > /sys/class/gpio/gpio8/value  ;# sel SELE1/SEL0 1,0 for SIMB
    echo 0 > /sys/class/gpio/gpio7/value; echo 1 > /sys/class/gpio/gpio8/value  ;# sel SELE1/SEL0 0,1 for SIMA
    echo 0 > /sys/class/gpio/gpio7/value; echo 0 > /sys/class/gpio/gpio8/value  ;# sel SELE1/SEL0 0,0 for None
    

Images:

  • GW16062 showing SIM card insertion

  • GW16038 showing SIM card selection jumper block

GW17005 Instructions

The 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.

Attachments (16)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.