QMI interface has been mostly asked tutorial Quectel UC20 / Quectel EC25 with our Sixfab 3G-4G/LTE Base Shield v2.

In this tutorial we will be demonstrating you the process step by step. Without further ado, lets get started.

Hardware Setup

  1. Plug Quectel EC25 Mini PCIe module to the Sixfab 3G-4G/LTE Base Shield v2.
  2. Connect required antennas to EC25 module. (Antenna Connecting Guide will be Available soon!)
  3. Attach the Shield on top of your Raspberry Pi and connect the micro-USB cable that comes with the Shield.
Note:

Make sure you are using original Raspberry Adapter as your power source.

Software Setup

  1. First run update
    sudo apt-get update
  2. Install Raspberry Pi kernel headers.

    sudo apt-get install raspberrypi-kernel-headers

  3. Check installed kernel headers packet version ls /usr/src
    In our case, it is 4.14.79

  4. Now open your browser and go to rpi-firmware github repository commits

  5. Here, find out your version and click on <> button to browse the repository at that point in the history.


  6. From the link copy the hash as shown in the image below.


  7. Now go back your terminal and update rpi in following format. Replace the term <hash> with your hash as shown in the image.
    sudo rpi-update <hash>


  8. Reboot your Raspberry Pi in order to activate the new firmware.
  9. After rebooting, download qmi_installer.sh script.
    wget https://gist.githubusercontent.com/saeedjohar/0fa8c8d1f1c1ae286a9cfd22db5bfc87/raw/7c15a2f89efcf38168d2e7bae10a24957bc7eede/qmi_install.sh


  10. Change the permission of the script.
    sudo chmod +x qmi_install.sh


  11. Run the installer script
    sudo ./qmi_install.sh


  12. At the end of installation enter any key to reboot your Raspberry Pi.
  13. |Open and change your directory to files/quectel-CM
    cd /files/quectel-CM


  14. Now run the following command to connect to the Internet
    sudo ./quectel-CM -s internet
    Here internet is the APN for the network provider.
    Don’t forget to replace it with your APN.


  1. Now you can check you IP using
    ifconfig wwan0


20 thoughts on “QMI Interface with 3G-4G/LTE Base Shield v2”

  1. Hi Saeed. Any idea as to why when using the qmi interface everything appears to be fine (device has an IP, route, etc…) but in fact ping fails, dns lookup will fail,…networking will fail. If I install the ppp installer everything will work perfectly.
    Thanks

    1. Hi Andy, Could you please send me the image of your setup?
      Did you update before starting the installation process with

      sudo apt-get update

    1. PPP uses a dialing number to establish a data connection

      QMI does not use dialling or the PPP protocol to establish a data connection and it is usually faster than PPP mode.

  2. I get:
    sudo qmicli -d /dev/cdc-wdm0 –wds-start-network=apn=’xxxx.com’ client-no-release-cid
    error: couldn’t start network: QMI protocol error (14): ‘CallFailed’
    call end reason (3): generic-no-service

    The SIM is connected I can at+cnum and I see the cell number

    I assume it means the cell network is not connected or the SIM is not in the slot. The SIM tested good in another modem. I am using a Telit LE910Cx.

    Any thoughts?

  3. I had to add a default route out of wwan0 to make it work right because I was configuring it via Wifi to make it work. It might be that.

  4. Hey Saeed,

    Thanks for this work. it makes the job much easier. QQ on the output. I have followed the guide and got it working but in my output is says “too few arguments”

    [email protected]:~# quectel-CM -s pp.vodafone.co.uk wap wap pap -f /var/log/VF-output.log
    [03-16_21:38:38:166] WCDMA&LTE_QConnectManager_Linux&Android_V1.1.45
    [03-16_21:38:38:167] quectel-CM profile[1] = pp.vodafone.co.uk/wap/wap/64, pincode = (null)
    [03-16_21:38:38:169] Find /sys/bus/usb/devices/1-1.1.3 idVendor=2c7c idProduct=0125
    [03-16_21:38:38:169] Find /sys/bus/usb/devices/1-1.1.3:1.4/net/wwan0
    [03-16_21:38:38:169] Find usbnet_adapter = wwan0
    [03-16_21:38:38:169] Find /sys/bus/usb/devices/1-1.1.3:1.4/usbmisc/cdc-wdm0
    [03-16_21:38:38:169] Find qmichannel = /dev/cdc-wdm0
    [03-16_21:38:38:192] cdc_wdm_fd = 8
    [03-16_21:38:38:269] Get clientWDS = 20
    [03-16_21:38:38:301] Get clientDMS = 1
    [03-16_21:38:38:333] Get clientNAS = 4
    [03-16_21:38:38:365] Get clientUIM = 1
    [03-16_21:38:38:397] Get clientWDA = 1
    [03-16_21:38:38:429] requestBaseBandVersion EC25EFAR06A03M4G
    [03-16_21:38:38:557] requestGetSIMStatus SIMStatus: SIM_READY
    [03-16_21:38:38:557] requestSetProfile[1] pp.vodafone.co.uk/wap/wap/64
    [03-16_21:38:38:621] requestGetProfile[1] pp.vodafone.co.uk/wap/wap/64
    [03-16_21:38:38:653] requestRegistrationState2 MCC: 234, MNC: 15, PS: Attached, DataCap: LTE
    [03-16_21:38:38:685] requestQueryDataCall IPv4ConnectionStatus: DISCONNECTED
    [03-16_21:38:38:749] requestRegistrationState2 MCC: 234, MNC: 15, PS: Attached, DataCap: LTE
    [03-16_21:38:38:781] requestSetupDataCall WdsConnectionIPv4Handle: 0x87309130
    [03-16_21:38:38:845] requestQueryDataCall IPv4ConnectionStatus: CONNECTED
    [03-16_21:38:38:877] ifconfig wwan0 up
    [03-16_21:38:38:887] busybox udhcpc -f -n -q -t 5 -i wwan0
    [03-16_21:38:38:914] udhcpc (v1.22.1) started
    No resolv.conf for interface wwan0.udhcpc
    [03-16_21:38:39:020] Sending discover…
    [03-16_21:38:39:110] Sending select for 10.33.44.170…
    [03-16_21:38:39:210] Lease of 10.33.44.170 obtained, lease time 7200
    Too few arguments.
    Too few arguments.

    What is going on there? I have included the command to start it.

  5. Hey Saaed,

    I had to rebuild my Pi for a project and I have noted now that i have put it back again I am not getting a lease from Vodafone (My carrier) on a known working SIM.

    Do I need to put anything specific into /etc/network/interfaces to cater for DHCP requests or is there anything the busybox instance would need to get a lease?

    I have tried two working SIM cards and the unit times out on getting a lease now.

      1. Its ok. I recompiled it and it worked. I think I had a header mismatch in my rush to get it working. Thanks for the quick reply

  6. Just got a successful connection using the QMI interface via sudo ./quectel-CM -s ‘APN’

    I would like this to run at startup automatically after each reboot, as I assume this is the only way to have the device online after reboot without manually executing sudo ./quectel-CM -s ‘APN’ is that correct?

    Any recommendations for setting this to run at startup? I’m novice but was able to write a shell script that runs sudo ./quectel-CM -s ‘APN’ (and it works) but am having trouble getting this to run automatically at startup via rc.local. For current version of Debian, it sounds like a systemd configuration would be preferable. Is systemd the best option, and if so does Sixfab have a systemd init file example that works?

Leave a Reply

Your email address will not be published. Required fields are marked *