PCIe TO 4G/5G M.2 USB3.2 HAT+

From Waveshare Wiki
Jump to: navigation, search
PCIe TO 4G/5G M.2 USB3.2 HAT+

PCIe TO 4G/5G M.2






PCIe TO 4G/5G M.2 USB3.2 HAT+ is a PCIe to USB3.2/M.2 adapter board designed for Raspberry Pi 5, is compatible with 5G modules in 3042/3052 size, supports Gen2 mode and high-speed communication.


  • Designed for Raspberry Pi 5, HAT+ standard design with onboard I2C EEPROM, and supports Raspberry Pi 40PIN GPIO stackable expansion.
  • Support PCI-E×1 Gen2 mode.
  • Extends 3x high-speed USB 3.2 Gen1 ports for connecting more peripherals.
  • Onboard M.2 (NGFF) Key B slot, supports SIM7600XX-M.2, SIM82XX and RM5XX series 4G/5G modules and is compatible with 3042/3052 packages.
  • Onboard Type-C port for connecting to a PC for 4G/5G networking, debugging and firmware updating, or external power supply input.
  • Onboard power monitoring chip for real-time measurement of voltage, current and power.
  • Onboard SIM card slot for NANO-SIM card.
  • Onboard Reset button, Power and Network indicators for easy debugging and monitoring operating status.
  • Comes with customized 5G-4IN1-PCB Antenna for neat wiring management, supports top or bottom installation.
  • Reserved airflow vent and mounting holes for cooling fan to increase airflow and provide better heat dissipation.



How to Use

Hardware Connection

Pay attention to the direction of the wires and connect as shown in the figure:

How to Install Antennas

The 5G PCBA antenna with this product can be installed through the screw pack, and the top installation method is recommended.

Control via DIP Switch

The onboard module power on/off and restart functions are controlled by DIP switches connected to Raspberry Pi GPIO5 and GPIO6. By toggling the DIP switches, the Raspberry Pi can control the module's power and restart functions.
By default, please turn on the onboard DIP switch for RST and keep PWR off.

Reboot or Power On/Off Module with Demo

Control GPIO pins with python gpiozero, and the high/low level switch should be adjusted according to the actual status (power on/off, rebooting time sequence) of the module.

import subprocess
from gpiozero import LED
import time
# led = LED(5) #Ctl On/off 
led = LED(6) #Ctl Restart

Description of Dialing Modes for Various Modules

Different modules correspond to different dialing methods, which are mainly divided into four types:
1. DNIS (Dialed Number Identification Service):

DNIS is a telecommunication network service used to identify the dialed number when receiving a call. It is mainly used in call centers and PBX systems. By transmitting the dialed number information, DNIS helps the system take different actions based on the dialed number. This can be used for routing calls or providing specific services.

2. RNDIS (Remote Network Driver Interface Specification):

RNDIS is a network device interface standard defined by Microsoft. It allows USB devices (such as smartphones, modems) to share their network connections through a USB connection.

3. ECM (Ethernet Control Model):

ECM is a USB network control model mainly used for USB to Ethernet conversion. Many USB-to-Ethernet adapters use this model.

4. MBIM (Mobile Broadband Interface Model):

MBIM is a modern USB network interface model for mobile broadband devices defined by USB-IF. It supports more efficient network connections and a wider range of network functions for modern cellular modems.

Various Modules Dialing Modes Switch

1. SIMxx:

AT+CUSBCFG=usbid,1e0e,9001     # NDIS requires network card to be loaded through dial-up tools
AT+CUSBCFG=usbid,1e0e,9011     # RNDIS, ECM automatically load network card for internet access
AT+CUSBCFG=usbid,1e0e,901E     # MBIM automatically loads network card for internet access

2. RMxxx:

AT+QCFG="usbnet",0     # NDIS(qmi) requires network card to be loaded through dial-up tools
AT+QCFG="usbnet",1     # ECM automatically loads network card for internet access
AT+QCFG="usbnet",2     # MBIM requires network card to be loaded through dial-up tools
AT+QCFG="usbnet",3     # RNDIS automatically loads network card for internet access

Install and Use DIP Tools

Using the following commands to install waveshare-CM dialing tools:

wget -O - https://files.waveshare.com/wiki/PCIe-TO-4G-5G-M.2-USB3.2-HAT-Plus/install.sh | sudo bash

After installation, if NDIS (qmi) or MBIM cannot automatically dial-up, use a dial-up tool to connect to the internet. YOUR_APN is the APN used by the SIM card.

sudo waveshare-CM
# or
sudo waveshare-CM -s YOUR_APN

Power Monitoring

The onboard INA219 chip can detect the voltage and current, easy to monitor the device status and monitor the input 5V voltage status (not 3.3V).
The default I2C address is 0x40, addresses can be modified via back resistors to support stacking of different expansion boards. Demo:

wget https://files.waveshare.com/wiki/PCIe-TO-M.2-HAT%2B/PCIe_TO_M.2_HAT%2B.zip
unzip -o PCIe_TO_M.2_HAT+.zip -d ./PCIe_TO_M.2_HAT+
cd PCIe_TO_M.2_HAT+
sudo python INA219.py
PCIe TO M.2 HAT+ W 8.png

Windows System Network Access

To connect this product to Windows and access the internet, set the module to USB mode and connect it to Windows using the onboard Type-C interface. Use the following commands:

SIM8262XX Series Modules

Use a serial tool to connect and switch the module mode to automatic dialing.


RM5xxx Series Modules

Modify the data channels of the module to USB:






SIM8262 Series Modules

For resources about SIM8262E-M2 HAT, please refer to SIMCom

RM5xx Series Modules

Driver Files

SIM8262 Series Modules

RM5xx Series Modules



This situation may be caused by an error with the DNS server on the Raspberry Pi. In this case, you need to manually set the DNS.



Firstly, you need to understand the difference between laboratory data and real data. In practice, due to insufficient base stations and poor signal coverage, there are many gaps in 5G coverage, so the network speed may not reach its peak. Under normal conditions, the 4G upload speed is stable at 20-40 Mbps, and the 5G upload speed is stable at 100 Mbps (the fewer people and the closer to the base station, the faster the speed).



It might have switched to SIM card 2. Please use the following command to switch to SIM card 1:


To switch to SIM card 2, use the following command (some HATs have SIM2):


If it still doesn't work, consider if the flight mode is enabled. Use the following command to disable flight mode:



  • If only the socket is broken, you can replace it with a new socket.
  • If the copper foil is also broken, it usually cannot be repaired.
  • When removing it, please wiggle it gently from side to side and pull it out with balanced force, do not pull it forcibly.
  • The IPEX4 generation socket is relatively fragile, so please be more careful and cautious when using it.



Technical Support

If you need technical support or have any feedback/review, please click the Submit Now button to submit a ticket, Our support team will check and reply to you within 1 to 2 working days. Please be patient as we make every effort to help you to resolve the issue.
Working Time: 9 AM - 6 PM GMT+8 (Monday to Friday)