lastchancename:
You have some significant reading to do...
Fortunately there are many previous attempts at similar projects on the forum.
Let’s get some basic terminology straight...
GSM is the mobile telephony technology that supports SMS and MMS messaging as an add-on.
As 3G an 4G are DATA extensions to the original 2G platform, they may be regarded as supersets, but are not correctly called GSM any longer, but 3G or 4G with even further enhancements like VoLTE etc. They’re principally data layers which offer progressively better bandwidth and reduced latency. You’re only interested in the SMS component of this alphabet soup
So you already have the messaging part of the project, you need to look at PARSING, EEPROM and a few other techniques to handle the storage and processing of your messages.
Assuming the student sends a text message TO the unit, where is the admin located ? Local to the Arduino, or somewhere else...?
How are you going to communicate with the admin? Serial, another SMS message etc ?
I'll luckily solved my problem how to make statement
if(textMessage.indexOf(password + "ON")>=0){
Serial.println("LED set to ON");
textMessage = "";
}
if i texted " STI(the password) ON" the serial print LED set ON
my problem right now is how to change/modify/save the password in the system , is that using EEPROM ? can you guide me what to do ? thanks bro
this is my current program ,
#include <SoftwareSerial.h>
SoftwareSerial mySerial(50, 51);
String password = "STI ";
String textMessage;
String Message;
void setup()
{
mySerial.begin(9600); // Setting the baud rate of GSM Module
Serial.begin(9600); // Setting the baud rate of Serial Monitor (Arduino)
delay(5000);
Serial.print("SIM900 ready...");
SendMessage();
}
void loop()
{
textMessage="";
if(mySerial.available()>0){
textMessage = mySerial.readString();
delay(10);
if(textMessage.length()>0)
{
textMessage=textMessage.substring(textMessage.indexOf("+CMT"));
textMessage=textMessage.substring(textMessage.indexOf("\n"));
textMessage.replace("\n","");
Serial.print(textMessage);
Serial.println("");
}
if(textMessage.indexOf(password + "ON")>=0){
Serial.println("LED set to ON");
textMessage = "";
}
}
}
void SendMessage()
{
mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second
mySerial.println("AT+CMGS="+639290584072"\r"); // Replace x with mobile number
delay(1000);
mySerial.println("The system is ready");// The SMS text you want to send
delay(100);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);
}