Go Down

Topic: reading sms (Read 13120 times) previous topic - next topic


Hey I tried your code.
Its working fine in Duemilanove and SIM900 gsm module. Led 13 is switching on.

Possible changes to your system would be.
1. Trying out with 12Vdc, 2amp power supply for GSM module.
2. According to this figure: http://www.embeddedmarket.com/products/Arduino-Compatible-Freeduino-DU/Datasheet.asp
Pin 0 is Tx and Pin 1 is Rx.  Normally Rx and Tx are written on the pin numbers.  So try changing pin if it works.
3. Switch on/off and delete all the messages in GSM module and try again.

Let me know if it still doesn't work.


Apr 23, 2013, 06:47 am Last Edit: Apr 23, 2013, 06:51 am by dhruvit Reason: 1
hey man  thanks for your keen interest in my posts

i tried all the things
but its still not working  :~

its really frustrating

ok i know this is stupid question but still i want to ask you what message
you are sending when you are running my code
its looking like i am doing something wrong in sending message i belive
this could be the one reason
and will you please mail me the code which you have run
i belive i am becoming  superstitious now!!!
sorry for troubling you

once again i am trying..... and waiting for your reply

my email address is shahdhruvit111@yahoo.com


No probs,

1. The message I send is : 0#1 to switch on the led and 0#0 to switch off.

The code:
Code: [Select]
char inchar; //Will hold the incoming character from the Serial Port.

int led1 = 13;
void setup()
// prepare the digital output pins
pinMode(led1, OUTPUT);

// initially all are off
digitalWrite(led1, LOW);
//Initialize GSM module serial port for communication.
delay(3000); // give time for GSM module to register on network etc.
Serial.println("AT+CMGF=1\r"); // set SMS mode to text

//Serial.println("AT+CNMI=3,3,0,0"); // set module to send SMS data to serial out upon receipt
Serial.println("AT+CNMI=2,2,0,0,0"); // set module to send SMS data to serial out upon receipt
void loop()
//If a character comes in from the Serialular module...
if(Serial.available() >0)

if (inchar=='0')   // to catch the 1st 0 in our string 0#101#101#101
      // digitalWrite(led1, HIGH);
       // for #101________________
       inchar=Serial.read(); // read next char i.e '#'
       if (inchar=='#')
             inchar=Serial.read(); //read next char i.e 1
             if (inchar=='0')
                 digitalWrite(led1, LOW);
             else if (inchar=='1')
                 digitalWrite(led1, HIGH);
                  } //end of 3rd 'if char==#' loop
       } // "ckeck 0 in front of string" wala loop close

//Serial.println("AT+CMGD=1,4"); // delete all SMS
  } // serial available condition close

//   Serial.println("AT+CMGR=1\r");
//   delay(4000);
} // LOOP function close


still not working man!!!!!!!!!!!!

but still trying...........

any suggestions?????


hey man thanks

i just tried with sim300 module and it worked!!!!!!!!!!!!!! :)

thanks again
but why it is not working with sim900???

still confused??


HI ,many of us have arduino r3"s and sim 900 shield all plugged up,no matter how hard we try and even if we do get the sketch working, it seems to work for a certain time then decides to do its own thing,leaving us with frustrations,is there anyone with an arduino sketch that will receive an sms on sim900 shield and uno R3, read the sms then turn on an led if the message has the word 'on' in it and then delete the received sms on the simcard successfully,so the sim doesn't fill up.Anyone with a fully working sketch please help us put our hardware to use also remember we not hardcore programmers so the task of changing things like serial buffers are not for us,there are many working sketches out there, but be careful the sudden
failure especially if u using it to open the garage door by sms,help the hundreds of us that experience problems with this shield thanks

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131