Using your USB 4G LTE modem from the terminal (TPE-USB4G2US)

The following documentation applies to using your USB 4G LTE TPE-USB4G2US modem under Debian 12. It should also be applicable to Ubuntu 22.04, Trisquel 11, and other recent GNU/Linux distributions. If you think this documentation may need an update please reach out to support and make a request that we validate and update the directions where needed. Please include what distribution and release you are on. We try and keep documentation up to date, but with as many different distributions and frequent releases it can at times get stale.

1. Open a terminal if you have a graphical desktop environment installed

2. Become root or otherwise run the commands as an administrative user using sudo

sudo su

3. Install libqmi-utils and udhcpc

apt install libqmi-utils udhcpc

4. If ModemManager is installed stop ModemManager

systemctl stop ModemManager

5. Run the below command to confirm that the modem is in qmi mode:

lsusb -t

Example output:

|__ Port 2: Dev 2, If 4, Class=Vendor Specific Class, Driver=qmi_wwan, 480M

The above output shows the qmi_wwan driver is loaded

6. Determine the modem's interface:

sudo qmicli --device=/dev/cdc-wdm0 --device-open-proxy --get-wwan-iface

Example output:

wwan0

Note: If your modem does not show up as wwan0 replace wwan0 in any commands after this step with the output from running the above command

7. We're going to bring down the modem and then make sure it's in raw_ip mode and bring it back up again by running these commands:

ip link set dev wwan0 down
echo Y > /sys/class/net/wwan0/qmi/raw_ip
ip link set dev wwan0 up

8. Connect to the network by replacing broadband with the APN for your cellular provider and running the below command:

qmicli --device=/dev/cdc-wdm0 --device-open-proxy --wds-start-network="ip-type=4,apn=broadband" --client-no-release-cid

Example output:

[/dev/cdc-wdm0] Network started
Packet data handle: '2264374642'
[/dev/cdc-wdm0] Client ID not released:
Service: 'wds'
CID: '13'

9. Request an IP address from the cellular provider:

udhcpc -q -f -n -i wwan0

10. Check to see if you are connected:

ping -c 5 8.8.8.8

Example output:

5 packets transmitted, 5 received, 0% packet loss, time 4008ms

You should see a line with 0% packet loss assuming you have a stable connection.

You should now be connected to the internet via your cellular provider.