Skip to main content

4G Raspberry Pi HAT - QMI Mode Setup on Raspberry Pi OS

Introduction

This guide explains how to configure internet access on a Raspberry Pi using a 4G HAT equipped with a Quectel EG25-G module. The Quectel EG25-G is a widely-used LTE modem that supports multiple network protocols, including QMI (Qualcomm MSM Interface) mode, which enables efficient and high-speed mobile broadband connectivity. By following this guide, you will learn how to set up the module in QMI mode, compile and use the quectel-CM dial-up tool, and establish a stable 4G internet connection on your Raspberry Pi. This method is ideal for applications requiring mobile internet access, such as IoT deployments, remote monitoring, and edge computing.

Prerequisites

Hardware Requirements

Raspberry Pi 5Raspberry Pi 4G LTE CAT4 HAT

Software Prerequisites

Remove Previous Dialing Configurations

Before proceeding, ensure that any other dialing methods are removed to avoid conflicts.

  1. Verify Correct Serial Port

Run the following command to verify you are using the correct AT command port (replace /dev/ttyUSB2 if needed):

sudo minicom -D /dev/ttyUSB2
  1. Check and Set USB Network Mode

Inside the minicom terminal, input:

AT+QCFG="usbnet"?
  • If the response is usbnet,0, no changes are needed.

To explicitly set the mode to 0:

AT+QCFG="usbnet",0
  1. Restart the Module

Reset the module using:

AT+CFUN=1,1

Verify Kernel Driver(qmi_wwan and others)

Check if the qmi_wwan driver is loaded:

lsmod 
  • If you see output indicating qmi_wwan is loaded, the kernel driver is active.

Transplanting the Dial Tool

  1. Download and Extract the Tool
  • After downloading, unzip the package into your home directory.
  • Navigate to your home directory:
ls
  • You should see a folder named eg25qmi.
  1. Navigate to the Tool Directory
cd eg25qmi
ls
  • You will see source files for the dial-up tool.

Compilation

  1. Compile the Dialing Tool
sudo make
  • After compilation, newly generated files (highlighted in green) will be visible, including the quectel-CM dial-up tool.

Verify the Compiled Files

ls
  • The quectel-CM executable should be present. This is the dial-up tool required for connecting to the internet.

Dial-Up Internet Access

  1. Start Dialing
sudo ./quectel-CM
  • If the dialing process is successful, you will see an assigned IP address and gateway information.
  • If the first attempt fails, wait and retry; the second attempt should succeed.

Post-Dialing Verification

  1. Check Network Interface
ifconfig
  • Look for the wwan0 interface with an IP address.
  1. Test Connectivity
ping -I wwan0 8.8.8.8
  • A successful ping confirms the connection is active.

Tech Support & Product Discussion

Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.

Loading Comments...