Go Down

Topic: GSM no messages saved to SIM (Read 3673 times) previous topic - next topic

ProfRon

Aug 01, 2015, 03:59 pm Last Edit: Aug 02, 2015, 01:27 pm by ProfRon Reason: tried a few things
OK I have a SIM900 based GSM shield (geeetech) I have it sending and reading texts and calls etc etc. I thought I was flying!! USING UNO.
I then loaded up a program that allowed me to use an external Serial port PuTTy. Again all was fine after a bit of fiddling. I could put in various AT commands, and receive SMS text messages and see them come in. I thought great!!
BUT then I put in the AT command for reading all the messages on the SIM card (I think it can store 10)
AT+CMGL="ALL" but nothing came back just OK. Why no messages??
Tried AT+CPMS="SM" and got back 0,10,0,10,0,10 which looks like nothing in the SIM but 10 slots available,
AT+CPMS=? gives +CPMS: ("SM"),("SM"),("SM").
The messages just don't seem to be stored there

I have managed to STORE a message to send on the SIM and it shows up as being stored. BUT yet incoming messages don't get stored at all.  I don't get it!!




ANYONE KNOW WHY???  PLEEEAASE!!

dannable

Post your code. Or a small example that demonstrates the problem.

http://forum.arduino.cc/index.php?topic=148850.0, points 7 & 11, bullet point 5.

Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

ProfRon

#2
Aug 02, 2015, 03:40 pm Last Edit: Aug 02, 2015, 04:34 pm by ProfRon
The PuTTY terminal is connected to an Arduino UNO and the Shield communicates with the Arduino via
the Software PINS 7 and 8 of the UNO
.
I guess its continuously reading what is happening and fires it to the TERMINAL.
I can put any AT commands in OK via PuTTY and see any SMS messages coming in but it doesn't get stored on the SIM.

I  attach O/P from the TERMINal showing a message I stored for sending. IT's there OK. Then a message coming in that isn't stored. I can't figure out why.


Code: [Select]

//Serial Relay - Arduino will patch a
//serial link between the computer and the GPRS Shield
//at 19200 bps 8-N-1
//Computer is connected to Hardware UART
//GPRS Shield is connected to the Software UART
//WORKS with PuTTY
#include <SoftwareSerial.h>

SoftwareSerial GPRS(7, 8);
unsigned char buffer[64]; // buffer array for data recieve over serial port
int count=0;     // counter for buffer array
void setup()
{
 GPRS.begin(19200);               // the GPRS baud rate  
 Serial.begin(19200);             // the Serial port of Arduino baud rate.

}

void loop()
{
 if (GPRS.available())              // if date is comming from softwareserial port ==> data is comming from gprs shield
 {
   while(GPRS.available())          // reading data into char array
   {
     buffer[count++]=GPRS.read();     // writing data into array
     if(count == 64)break;
 }
   Serial.write(buffer,count);            // if no data transmission ends, write buffer to hardware serial port
   clearBufferArray();              // call clearBufferArray function to clear the storaged data from the array
   count = 0;                       // set counter of while loop to zero
 

 }
 if (Serial.available())            // if data is available on hardwareserial port ==> data is comming from PC or notebook
   GPRS.write(Serial.read());       // write it to the GPRS shield
}
void clearBufferArray()              // function to clear buffer array
{
 for (int i=0; i<count;i++)
   { buffer[i]=NULL;}                  // clear all index of array with command NULL
}





Code: [Select]
AT+CPMS?


+CPMS: "SM",1,10,"SM",1,10,"SM",1,10



OK

AT+CMGL="ALL"


+CMGL: 1,"STO UNSENT","+447912410851",""

This is rons stored message



OK



+CMT: "+447912410851","","15/08/02,14:24:32+04"

New msg from phone

AT+CPMS?


+CPMS: "SM",1,10,"SM",1,10,"SM",1,10



OK

AT+CMGL="ALL"


+CMGL: 1,"STO UNSENT","+447912410851",""

This is rons stored message



OK




ProfRon

Sorry Dannable, I see I could have done this post better!! I will next time.

Thanks for your interest.

dannable

Cool! Smileys in your code!  ;)

I don't see you setting CNMI (New Message Indicator) anywhere.
Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

ProfRon

HI,

I redid the code to get rid of the "simply pasted" version that converted ); to a smiley!! Perhaps you picked up the first version. LOL

Yes, that's correct, no CNMI indicator tried. Perhaps that's it? I will look it up and try it. I have come across it but I don't think I used it yet.  I did mess with a Quectel M10  GSM a couple of years ago and had no such problems (although I had others) so maybe I got lulled into a sense of security.

I will look at CNMI.

Thanks

ProfRon

+CNMI=1,1,0,0,0  FIXED IT!!

Proving a little knowledge is a dangerous thing for me!

But, at least, I will be a little better company for my wife over dinner this evening, instead of pondering AT commands!!

My sincere thanks to you. Glad it was so simple.  :)

Kind Regards

R

Go Up