Data Connections

Log in to the development board via the network (Ethernet, Wi-Fi) or the USB serial console.

Use the following commands to test basic connectivity.

Basic Tests

This basic test uses Modem Manager to verify that the modem is visible to the system, and will work without a SIM card:

purism@pureos:~$ mmcli -m 0

Alternatively, pipe and filter the output of this command to get information about the modem:

purism@pureos:~$ sudo mmcli -m 0 | grep SIM
             |                model: SIMCOM_SIM7100A
  SIM      |            dbus path: /org/freedesktop/ModemManager1/SIM/0

With a SIM card inserted, the following commands can be used to access the mobile network by authenticating with a pin and enable the modem:

mmcli -i 0 --pin=<yourpin>
mmcli -m 0 --enable

Use the modem to access the Internet, substituting the appropriate value for <APN address> from the Access Point Network (APN) setting for your service provider:

mmcli -m 0 --simple-connect="apn=<APN address>"

When you no longer need to access the Internet via the modem, use this command to disconnect:

mmcli -m 0 --simple-disconnect

Using a Cellular Connection

Find the primary port of the modem set up to access the Internet:

purism@pureos:~$ mmcli -m 0 | grep 'primary port'
           |   primary port: cdc-wdm0

In the above output, the primary port is cdc-wdm0.

Configure a network connection via a modem configured to access the Internet using the following command, substituting values for <interface>, <name> and <APN address>:

purism@pureos:~$ sudo nmcli connection add type gsm ifname <interface> con-name <name> apn <APN address>

The <interface> is the primary port that was obtained above, <name> is the name used to refer to the connection, and the <APN address> is the same as the one used to set up the modem in the previous section.

The connection can be taken down using the following command, where <name> is the connection name defined above:

purism@pureos:~$ sudo nmcli connection down <name>

The connection can be brought back up again with up instead of down.

Examples

Connect to T-Mobile’s Access Point Network (APN):

purism@pureos:~$ sudo mmcli -m 0 --simple-connect="apn=fast.t-mobile.com"

Connect to the Internet:

purism@pureos:~$ sudo nmcli connection add type gsm ifname <interface> con-name mygsm apn fast.t-mobile.com
Connection 'mygsm' (86515014-9d34-467e-bbce-49a344580119) successfully added.

where <interface> is the primary port listed in the System section of mmcli -m 0. An example of this is cdc-wdm0.

Route network traffic via the WWAN interface:

purism@pureos:~$ nmcli radio wwan on

Verify that you have an IP address:

purism@pureos:~$ ip address show wwan0
4: wwan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN group default qlen 1000
    link/ether 8a:1f:ce:32:ef:e6 brd ff:ff:ff:ff:ff:ff
    inet 29.20.162.181/30 brd 29.20.162.183 scope global dynamic noprefixroute wwan0
       valid_lft 6988sec preferred_lft 6988sec

You should now be able to browse the web and access online services via this interface. Don’t forget to disconnect when you have finished testing.

References and Notes

See the Ubuntu NetworkManager documentation for more information about configuring the modem for a network connection.

The nm-connection-editor graphical application can also be used to create a named Network Manager connection instead of defining one using the nmcli command line tool.