Establishment of a data connection via the QMI interface with libqmi
USB Connect LPWA based on Qualcomm chipset supporting QMI interface.
libqmi can be used to install the QMI interface for modules
This is a brief tutorial to establish the connection
Step 1: Install the required packages
sudo apt-get update sudo apt-get install libqmi-utils udhcpc sudo reboot
Step 2: …
sudo systemctl disable ModemManager.service sudo reboot
Step 3: Now make sure that the module is ready for use, this can be done by using the following command
sudo qmicli -d /dev/cdc-wdm0 --dms-get-operating-mode
If not, this should bring you back online:
sudo qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode='online'
Step 4: Shutting down the interface
sudo ip link set wwan0 down
Step 5: The next step is to configure the network interface for the raw-ip protocol.
echo 'Y' | sudo tee /sys/class/net/wwan0/qmi/raw_ip
Step 6: Restart the interface
sudo ip link set wwan0 up
Step 7: You can confirm the data format with
sudo qmicli -d /dev/cdc-wdm0 --wda-get-data-format
Step 8: Connect to the mobile network by changing the part of the 'YOUR_APN', 'YOUR_USERNAME', 'YOUR_PASSWORD' lines according to your SIM card details. Remove these options if a user name and password are not required.
sudo qmicli -p -d /dev/cdc-wdm0 --device-open-net='net-raw-ip|net-no-qos-header' --wds-start-network="apn='YOUR_APN',username='YOUR_USERNAME',password='YOUR_PASSWORD',ip-type=4" --client-no-release-cid
You will get something similar to that:
[/dev/cdc-wdm0] Network started Packet data handle: '2198713216' [/dev/cdc-wdm0] Client ID not released: Service: 'wds' CID: '2'
Step 9: Configure the IP address and default route using udhcpc
sudo udhcpc -q -f -i wwan0
You will get something similar to that:
sudo udhcpc -q -f -i wwan0 udhcpc: started, v1.30.1 No resolv.conf for interface wwan0.udhcpc udhcpc: sending discover udhcpc: sending select for 100.67.114.164 udhcpc: lease of 100.67.114.164 obtained, lease time 7200 Too few arguments. Too few arguments.
Step 10: Check the assigned IP address and test the connection.
ifconfig wwan0
You will get something similar to that:
wwan0: flags=4305 mtu 1500 inet 100.67.114.164 netmask 255.255.255.248 destination 100.67.114.164 inet6 fe80::abc4:a1b5:5e84:92f2 prefixlen 64 scopeid 0x20 unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 1000 (UNSPEC) RX packets 3 bytes 640 (640.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 13 bytes 2694 (2.6 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Step 11: To test the connection
ping -I wwan0 -c 5 exelonix.com
You will get something similar to that:
PING sixfab.com (172.67.75.126) from 100.67.114.164 wwan0: 56(84) bytes of data. 64 bytes from 172.67.75.126 (172.67.75.126): icmp_seq=1 ttl=29 time=247 ms 64 bytes from 172.67.75.126 (172.67.75.126): icmp_seq=2 ttl=29 time=205 ms 64 bytes from 172.67.75.126 (172.67.75.126): icmp_seq=3 ttl=29 time=207 ms 64 bytes from 172.67.75.126 (172.67.75.126): icmp_seq=4 ttl=29 time=204 ms 64 bytes from 172.67.75.126 (172.67.75.126): icmp_seq=5 ttl=29 time=216 ms --- sixfab.com ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 8ms rtt min/avg/max/mdev = 204.050/215.839/247.004/16.201 ms