Hi all,
I am trying to interface a GSM module to ESP32 ( using ESP32-WROOM-32), for which libraries are not available, As ESP32 have 3 UARTs, i have connected my RX and TX of my module to esp32 TX2 and RX2 (17,18). I am trying to pass a 'AT' cmnd via serial communication to the GSM and read the response from the GSM as 'OK' and print in Serial monitor. There were few tutorials which speaks about using the HardwareSerial.h, Serial.Begin2(115200) etc. But i am not able to acheive my Goal. If any experts have any idea, please do post your thoughts here.. Here is my code
#include <HardwareSerial.h>
#define RXD2 16
#define TXD2 17
void setup() {
Serial.begin(115200);
Serial2.begin(115200)
delay(1000);
Serial.println("Loopback program started");
delay(5000);
}
void loop() {
//if(Serial.available()){
Serial2.write("AT");
//Serial2.write(Serial.read());
//}
if(Serial2.available()){
//Serial.write(".");
Serial.println(Serial2.read());
}
delay(6000);
}