1

I enable messages about new SMS

AT+CNMI=2,2,0,0,0

OK

and when received sms, output like this.

+CMT: "+79XXXXXXXXX","1","15/09/23,01:34:03+24"
Test

But when I read message, output only before <CR><LF> I don't see text of message.

AT+CMGR=1

+CMGR: "REC READ","+79XXXXXXXXX","1","15/09/23,00:34:17+24"

AT+CMGL="ALL"

+CMGL: 1,"REC READ","+79XXXXXXXXX","1","15/09/23,00:34:17+24"
+CMGL: 2,"REC READ","+79XXXXXXXXX","1","15/09/23,01:34:03+24"

I use following (via SoftwareSerial) code for test this. SMSGSM.GetSMS and SMSGSM.GetAuthorizedSMS of GSM GPRS GPS Shield Library receive only phone number without sms text.

I use this shield: _57

AT+GSV

SIMCOM_Ltd
SIMCOM_SIM900
Revision:1137B05SIM900M64_ST_ENHAN
1

This is most likely a case of overrun SoftwareSerial buffer. You are reading too slowly from the modem, especially with the Serial.print()s in your code. You should look for SoftwareSerial.h in C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SoftwareSerial if you're using Win 8 and above. Or just search your PC for it. Look for this line:

    #define _SS_MAX_RX_BUFF 64

Change 64 to 256 and save. If it solves your problem, try reducing 256 to 128 to see if it still works. The greater the size of the buffer, the lesser the amount of memory available to the rest of your program.

You could also try this, to interact with the module:

#include <SoftwareSerial.h>

SoftwareSerial SIM900(7,8);

void setup() {
  Serial.begin(19200);
  SIM900.begin(19200);
}

void loop() {
  // put your main code here, to run repeatedly:
  while (Serial.available() > 0){
    SIM900.write(Serial.read());
  }
  while (SIM900.available() > 0){
    Serial.write(SIM900.read());
  }
}

It does the same thing as your code and doesn't require adjusting buffer size, though I still recommend you make the change if you will use other sketches.

0

Could you confirm that any of the commands sent over your SoftwareSerial are responding?

You probably need to add a "\n" (new line) at the end of your messages or just use println().

Also, add your code to the question so we can be of better assistance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.