My code below:
#include <SoftwareSerial.h>
//Create software serial object to communicate with SIM800L
SoftwareSerial mySerial(3, 2); //SIM800L Tx & Rx is connected to Arduino #3 & #2
void updateSerial();
void sendDataAndUpdate(char string[]);
void setup()
{
//Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
Serial.begin(9600);
//Begin serial communication with Arduino and SIM800L
mySerial.begin(9600);
Serial.println(“Initializing…”);
delay(1000);
sendDataAndUpdate(“AT+SAPBR=3,1,“CONTYPE”,“GPRS””);
sendDataAndUpdate(“AT+SAPBR=3,1,“APN”,“v-internet””);
sendDataAndUpdate(“AT+SAPBR=1,1”);
sendDataAndUpdate(“AT+SAPBR=2,1”);
}
void loop()
{
updateSerial();
}
void updateSerial()
{
delay(500);
while (Serial.available())
{
mySerial.write(Serial.read());//Forward what Serial received to Software Serial Port
}
while(mySerial.available())
{
Serial.write(mySerial.read());//Forward what Software Serial received to Serial Port
}
}
void sendDataAndUpdate(char string[]){
mySerial.println(string);
updateSerial();
}
And this is my result
In this code, i’m preparing for a command that get longtitude/latitude: AT+CLBS=1,1. But it always stucks at command: AT+SAPBR=1,1 - return error and AT+SAPBR2,1 return 0.0.0.0(IP)
First of all, can module800l get GSM Location?. I’m not sure because I haven’t seen guide about this topic yet
Secondly, What type of fault is this? Can someone give solution?
Thank you for reading!!!