Connect arduino with sim900a send sms from smartphone

any people help me ?

#include <SoftwareSerial.h>
#include <Arduino.h>
#include <String.h>

SoftwareSerial mySerial(2, 3);
char pesan1 []= "+6285756071366";

void setup() {

while (!Serial){

Serial.println("I'M ARDUINO");

void loop() {

if (mySerial.available()) {
if (Serial.available()) {
Serial.println("Baca SMS");

if(strstr(pesan1,"+6285756071366")==0) goto bacasms;
//Serial.println("Nomor Ada");
else Serial.println("Periksa Pesan");

if(strstr(pesan1,"GetMeter1")==0) goto bacasms;
else Serial.println("Baca ADC");


I've tried but at the moment sms sent to existing number on arduino there but using foreign language and not in line with what i mean ..

Please help me

  if(strstr(pesan1,"+6285756071366")==0) goto bacasms;

WTF? You most certainly do NOT need a damned goto statement.


More stupidity.

What IS the problem? You posted some code that does something, but failed to tell us what it does. You expect the code to do something, but failed to tell us what you expect? How can we tell you where your expectations are wrong, without any data?

Sorry paulS

It's a program to read sms from smartphone to arduino via sim900a and i want when there sms in with the number made in the program according then the next step read the contents of sms, if appropriate next step read the sensor that is ADC ...

So paulS ..
Can you help me, paulS?

Can you help me, paulS?

No. I still don't know what the program actually does, or how that differs from what you want.

You REALLY need to restructure the code to deal with valid requests, and ignore invalid requests, instead of stuffing your head in the sand if an invalid request is made.

What is your code doing now?

send sms from my phone to arduino logans

char pesan1 []= "+6285756071366";

 if(strstr(pesan1,"+6285756071366")==0) goto bacasms;

  if(strstr(pesan1,"GetMeter1")==0) goto bacasms;

There are three places in the code where the contents of pesan1 matter. strstr() finds the first instance of string 2 in string 1, and returns a pointer to string 2 in string 1. The first call to strstr() will return a pointer, because "+6285756071366" is contained in "+6285756071366".

Since the pointer is not a NULL pointer, it is not equal to 0, so the goto doesn't happen.

Now, why you think that pesan1 should now contain "GetMeter1", when you have not assigned any new data to pesan1 is a complete mystery that you have made NO attempt to clear up.

Right now, ALL that your code does is read the data coming from the Serial port and send it to the modem, and read the data coming from the modem and send it to the serial port.

You have to do a LOT more than that if you expect to deal with the incoming data.