# MQTT 4G Module with ESP32 User Manual

> Source: https://maker.tdlogy.com/wiki-doc/mqtt-4g-module-with-esp32-user-manual/

In this article, I will guide you to connect ESP to a 4G module using the PPPoS protocol

With the use of the PPPoS protocol, the SIM module will act as a network driver just like Wi-Fi and Ethernet.

1. Connect

ESP32Module SIM5VVinGNDGNDGPIO 17 (MCU-TX)RXGPIO 16 (MCU-RX)&nbsp;TXGPIO 15 (MCU-RX)PEN (Power Enable)

2. Sample code

ESP32 ESP-IDF:

ESP32 Arduino:

3. Test

I use ESP-IDF to test the connection to the mqtt server test.mosquitto.org:1883

Directions for use:

AT Command Test Software