the problem is the GPRS did not know the SMS service center number, to fixed it use command AT+CSCA="+964750001140" (change number with your mobile service provider), be aware this commad should type in between command AT+CMGF=1 and AT+CMGS="target number",
the code below work great, i am using hardware serial on pin 7,8 first write:
Code: Select all
#include <SoftwareSerial.h>
SoftwareSerial GPRS(7, 8);
GPRS.begin(19200); // the GPRS baud rate
Serial.begin(19200); // the Serial port of Arduino baud rate.
delay(500);
Code: Select all
GPRS.print("AT+CMGF=1\r"); delay(1000); //text mode enabled
GPRS.println("AT+CMGS= \"+964750713xxxx\""); delay(1000); //target number
GPRS.println("AT+CSCA= \"+964750001140\""); delay(1000); //SMS service center
GPRS.println("Arduino sent this SMS itself "); delay(1000); // type SMS
GPRS.write(0x1A); delay(1000); // ctrl+z to send SMS
GPRS.println();