Cellular Connection

To establish a cellular data link, you must configure and initiate a PPP connection. Sample options files and chat scripts are provided in the ppp peers directory /etc/ppp/peers. Anything specific to the network or connection should be placed in one of these files. Global options should be placed in /etc/ppp/options.

To run the pppd command, the user must either have root privilege, or be a member of the dialout group. Use  the default administrator, mtadm, since it’s already a member of the dialout group.

See the man pages on your development system for additional chat and pppd information.

NOTE: When attempting to verify or set the APN, in the chat script, make sure cfun does NOT equal 0 and cops does NOT equal 2.

Set Up Cellular Data Connection


# Set "APN" to the APN for your cellular provider 
$ mlinux-set-apn APN
# Dial the connection (using /etc/ppp/peers/gsm config)
$ pppd call gsm

For MTCDT-LVW2, MTCDT-L4G1 (Verizon SIM)

# Dial the connection (using /etc/ppp/peers/lvw2 config)
$ pppd call lvw2

For  MTCAP-LSP3 (or other Sprint LTE devices)

# Before establishing PPP connection, modify the file, /etc/ppp/options
sudo -s
echo -e '+ipv6\nipv6cp-use-ipaddr' >>/etc/ppp/options
# Dial the connection (using /etc/ppp/peers/lsp3 config)
$ pppd call lsp3

See information on LSP device (Sprint LTE) activation.

Chat Scripts for Modems with a firmware switch capability (includes -LNA3 and -L4N1)  

NOTE: The example shown is for an MTCAP-LNA3.  For other models, simply replace instances of lna3 with your applicable model like l4n1.

There are two chat scripts, /etc/ppp/peers/lna3_chat_non_vz and /etc/ppp/peers/lna3_chat_vz. These are selected by a link, /etc/ppp/peers/lna3_chat.

The Verizon script should never be edited. The non-vzw script should be edited if the AT&T APN changes, or if the IP type IP changes, or the SIM is not AT&T.

The APN can be changed with the script mlinux-set-apn if needed (not required for Multitech provided SIM):

$ mlinux-set-apn "phone"

To switch the firmware and APN together to the current SIM:

$ mlinux-switch-apn
Cellular radio is ready.
Cellular radio is ready.
Setting chat script to /etc/ppp/peers/lna3_chat_non_vz

If the system is rebooted it will switch the firmware and chat to the current SIM. If ppp is set up to start on boot, it will be necessary to reboot twice. The first time switches the firmware, and the 2nd boot connects using PPP. The firmware switch follows the PPP connection, so as not to disrupt the normal case. If PPP is configured, and the firmware and chat are not correct, by default PPP will wait for 60 seconds for the modem.

If one wishes to switch the firmware and chat without a SIM:

Switch the firmware and chat to Verizon (order dependent):

$ mlinux-switch-cell-fw 1
$ mlinux-switch-apn 1

If the value provided is 0 instead of 1,  the firmware and APN switches to AT&T (or non-Verizon if using another carrier).  A new device has the value of 0.

Again, the dialing instructions for -LNA3 are similar to the other products:

# Dial the connection (using /etc/ppp/peers/lna3 config)
$ pppd call lna3

Verify ppp0 is up

The route Linux utility can be used to verify the ppp0 interface is now the default route:

$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         UG    0      0        0 ppp0    *      UH    0      0        0 ppp0     *        U     0      0        0 eth0

The ifconfig Linux utility can be used to inspect the ppp0 interface details.

$ ifconfig ppp0
ppp0      Link encap:Point-to-Point Protocol  
          inet addr:  P-t-P:  Mask:
          RX packets:7 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 
          RX bytes:106 (106.0 B)  TX bytes:145 (145.0 B)

Additionally, you can view the pppd logs in /var/log/messages to see the modem dialing and assigned IP address or errors if the connection was unsuccessful.

Stop a PPP Connection

# send SIGTERM to pppd, which causes it to hang up and exit cleanly     
$ killall pppd

More Information