mPCiE Modem QMI Interface Internet Connection Setup

The Sierra Wireless MC7304 mPCIE modem provides both HSDPA/3G and LTE/4G wireless connectivity, these modems by default use a different 'Direct IP' primary connection method to earlier modems in the range and are currently best supported by Jessie OS as this has support for the qmi tools.

We'll start by installing the udev rule (20-modem-7304.rules) in /etc/udev/rules.d from the modem rule pack

This sets up shortcut references to allow us to consistently identify which of the ttyUSBx ports do which functions

Modem control is optimally done through the qmi interface so we need to install the software support packages via the command below:
 

apt-get install libqmi-utils

This installs two main utilities (qmi-cli tool and qmi-network helper script) these are used for interaction with the modem (see man qmi-cli for more details)

The APN setting is set by creating and then adding a line to /etc/qmi-network.conf - Consult your carrier for the correct APN name and insert it into the configuration file as shown below :

echo "APN=internet" >/etc/qmi-network.conf

I found the the next step provided easier control over the modem and routing by first removing the extra unused network ports, but this is optional. :

MyPi Industrial Raspberry Pi Sierra Wireless MC7304 3G Modem QMI Internet Connection Configuration Step 1

 

at!entercnd="A710"

AT!UDUSBCOMP=6

at!reset 

Next we have to check/reconfigure the modems data format method, I found that the modem would not DHCP an address without changing it to 802-3.

MyPi Industrial Raspberry Pi Sierra Wireless MC7304 3G Modem QMI Internet Connection Configuration Step 2

 

qmicli -d /dev/cdc-wdm0 --wda-get-data-format
qmicli -d /dev/cdc-wdm0 --wda-set-data-format=802-3

Having checked we've registered on the network and have good signal let's push on and connect to the network

MyPi Industrial Raspberry Pi Sierra Wireless MC7304 3G Modem QMI Internet Connection Configuration Step 3

 

There are essentially 3 steps here:

1. Start the network interface

2. Connect to the cellular network

3. Run the DHCP client to configure the network interface and routing/DNS

So let's step through a sample connection here:

MyPi Industrial Raspberry Pi Sierra Wireless MC7304 3G Modem QMI Internet Connection Configuration Step 4

qmi-network /dev/cdc-wdm0 start
dhclient -v wwan0

You'll see that once the network connection is made the network interface just needs to be configured via dhclient, this has the bonus of automatically configuring routing and DNS.

MyPi Industrial Raspberry Pi Sierra Wireless MC7304 3G Modem QMI Internet Connection Configuration Step 5

 

Note that though as once the network connection is stopped the interface will need to be brought down (by ifconfig wwan0 down for example) to correct the routing/DNS.

The modemAT serial interface can be used as normal

For automatic connection at power up the below can be added by creating the configuration file /etc/network/interfaces.d/wwan0 with lines below:

  allow-hotplug wwan0
  iface wwan0 inet dhcp
     pre-up for _ in $(seq 1 10); do /usr/bin/test -c /dev/cdc-wdm0 && break; /bin/sleep 1; done
     pre-up for _ in $(seq 1 10); do /usr/bin/qmicli -d /dev/cdc-wdm0 --nas-get-signal-strength && break; /bin/sleep 1; done    
     pre-up /usr/bin/qmicli -d /dev/cdc-wdm0 --wda-set-data-format=802-3
     pre-up /usr/bin/qmi-network /dev/cdc-wdm0 start
     pre-up dhclient -v wwan0
     post-down /usr/bin/qmi-network /dev/cdc-wdm0 stop

Other commands of interest are shown below, for more information see man qmicli

	qmicli -d /dev/cdc-wdm0 --nas-get-signal-info
	qmicli -d /dev/cdc-wdm0 --nas-get-signal-strength
	qmicli -d /dev/cdc-wdm0 --nas-get-home-network
 

Automatic Modem Connection Info

MC73x4 AT Command Reference

MC73x4 Product Technical Guide

Contact us now to discuss your project

Ready to order, contact us today for pricing or samples

Contact Us