I am trying to connect SIM800L to ESP32 DevkitC via serial but it wasnt working (I could not see the result of any AT commands). SIM800L connects to network and I can call it just fine ( blink after 3 seconds). It is powered separately via a buck converter and a decoupling system with a zener diode.
ESP32 is powered via USB as I am monitoring the program output via Arduino IDE.
I noticed that SIM800L TX output was hovering around 1.3V to 2V so I tried to level shift it to 3.3V so now 3.3V appears at RX pin of esp32 when SIM800L gives logic 1, and floating value when SIM800L gives logic 0 (as checked by my voltmeter).
But, I still dont see any response to AT commands in my serial monitor. I have tried the same SIM800L with another esp32 (devkit-1), and with nodemcu esp8266. But nothing on serial output after AT commands.
Here is my schematic:
Here is my code:
unsigned long previousM = 0;
const long resetBurst = 15000;
void setup() {
Serial.begin(9600);
Serial2.begin(9600);
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");
Serial2.println("AT\r");
updateSerial();
Serial2.println("AT+CGSN\r");
updateSerial();
delay(3000);
}
void updateSerial() {
delay(500);
while (Serial.available()) {
Serial2.write(Serial.read());
}
while (Serial2.available() > 0)
{
Serial.write(Serial2.read());
}
The output I see in serial monitor is just this:
Getting in Receive Mode
Inside Receive Mode
Getting in Receive Mode
Inside Receive Mode
Getting in Receive Mode
What am I doing wrong?