How to read a message using GSM and perform a function?

Hello Guys!

I want to operate a relay whenever I send a message to arduino via Gsm. If there is no message then the rest of the system should work without any problem.

I am using this code to send a message. So can anyone tell me a simple code like this one to read a message and operate a relay. Thanks!

GSM.ino (1.06 KB)

GSM.ino (1.06 KB)

You asked the same question over in Sensors, where do you want to see the replies ?

srnet: You asked the same question over in Sensors, where do you want to see the replies ?

You can reply on either post.

You're not getting it.

DONT POST in multiple forums here... post in one area, and wait for a response.

Otherwise.. peoples time is wasted answering in one place,, where it might have already been addressed in another thread.

xl97: You're not getting it.

DONT POST in multiple forums here... post in one area, and wait for a response.

Otherwise.. peoples time is wasted answering in one place,, where it might have already been addressed in another thread.

ok. i got it. i didn't know about it before. I will keep it in mind now. Now can anyone please give the answer of my question?

You do not mention which GSM module you are using. There are many differences in the details of the AT command set and some differences on what is actually possible. Receiving a SMS is much more complex on these modules than the brute-force-and-ignorance method you can use to send one. You will want to use a pre-written library, such as this one. But libraries are not available for all the modules, so knowing which one you have is important.

https://www.arduino.cc/en/Tutorial/GSMExamplesReceiveSMS