Setting up a data connection over QMI interface using libqmi
Revision and Notes
Date
Owner
Revision
Notes
08 Mar 2022
1.0
Initial release
Introduction
Cellular modules that are based on the Qualcomm chipsets support the QMI interface. The libqmi can be used to establish QMI interface for mini PCIe modules
Step-By-Step
1. Install the libqmi Linux library e.g. by using your system package manager like apt or preferably latest version from source on the Freedesktop pages for libqmi project: https://www.freedesktop.org/wiki/Software/libqmi/
2. Verify that you have the Linux in-kernel qmi_wwan driver installed and attached for the cellular modules QMI interface over USB using:
lsusb -tShould return driver information, it can look e.g like this:
|__ Port 3: Dev 3, If 4, Class=Vendor Specific Class, Driver=qmi_wwan, 480MYou can load the qmi_wwan kernel module by running:
root@sr-imx8:/home/debian# modprobe qmi_wwan
[ 3342.100394] usbcore: registered new interface driver cdc_wdm
[ 3342.109771] usbcore: registered new interface driver qmi_wwanThe cellular modules QMI control interface are usually named cdc-wdm* e.g.:
3.Install the required packages
4. Use the following command to make sure module is ready:
Should return 'online'. If not, try :
5. Configure the network interface for the raw-ip protocol
6. Set the wwan0 interface to raw mode
7. Restart the interface
8. Once the wwan0 is up, gather the APN information for your SIM card and start the qui network by changing the apn='YOUR_APN',username='YOUR_USERNAME',password='YOUR_PASSWORD' part of the line according to the information of your SIM & operator. If username and password are not required, delete those parameters.
You will get something similar to this:
Once “Network started” is displayed, you can send a DHCP request on the network interface.
9. Acquire an IP number from your provider
You will get something similar to this:
Checking the Connection
Now check the assigned IP address and test the connection
You will get something like this:
Test network connectivity:
You will get something similar to this:
Enjoy your internet connection !
Last updated