Pages: 1 ... 3 4 [5]   Go Down
Author Topic: reading sms  (Read 8318 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey man  thanks for your keen interest in my posts

i tried all the things
but its still not working  smiley-confuse

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
« Last Edit: April 22, 2013, 11:51:55 pm by dhruvit » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No probs,

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

The code:
Code:
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.
 Serial.begin(9600);
 delay(3000); // give time for GSM module to register on network etc.
 Serial.println("AT+CMGF=1\r"); // set SMS mode to text
 delay(200);
 Serial.println("AT+CSMS=1\r");
 delay(200);
 
//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
//Serial.println("AT+CSMP=17,167,0,0");
 delay(200);
 }
void loop()
 {
 //If a character comes in from the Serialular module...
if(Serial.available() >0)
 { 

 delay(10);
 inchar=Serial.read();
 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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

any suggestions?????
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 17
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey man thanks

i just tried with sim300 module and it worked!!!!!!!!!!!!!! smiley

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

still confused??
Logged

South Africa
Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: 1 ... 3 4 [5]   Go Up
Jump to: