To get rid of the legacy cruft, newer ways to present USB-connected LTE modems like QMI and MBIM have been developed. Quectel modules offer QMI(Qualcomm MSM Interface) which is established as a real network interface, such as ethernet(typically shows as wwan0). There is an open source Linux in-kernel driver supporting this interface called qmi_wwan.
The QMI is also counted among the non-AT protocols which are communicated over /dev/cdc-wdm0 port. In order to establish a connection, proper qmi/gobinet proxy should be installed, which again depending on the chipset of the module/modem and the kernel of Linux, can get a bit complicated.
Warning: In this tutorial, the QMI interface was established using the connect manager program(quectel-CM tool) provided by Quectel. This tutorial will not work for modules from other OEM, it is only for Quectel.
Software Setup
1. Open a new terminal and run the update and upgrade command.
sudo apt update && sudo apt upgrade -y
Next, install the Raspberry Pi kernel headers needed for the QMI Interface.
sudo apt-get install raspberrypi-kernel-headers
Download the QMI installer file, and change the permission of the installation file. Then install it.
Set apn/user/password/auth get -p pincode from your network provider, verify sim card pin if sim card is locked -f log filename, save log message of this program to the file.
quectel-CM will send QMI message to the module via QMI channel to setup data connection. Please refer to the following message to use quectel-CM:
Example 1: ./quectel-CM Example 2: ./quectel-CM -s 3gnet Example 3: ./quectel-CM -s 3gnet carl 1234 0 -p 1234 -f gobinet_log.txt
⚙️ Module Configuration
Before running the PPP/QMI make sure the module is configured to the right settings. AT+QCFG=”usbnet” should return 0, otherwise,send AT+QCFG=”usbnet”,0 then reboot the module after 10 seconds AT+CFUN=1,1
2. It will then ask for APN. Type in your APN and then press ENTER.
pi@raspberrypi:~ $ sudo ./install_auto_connect.sh
What is the APN?
<YOUR_APN>
–2020-12-03 12:07:39– https://raw.githubusercontent.com/sixfab/Sixfab_RPi_3G-4G-LTE_Base_Shield/master/tutorials/QMI_tutorial/reconnect_service
Resolving raw.githubusercontent.com
…
Saving to: ‘qmi_reconnect.service’qmi_reconnect.service 100%[=========================================================>]
264 –.-KB/s in 0s2020-12-03 12:07:39 (2.63 MB/s) – ‘qmi_reconnect.service’ saved [264/264]
…
Saving to: ‘qmi_reconnect.sh’qmi_reconnect.sh 100%[=========================================================>]
224 –.-KB/s in 0s2020-12-03 12:07:40 (1.32 MB/s) – ‘qmi_reconnect.sh’ saved [224/224]Created symlink /etc/systemd/system/multi-user.target.wants/qmi_reconnect.service → /etc/systemd/system/qmi_reconnect.service.
DONE
3. The name of the service is qmi_reconnect. To check if the service is active you can type the following. If it is working fine then you will be able to see active(running) in green.
Uninstall
pi@raspberrypi:~ $ sudo systemctl status qmi_reconnect.service
● qmi_reconnect.service – QMI Auto Connection
Loaded: loaded (/etc/systemd/system/qmi_reconnect.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2021-01-29 12:15:25 GMT; 2min 4s ago
Main PID: 2730 (sh)
Tasks: 4 (limit: 3861)
CGroup: /system.slice/qmi_reconnect.service
├─ 2730 /bin/sh /usr/src/qmi_reconnect.sh
├─13529 sudo ./quectel-CM -s super
└─13530 ./quectel-CM -s super
If you are using auto-connect/reconnect service, stop the service and disable it.
We recommend going through the section on troubleshooting as it covers the more common issues with establishing and maintaining a network connection. Please check the troubleshooting of your shield/HAT.