USB Connect LPWA based on Qualcomm Chipsatz supporting QMI interface. QMI is Qualcomm's proprietary protocol for using Virtual Ethernet on the USB-Connect LPWA to establish IP connectivity with the mobile operator. It can replace the AT commands or be used together with the serial port. Software 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
Code Block |
---|
sudo apt-get update
sudo apt-get install libqmi-utils udhcpc
sudo reboot |
Step 2: Stop and disable the following common packages the next time you boot to ensure proper modem operation and to avoid interference.
Code Block |
---|
sudo systemctl stop ModemManager.service
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
Code Block |
---|
sudo qmicli -d /dev/cdc-wdm0 --dms-get-operating-mode |
...
Code Block |
---|
sudo qmicli -d /dev/cdc-wdm0 --dms-set-operating-mode='online' |
Step 4: Shutting down the interface
Code Block |
---|
sudo ip link set wwan0 down |
Code Block |
---|
echo 'Y' | sudo tee /sys/class/net/wwan0/qmi/raw_ip |
Step 6: Restart the interface
Code Block |
---|
sudo ip link set wwan0 up |
Code Block |
---|
sudo qmicli -d /dev/cdc-wdm0 --wda-get-data-format |
You will get something similar to that:
Code Block |
---|
[/dev/cdc-wdm0] Successfully got data format
QoS flow header: no
Link layer protocol: 'raw-ip'
Uplink data aggregation protocol: 'disabled'
Downlink data aggregation protocol: 'disabled'
NDP signature: '0'
Downlink data aggregation max datagrams: '0'
Downlink data aggregation max size: '0' |
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.
Code Block |
---|
|
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 |
...
Code Block |
---|
[/dev/cdc-wdm0] Network started
Packet data handle: '21987132162198768960'
[/dev/cdc-wdm0] Client ID not released:
Service: 'wds'
CID: '2' |
Step 9: Configure the IP address and default route using udhcpc
Code Block |
---|
sudo udhcpc -q -f -i wwan0 |
...
Code Block |
---|
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.
You will get something similar to that:
Code Block |
---|
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
Code Block |
---|
ping -I wwan0 -c 5 exelonix.com |
You will get something similar to that:
Code Block |
---|
PING sixfabexelonix.com (1725.67189.75154.126234) from 10010.67254.11446.16434 wwan0: 56(84) bytes of data.
64 bytes from 172mail.67exelonix.75.126com (1725.67189.75154.126234): icmp_seq=1 ttl=2950 time=247113 ms
64 bytes from 172mail.67exelonix.75.126com (1725.67189.75154.126234): icmp_seq=2 ttl=2950 time=20572.4 ms
64 bytes from 172mail.67exelonix.75.126com (1725.67189.75154.126234): icmp_seq=3 ttl=2950 time=2071426 ms
64 bytes from 172mail.67exelonix.75.126com (1725.67189.75154.126234): icmp_seq=4 ttl=2951 time=2041568 ms
64 bytes from 172mail.67exelonix.75.126com (1725.67189.75154.126234): icmp_seq=5 ttl=2950 time=2161444 ms
--- sixfabexelonix.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 8ms5173ms
rtt min/avg/max/mdev = 20472.050382/215924.839626/2471567.004907/16681.201326 ms, pipe 2 |