Go Down

Topic: Arduino GSM Shield Sending SMS Messages not Working (Read 2133 times) previous topic - next topic


May 05, 2014, 06:02 am Last Edit: May 05, 2014, 06:09 am by ecolara3 Reason: 1
I recently purchased the GSM shield (http://store.arduino.cc/index.php?main_page=product_info&cPath=11_5&products_id=244) and am able to get the HTTP requests to work, however I am having issues with the SMS messaging. Below is my Debug output and also my code. I am sure it has something to do with the CMS ERROR message, but I have no idea what it means. Can anyone help with this?

Debug Message:
Sending message...
49 53>%13%%10%>
Hello World!%26%%13%
49 73>%13%%10%> %13%%10%+CMS ERROR: 3518%13%%10%
Message sent

#include <GSM.h>
#include <GSM3CircularBuffer.h>
#include <GSM3MobileAccessProvider.h>
#include <GSM3MobileCellManagement.h>
#include <GSM3MobileClientProvider.h>
#include <GSM3MobileClientService.h>
#include <GSM3MobileDataNetworkProvider.h>
#include <GSM3MobileMockupProvider.h>
#include <GSM3MobileNetworkProvider.h>
#include <GSM3MobileNetworkRegistry.h>
#include <GSM3MobileServerProvider.h>
#include <GSM3MobileServerService.h>
#include <GSM3MobileSMSProvider.h>
#include <GSM3MobileVoiceProvider.h>
#include <GSM3ShieldV1.h>
#include <GSM3ShieldV1AccessProvider.h>
#include <GSM3ShieldV1BandManagement.h>
#include <GSM3ShieldV1BaseProvider.h>
#include <GSM3ShieldV1CellManagement.h>
#include <GSM3ShieldV1ClientProvider.h>
#include <GSM3ShieldV1DataNetworkProvider.h>
#include <GSM3ShieldV1DirectModemProvider.h>
#include <GSM3ShieldV1ModemCore.h>
#include <GSM3ShieldV1ModemVerification.h>
#include <GSM3ShieldV1MultiClientProvider.h>
#include <GSM3ShieldV1MultiServerProvider.h>
#include <GSM3ShieldV1PinManagement.h>
#include <GSM3ShieldV1ScanNetworks.h>
#include <GSM3ShieldV1ServerProvider.h>
#include <GSM3ShieldV1SMSProvider.h>
#include <GSM3ShieldV1VoiceProvider.h>
#include <GSM3SMSService.h>
#include <GSM3SoftSerial.h>
#include <GSM3VoiceCallService.h>

// PIN number if necessary
#define KEY "My Key"
#define PINNUMBER "The SIM's PIN"

// APN data
#define GPRS_APN       "bluevia.movistar.es" // replace your GPRS APN
#define GPRS_LOGIN     ""    // replace with your GPRS login
#define GPRS_PASSWORD  "" // replace with your GPRS password

// initialize the library instances
GSMClient client;
GPRS gprs;
GSM gsmAccess(true);// Pass this for debugging
GSM_SMS sms(true);

char server[] = "arduino.cc"; // the base URL
char path[] = "/"; // the path
int port = 80; // the port, 80 for HTTP

// char array of the telephone number to send SMS
// change the number 1-212-555-1212 to a number
// you have access to
char remoteNumber[20]= "1-000-000-0000";  

// char array of the message
char txtMsg[200]="Test";

boolean messageSent = false;

void setup()
 // initialize serial communications
 Serial.println("Starting Arduino setup");
 // connection state
 boolean notConnected = true;

 // Start GSM shield
 // pass the PIN of your SIM as a parameter of gsmAccess.begin()
     Serial.println("GSM is Ready");
     notConnected = false;
       Serial.println("GPRS is Ready");
       notConnected = false;
       Serial.println("GPRS is not ready");
     Serial.println("GSM is not ready");


 Serial.println("GSM and GPRS is initialized");


void loop() {
   Serial.println("Sending message...");
   sms.print("Hello World!");
   messageSent = true;
   Serial.println("Message sent");


I think you have to put the telephone number without '-'.


First just include GSM.h - not all the individual modules.h

Second - the tel number must have no dashes and be a valid number - the sample below seems odd?

3rd - run the library examples first and insert your details to test the shield - it makes getting started much easier


The problem resurfaces again. I can no longer send SMS. What's wrong. Below are the outputs.

Code: [Select]

102 120>%19%%17%AT+CMGF=1%13%%13%%10%OK%13%%10%
120 8>AT+CLIP=1%13%%13%%10%OK%13%%10%
8 19>ATE0%13%%13%%10%OK%13%%10%
19 25>%13%%10%OK%13%%10%
GSM initialized
Enter a mobile number: 98997412
Now, enter SMS content: SENDING

gsm access true
25 29>%13%%10%>
gsm access true%26%%13%


AT+CMGS command have to reponse +CMGS: <number>, or a +CMS ERROR: <err> if an error occurred. In that output, the response isn't printed. Try to see it.


Try sending your message to the international style telephone number of the receiving device.
Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

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