Hi, I'm trying to print the current network operator with SIM800l wiith no success, I really appreciate if you could help me. This is my code:
#include <SoftwareSerial.h>
// Configure SIM800l
#define RX 8
#define TX 7
SoftwareSerial serialSIM800(RX, TX);
void setup() {
Serial.begin(9600);
//Being serial communication with Arduino and SIM800
serialSIM800.begin(9600);
// Print current operator
print_current_operator();
}
void loop(){
}
void print_current_operator() {
Serial.print("Current network operator is:\n");
serialSIM800.write("AT+COPS?");
//Read SIM800 output (if available) and print it in Arduino IDE Serial Monitor
Serial.write(serialSIM800.read()); // I GET NO OUTPUT FROM THIS COMMAND
// I ALSO HAVE TRIED THESE OPTIONS WITH NO LUCK
//Serial.println(serialSIM800.read());
//Serial.println(serialSIM800.readString());
//Serial.println(serialSIM800.readStringUntil("OK"));
// ANOTHER OPTION TRIED WITH NO LUCK
/*
serialSIM800.setTimeout(8000);
char operador_actual[300];
serialSIM800.readBytesUntil("OK", operador_actual, 300);
Serial.println(operador_actual);
*/
delay(6000);
}