Sending and Receiving SMS using GSM module (contd...)

Hello everyone!

Hope you are being benefited from the information I have been sharing. Many of you have been working with GSM based projects and have been highly benefited from the earlier post of sending and receiving sms using gsm module. This is the continued version of the similar topic.

Note: We recommend you to visit Sending and Receiving SMS using GSM module before you read further.


Many were benefited from the earlier but faced problem while receiving sms from the mobile on gsm so I have tried my best to solve the issue with description and additional code in this post. Receiving a text message on SIM900 module is a bit difficult because now you need to place a check when user will send a message. So, ideally whenever anyone send a message to your SIM900 module, you should get notified. These are to be covered in detail.

Now, after we get notified, there is a need to read message as well and who has sent the message. So, all we will place a check that whenever someone sends a message to our SIM900 module, we get notified and we will extract message and mobile number of sender.

I have explained in previous post about sending the sms from GSM to mobile using AT command and similar is for receiving the SMS.

  1. ATE0 - It is used to turn off the Echo of GSM shields
  2. AT - Just to check your GSM is working fine
  3. AT+CMGF = 1 - This command will convert the message style to text
  4. AT+ CNMI=1,2,0,0,0 - This command will alert GSM shield and whenever it receive message, it will automatically send an alert on the serial port.
These four commands are used in the code in order to receive text in GSM. We have to put Enter after each of the AT commands. For each AT command, we get a response "OK" from the GSM shield.

Now, GSM shield is ready to receive the text message.

When you send a message to GSM shield it will notify and the received message will start with "+CMT" and after that it has a mobile number of the sender and at the end lies the body of message.

If you want to receive SMS in GSM then add below code in earlier one:


void Config()
{
delay(1000);
Serial.print("ATE0r");
Response();
Serial.print("ATr");
Response();
Serial.print("AT+CMGF=1r");
Response();
Serial.print("AT+CNMI=1,2,0,0,0r");
Response();
}

void Response()
{
int count = 0;
Serial.println();
while(1)
{
if(Serial.available())
{
char data =Serial.read();
if(data == 'K'){Serial.println("OK");break;}
if(data == 'R'){Serial.println("GSM Not Working");break;}
}
count++;
delay(10);
if(count == 1000){Serial.println("GSM not Found");break;}

}
}


If you want to go further and get the data out of the string out of serial monitor you follow the following steps however it might not be necessary for most of the cases.

  • Save the CMT string into an array, which named as RcvMsg[index] but be sure you are not receiving the garbage value.
  • To do so you can check first these character"+CMT" and make index = 0
  • To get a complete string "n" used as null character because there is no end character and 2 null character = complete string so you can stop receiving string
  • Now you can count the mobile number and mark as sender mobile number and other as message text.
  • Now the change you get is instead of "+CMT" you get  " SENDER Mobile Number" and " MESSAGE TEXT."
Now, its awesome; isn't it. Now you can not only send but also receive the message text. Sending SMS is better method than Call in case of projects and cost factors.






If you want a complete and bug-free working code of GSM based Dual Communication which I was lucky enough to supervise then click here.

Hope this was very much helpful. You can buy an arduino code from different websites but I am trying to provide my skills for free however you can help me by like, share and subscribe.

Also if you need any support with any kind of projects or codes then you can just post your code or ideas in the comment section. Feel free to share your problems.

Comments

  1. its just bullshit.....copied content.....!!

    ReplyDelete
    Replies
    1. Sorry to say but its not copied content and all these are worked by me and my team and constantly supporting many other projects with involvement of gsm and coding too completely free of cost so its better if you post related comment rather than criticizing this and that. Any way thank you for you comment my friend.

      Delete
    2. LEGIT FULLZ & TOOLS STORE

      Hello to All !

      We are offering all types of tools & Fullz on dicounted price.
      If you are in search of anything regarding fullz, tools, tutorials, Hack Pack, etc
      Feel Free to contact

      ***CONTACT 24/7***
      **Telegram > @leadsupplier
      **ICQ > 752822040
      **Skype > Peeterhacks
      **Wicker me > peeterhacks

      "SSN LEADS/FULLZ AVAILABLE"
      "TOOLS & TUTORIALS AVAILABLE FOR HACKING, SPAMMING,
      CARDING, CASHOUT, CLONING, SCRIPTING ETC"

      **************************************
      "Fresh Spammed SSN Fullz info included"
      >>SSN FULLZ with complete info
      >>CC With CVV Fullz USA
      >>FULLZ FOR SBA, PUA & TAX RETURN FILLING
      >>USA I.D Photos Front & Back
      >>High Credit Score fullz (700+ Scores)
      >>DL number, Employee Details, Bank Details Included
      >>Complete Premium Info with Relative Info

      ***************************************
      COMPLETE GUIDE FOR TUTORIALS & TOOLS

      "SPAMMING" "HACKING" "CARDING" "CASH OUT"
      "KALI LINUX" "BLOCKCHAIN BLUE PRINTS" "SCRIPTING"
      "FRAUD BIBLE"

      "TOOLS & TUTORIALS LIST"
      =>Ethical Hacking Ebooks, Tools & Tutorials
      =>Bitcoin Hacking
      =>Kali Linux
      =>Fraud Bible
      =>RAT
      =>Keylogger & Keystroke Logger
      =>Whatsapp Hacking & Hacked Version of Whatsapp
      =>Facebook & Google Hacking
      =>Bitcoin Flasher
      =>SQL Injector
      =>Premium Logs (PayPal/Amazon/Coinbase/Netflix/FedEx/Banks)
      =>Bitcoin Cracker
      =>SMTP Linux Root
      =>Shell Scripting
      =>DUMPS with pins track 1 and 2 with & without pin
      =>SMTP's, Safe Socks, Rdp's brute
      =>PHP mailer
      =>SMS Sender & Email Blaster
      =>Cpanel
      =>Server I.P's & Proxies
      =>Viruses & VPN's
      =>HQ Email Combo (Gmail, Yahoo, Hotmail, MSN, AOL, etc.)

      *Serious buyers will always welcome
      *Price will be reduce in bulk order
      *Discount offers will gives to serious buyers
      *Hope we do a great business together

      ===>Contact 24/7<===
      ==>Telegram > @leadsupplier
      ==>ICQ > 752822040
      ==>Skype > Peeterhacks
      ==>Wicker me > peeterhacks

      Delete
    3. Sending And Receiving Sms Using Gsm Module (Contd...) >>>>> Download Now

      >>>>> Download Full

      Sending And Receiving Sms Using Gsm Module (Contd...) >>>>> Download LINK

      >>>>> Download Now

      Sending And Receiving Sms Using Gsm Module (Contd...) >>>>> Download Full

      >>>>> Download LINK de

      Delete
  2. Sir, my name is Ashutosh kumar and I am a final year b.tech student. I have to make a project on vehicle tracking system. So I want help from you. I have made arduino and gps connection and code is also working. It is showing latitude and longitude. I have purchased a gsm sim 900A module and i have made the connection with arduino. But I don't know how to write code. I don't know from where I have to start code. Can we write gsm code with the gps code? Sir please help me in solving the coding problem. Thank you. I have attached my gps_arduino code below:-
    ======================================================================================================

    #include "TinyGPS++.h"
    #include "SoftwareSerial.h"

    SoftwareSerial serial_connection(11,10);
    TinyGPSPlus gps;


    void setup()
    {
    Serial.begin(9600);

    serial_connection.begin(9600);
    delay(1000);
    }
    void loop()
    {
    while(serial_connection.available())
    {
    gps.encode(serial_connection.read());
    }
    if(gps.location.isUpdated())
    {
    Serial.println("Satellite Count:");
    Serial.println(gps.satellites.value());
    Serial.println("Latitude:");
    Serial.println(gps.location.lat(),6);
    Serial.println("Longitude:");
    Serial.println(gps.location.lng(),6);
    Serial.println("Speed MPH:");
    Serial.println(gps.speed.mph());
    Serial.println("Altitude Feet:");
    Serial.println(gps.altitude.feet());
    Serial.println("");
    }
    }
    ==================================================================================================
    Where should i place the gsm code to get my project ready?

    ReplyDelete
    Replies
    1. Hello Ashutosh, I am glad that you share your problem with us and thank you for that. Yes in most of the GPS modules the code are similar to that of GSM i.e. uses the AT Commands but somewhat different. You want to input the GSM code somewhere, so the suggestion would be to create the code as different function and call it. Best way for determining the perfect working of code with accuracy would be the implementation of flowchart. Try it and do contact if there occurs any problem. I will be providing a sample code for you as per your need as soon as possible and also a working code for the vehicle tracking system.

      Thank You.

      Delete
  3. Hello Sir,i got a problem here.hope u can help me to solve it.
    I want to send message to gsm sim900A and make it sent a location to me back.How do i do that?

    Thanks for ur attention.

    ReplyDelete
    Replies
    1. thank your for your patience and with reference to your comment I am blogging the certain other features that can be accessed by AT command in SIM 900. Hope that might be helpful. Thank You for your patience.

      Delete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Hello sir,
    I rudra facing problem with sending sms via gsm sim900a.
    And when i make a call to the number that insert in gsm module. It not reachable .
    Plz help

    ReplyDelete
  6. Hi Sir,
    I am a project in that I need to sent a int value to gsm and then use that value to display on 7segment led so how go do that

    ReplyDelete
  7. LEGIT FULLZ & TOOLS STORE

    Hello to All !

    We are offering all types of tools & Fullz on dicounted price.
    If you are in search of anything regarding fullz, tools, tutorials, Hack Pack, etc
    Feel Free to contact

    ***CONTACT 24/7***
    **Telegram > @leadsupplier
    **ICQ > 752822040
    **Skype > Peeterhacks
    **Wicker me > peeterhacks

    "SSN LEADS/FULLZ AVAILABLE"
    "TOOLS & TUTORIALS AVAILABLE FOR HACKING, SPAMMING,
    CARDING, CASHOUT, CLONING, SCRIPTING ETC"

    **************************************
    "Fresh Spammed SSN Fullz info included"
    >>SSN FULLZ with complete info
    >>CC With CVV Fullz USA
    >>FULLZ FOR SBA, PUA & TAX RETURN FILLING
    >>USA I.D Photos Front & Back
    >>High Credit Score fullz (700+ Scores)
    >>DL number, Employee Details, Bank Details Included
    >>Complete Premium Info with Relative Info

    ***************************************
    COMPLETE GUIDE FOR TUTORIALS & TOOLS

    "SPAMMING" "HACKING" "CARDING" "CASH OUT"
    "KALI LINUX" "BLOCKCHAIN BLUE PRINTS" "SCRIPTING"
    "FRAUD BIBLE"

    "TOOLS & TUTORIALS LIST"
    =>Ethical Hacking Ebooks, Tools & Tutorials
    =>Bitcoin Hacking
    =>Kali Linux
    =>Fraud Bible
    =>RAT
    =>Keylogger & Keystroke Logger
    =>Whatsapp Hacking & Hacked Version of Whatsapp
    =>Facebook & Google Hacking
    =>Bitcoin Flasher
    =>SQL Injector
    =>Premium Logs (PayPal/Amazon/Coinbase/Netflix/FedEx/Banks)
    =>Bitcoin Cracker
    =>SMTP Linux Root
    =>Shell Scripting
    =>DUMPS with pins track 1 and 2 with & without pin
    =>SMTP's, Safe Socks, Rdp's brute
    =>PHP mailer
    =>SMS Sender & Email Blaster
    =>Cpanel
    =>Server I.P's & Proxies
    =>Viruses & VPN's
    =>HQ Email Combo (Gmail, Yahoo, Hotmail, MSN, AOL, etc.)

    *Serious buyers will always welcome
    *Price will be reduce in bulk order
    *Discount offers will gives to serious buyers
    *Hope we do a great business together

    ===>Contact 24/7<===
    ==>Telegram > @leadsupplier
    ==>ICQ > 752822040
    ==>Skype > Peeterhacks
    ==>Wicker me > peeterhacks

    ReplyDelete
  8. Sending And Receiving Sms Using Gsm Module (Contd...) >>>>> Download Now

    >>>>> Download Full

    Sending And Receiving Sms Using Gsm Module (Contd...) >>>>> Download LINK

    >>>>> Download Now

    Sending And Receiving Sms Using Gsm Module (Contd...) >>>>> Download Full

    >>>>> Download LINK fY

    ReplyDelete

Post a Comment

Popular posts from this blog

CYBER GHOST VPN 6 FULL PREMIUM VERSION

Sending and Receiving SMS using GSM module