I am trying to send a SMS using GSM SIM900A. But there is no compilation error and other interference there.
The code is executed properly but SMS isn't sent to the number mentioned in the code.
#include <TinyGPS.h>
#include <SoftwareSerial.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
SoftwareSerial SIM900A(7, 8);
void setup() {
Serial.begin(9600);
SIM900A.begin(9600);
pinMode(6, INPUT);
}
void loop() {
bool state = digitalRead(6);
if (state == HIGH) {
SIM900A.println("AT+CMGF=1");
delay(1000);
SIM900A.println("AT+CMGS=\"+8801679388394\"\r");
delay(1000);
SIM900A.println("Alert I need help....Asheesh ,Battalion No. 1233456 ");
SIM900A.println((char)26);
delay(10000);
}
else {
delay(2000);
}
}
What's wrong here?
GSM SIM900A only supports 2G SIM card.At first make sure that you are using a 2G SIM.