[![Current setup, but I have tried with different connections, different wires, different PC and different power supply. Nothing works!][1]][1]
The code I am currently using is as follows, and is copied directly from [here][2]here, but I have tried multiple other codes from different solutions to no avail:
SoftwareSerial mySerial(9, 10);
void setup()
{
mySerial.begin(9600); // Setting the baud rate of GSM Module
Serial.begin(9600); // Setting the baud rate of Serial Monitor (Arduino)
delay(100);
}
void loop()
{
if (Serial.available()>0)
switch(Serial.read())
{
case 's':
mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1 second
mySerial.println("AT+CMGS=\"+91xxxxxxxxxx\"\r"); // Replace x with mobile number
delay(1000);
mySerial.println("Technolab creation");// The SMS text you want to send
delay(100);
mySerial.println((char)26);// ASCII code of CTRL+Z for saying the end of sms to the module
delay(1000);
break;
case 'r':
mySerial.println("AT+CNMI=2,2,0,0,0"); // AT Command to receive a live SMS
delay(1000);
break;
}
if (mySerial.available()>0)
Serial.write(mySerial.read());
}```
Please help me out, I've tried everything I can think of.
[1]: https://i.sstatic.net/h7kpf.jpg
[2]: https://www.technolabcreation.com/sim900a-gsm-module-and-arduino-sending-and-receiving-sms-using-at-commands/
Please help me out, I've tried everything I can think of.