ESP32 not Communicating with SIM900a

AFHKLI13
Posts: 2
Joined: Tue Jan 10, 2023 3:01 am

ESP32 not Communicating with SIM900a

Postby AFHKLI13 » Tue Jan 10, 2023 3:20 am

I am using NodeMCU - ESP32 (https://esphome.io/devices/nodemcu_esp32.html) with SIM900a Mini Version 3.8.2 and trying to connect them through serial. However, the AT commands I send return -1 always.
Here is my code:

Code: Select all

#include "HardwareSerial.h"
HardwareSerial SIMSerial2(2);

unsigned long previousM = 0;
const long resetBurst = 13000;
void setup() {
 Serial.begin(9600);
 SIMSerial2.begin(9600,SERIAL_8N1, 18,19);
  
  Serial.println("Starting");
    
  delay(3000);
  ReceiveMode();
  
}
void loop(){
unsigned long currentMillis = millis();  
if(currentMillis - previousM >= resetBurst){
previousM = currentMillis;
Serial.println("Getting in Receive Mode");
ReceiveMode();
}

}

void ReceiveMode() {
  
  Serial.println("Inside Receive Mode");
  SIMSerial2.write("AT");
  delay(3000);
  Serial.print(SIMSerial2.read());
  SIMSerial2.write("AT+CGSN");
  delay(3000);
  Serial.print(SIMSerial2.read());
   delay(3000);
  }
Connections:
SIM900a GND to ESP GND
SIM900a 5VT to ESP RX
SIM900a 5VR to ESP TX

SIM900a is powered by a separate Buck Converter providing 4.7V at 2A.

Using Arduino IDE and this is what I get in serial monitor:
Starting
Getting in Receive Mode
Inside Receive Mode
-1-1Getting in Receive Mode
Inside Receive Mode
-1-1
I also tried 3VT and 3VR of SIM900a. I tried the DB9-2 and DB9-3 headers on the other end of the board but same result. No SIM is inserted yet.
SIM900a works fine with NodeMCU ESP8266.

Kindly help me out

AFHKLI13
Posts: 2
Joined: Tue Jan 10, 2023 3:01 am

Re: ESP32 not Communicating with SIM900a

Postby AFHKLI13 » Thu Jan 12, 2023 2:58 am

Anyone?

Who is online

Users browsing this forum: No registered users and 108 guests