How do I get clean AT Command Output on my ESP32 38 PINS and my SIMA7670E? Using Arduino IDE at Serial Monitor

Hi, I just wanted to ask a help regarding my project. I need to send data using my ESP32 38 Pins and SIMA7670E GSM Module. I tried AT command testing via PC, and it went well. However, whenever I've tried to test the AT Commands with ESP32, it shows unreadable text.

My A7670E pins are: VCC, GND, RXD, TXD, VDD, PWR_EN, GND

Here's how I connected their wires:
A7670E VCC TO EXTERNAL 5V 2.4A
A7670E GND TO EXTERNAL GND
ESP32 GND TO COMMON GND (WHERE EXTERNAL GND IS CONNECTED)

A7670E RXD TO GPIO19 TX
A7670E TXD TO GPIO 18 RX
A7670E PWR_EN TO GPIO4

I TRIED USING A DIFFERENT BAUD RATE, BUT IT WAS STILL UNREADABLE
HERE IS THE CODE I USE TO RUN IN ARDUINO IDE

#include "HardwareSerial.h"

HardwareSerial simSerial(2); // UART2 for GSM

const int PWR_EN = 4; // GPIO4 controls module power

void setup() {
  Serial.begin(115200);                   
  simSerial.begin(115200, SERIAL_8N1, 19, 18); // RX=19, TX=18
  pinMode(PWR_EN, OUTPUT);

  Serial.println("Starting ESP32 -> A7670E Auto Test...");

  // Power on GSM module
  Serial.println("Powering on A7670E...");
  digitalWrite(PWR_EN, HIGH); // Pulse HIGH to power on
  delay(1000);                // Hold for 1 second
  digitalWrite(PWR_EN, LOW);  // Release
  delay(3000);                // Wait for module to start

  // Test commands
  sendATCommand("AT");
  sendATCommand("AT+CSQ");
  sendATCommand("AT+CREG?");
}

void loop() {
  // Forward A7670E responses to Serial Monitor
  while (simSerial.available()) {
    char c = simSerial.read();
    Serial.write(c);
  }
}

// Helper function to send AT command and display response
void sendATCommand(String cmd) {
  Serial.print("Sending: ");
  Serial.println(cmd);
  simSerial.println(cmd);
  delay(1000); // Wait for response
  while (simSerial.available()) {
    char c = simSerial.read();
    Serial.write(c);
  }
  Serial.println("\n-------------------");
}

I hope someone can help me fix the unreadable text (gibberish text)

THIS IS THE ESP32 I HAVE:

THANK YOU GUYS!

try a simple program where you enter AT commands and check for response
e.g. change GPIOs to suit your setup

// ESP32  Serial1 test - for loopback test connect pins RXD1 and TXD1

#define RXD1 16 // can map Serial1 and Serial2 to many ESP32 GPIO pins
#define TXD1 17 // check pin usage https://randomnerdtutorials.com/esp32-pinout-reference-gpios/

// for RS232 shield connect
// ESP32 RXD1 to TTL/RS232 Rx
// ESP32 TXD1 to TTL/RS232 Tx
// connect GND pins together and VCC to 3.3V on ESP32 5V on UNO ect
// for loopback test connect 9-pin D_type connector pins 2 Tx to 3 Rx (pin 5 is GND)

void setup() {
  // initialize both serial ports:
  Serial.begin(115200);
  Serial1.begin(115200, SERIAL_8N1, RXD1, TXD1);
  Serial.printf("\n\nESP32 serial1  test RXD1 pin %d TXD1 pin %d\n", RXD1, TXD1);
  Serial.printf(" loopback test connect pin %d to pin %d\n", RXD1, TXD1);
  Serial.printf("RS232: ESP32 pin %d RXD1 to TTL/RS232 Rx and pin %d TXD1 to TTL/RS232 Tx\n", RXD1, TXD1);
  Serial.printf("RS232 - loopback connect 9-pin D-type pin 2 Tx to pin 3 Rx\n");
}

void loop() {
  // read from Serial1, send to Serial
  if (Serial1.available()) {
    int inByte = Serial1.read();
    Serial.write(inByte);
  }
  // read from Serial, send to Serial1
  if (Serial.available()) {
    int inByte = Serial.read();
    //Serial.write(inByte);     // local echo if required
    Serial1.write(inByte);
  }
}

serial monitor output when AT commands entered

*ATREADY: 1

+CPIN: SIM REMOVED
AT
OK
AT+CGMI
SIMCOM INCORPORATED
OK
AT+CGMR
+CGMR: A131B03A7670M6C
OK
AT+CGMM
A7670E-LASA
OK
AT+CSQ
+CSQ: 16,99
OK
1 Like

Did you connect the module via a converter?

How did you connect and power the module then and what baud rate did you use?

Which modem module did you use, or did you use a bare chip ?

Quote the module data or website.

Sounds like a serial comms problem, or at least that should be an easier/quicker fix!

Can you run at a lower baud rate, like half and if it does then increase a bit at a time until it doesn’t.

If you have a serial cable, shorter runs faster.

I tried it, yet it still outputs unreadable text


No, I’m connecting the module directly to ESP32 using Serial1 pins; no USB-to-Serial converter is used.

could you send a link to the specific SIMA7670 you are using?

could you have the Tx and Rx lines the wrong way around?

I tried all of this, but nothing happens. I don't understand what the problem :sweat_smile:

I used this kind of A7670E GSM Module
I do it this way:
TX ----> RXD
RX ----> TXD

Simcom A7670E 4G LTE Cat1 Module

the website presents a lot of nice pictures but no information on connections and how to use the device, e.g. are the Tx and Rx 3.3V logic or 5V logic?
ask the vendor where you purchased the specific SIMA7670 module for a datasheet?

does the serial monitor continuously print garbage or does it stop after a time?

can you upload a photo of the setup?

2 Likes

could you answer this?

1 Like

@danuzu
Your connection is incorrect, you need to wire Rx on one side to the Tx on the another, and vice versa.

1 Like

Sorry for the late reply,


for baud rate I used 115200

my bad i got confused and typed it incorrectly. :sweat_smile:

While connected to the PC - can you actually send AT commands to see the baud rate? AT+IPR? might work; otherwise, try to force the baud rate to 115200 with AT+IPR=115200 or enable auto-bauding with AT+IPR=0.

1 Like

These are the AT Commands I tried to:
DRIVERS
SimTech HS-USB Modem 9011
SimTech HS-USB AT Port 9011 (COM7)
SimTech HS-USB Diagnostics 9011 (COM8)

AT
OK

ATE0
OK

ATI
Manufacturer: INCORPORATED
Model: A7670E-LASE
Revision: A7670M7_V1.11.1
IMEI: 863957077837455
+GCAP: +CGSM,+FCLASS,+DS
OK

AT+CPIN?
+CPIN: READY
OK

AT+CCID
ERROR

AT+CSQ
+CSQ: 18,99
OK

AT+CREG?
+CREG: 0,1
OK

AT+COPS?
+COPS: 0,2,"51503",7
OK

AT+CGATT?
+CGATT: 1
OK

AT+CGDCONT?
+CGDCONT: 1,"IP","SMARTLTE.MNC003.MCC515.GPRS","10.138.166.117",0,0,,,,
+CGDCONT: 8,"IP","IMS","10.252.115.58",0,0,0,2,1,1
OK

AT+QNWINFO
+QNWINFO: "FDD LTE",51503,"LTE BAND 1",150
OK


Continuously print garbage, I'll upload later my phone got low battery so I can't take a photo