GSM Shield SIM908 cannot send AT Command

Hi, I have a problem about using GSM Shield SIM908 SimCom. I ever tried SIM908 and tested for sending message and using GPRS using AT Command Tester worked properly. But, when i made a code to sending message and using GPRS to hit GET got unsuccessful send AT Command because i didn't receive the message. I also didn't get the response of AT Command from serial monitor.

Here is the successful of sending message with AT Command Tester:

RDY

+CFUN: 1

+CPIN: READY

GPS Ready

Call Ready
AT+CREG?

+CREG: 0,1

OK
AT+CMGF?

+CMGF: 1

OK

SMS message for is configured for Text mode
Device is configured for Text mode for SMS.
AT+CMGS="12345678910"
> tes from arduino

Call Ready
+CMGS: 1
OK
SMS Send successful

Here is my code to sending message:

void setup()
 {
    //Init the driver pins for GSM function
    pinMode(3,OUTPUT);
    pinMode(4,OUTPUT);
    pinMode(5,OUTPUT);
   //Output GSM Timing
    
    digitalWrite(5,HIGH);
    delay(1500);
    digitalWrite(5,LOW);
    delay(5000);
    delay(5000);
    digitalWrite(3, LOW);
    digitalWrite(4, HIGH);
    delay(5000);
    delay(5000);
    Serial.begin(9600);
    delay(5000);
 }
 void loop()   
 {
   Serial.print("AT+CMGF=1\r\n");
   delay(2000);
   Serial.println("AT+CMGS=\"12345678910\",\r\n");
   delay(2000);
   Serial.println("Hello from SIM908");
   delay(2000);
   Serial.println((char)26);//the ASCII code of the ctrl+z is 26
   delay(2000);
}

My code above can't send message to my number and i tried to get the response using Serial.available() always getting nothing, so that i didn't know my at command sending properly and getting response or not. Can you help me?
Thank you.

Can you please post the code that does work.

Hi UKHeliBob, i didn't have code which is work for sending message because my code above can display println in serial monitor but unsuccessful sending message. So i don't know why my code didn't work. I also curious about get response return code from at command, how to get return code from at command using sim908? Thank you.

Sorry, but I thought that you had tried some code that worked.

I ever tried SIM908 and tested for sending message and using GPRS using AT Command Tester worked properly.

I didn't make some code, but i just tried it with online AT Command Tester (Download AT Command Tester | M2MSupport.net) which is just scan the serial port and set the baud rate then click connect i can try all of AT Command there and my GSM 908 worked properly. But when i make some code above, the message never going to my phone. I want to make some code which is work properly because i will use it with the other code which manage some sensors.

Which SIM908 device? Which Arduino? How are they connected?

I use SIM908 (GPS_GPRS_GSM_Module_V3.0_(SKU_TEL0051)-DFRobot) and use arduino uno, i also add external power supply using adapter 7v.

I've not (yet) got a SIM908 to play with and the documentation for that shield is pretty scant.

Try this, based on their example:

// Product name: GPS/GPRS/GSM Module V3.0
// # Product SKU : TEL0051
// # Version     : 0.1
 
// # Description:
// # The sketch for driving the gsm mode via the USB interface
 
// # Steps:
// #        1. Turn the S1 switch to the Prog(right side)
// #        2. Turn the S2 switch to the USB side(left side)
// #        3. Set the UART select switch to middle one.
// #        4. Upload the sketch to the Arduino board(Make sure turn off other Serial monitor )
// #        5. Turn the S1 switch to the comm(left side)       
// #        6. RST the board 

void setup()
 {
    //Init the driver pins for GSM function
    pinMode(3,OUTPUT);
    pinMode(4,OUTPUT);
    pinMode(5,OUTPUT);
   //Output GSM Timing
    
    digitalWrite(5,HIGH);
    delay(1500);
    digitalWrite(5,LOW);
    delay(5000);
    digitalWrite(3,LOW);//enable GSM TX、RX
    digitalWrite(4,HIGH);//disable GPS TX、RX
	
    Serial.begin(9600);
	
   Serial.print("AT+CMGF=1\r\n");
   delay(2000);
   Serial.println("AT+CMGS=\"+123456789101\"");
   delay(2000);
   Serial.println("Hello from SIM908");
   delay(2000);
   Serial.println((char)26);//the ASCII code of the ctrl+z is 26
   delay(2000);
 }
 void loop()   
{
}

Don't forget to follow the instructions at the top of the code.

I've used a text editor to create it, so it's not compiled or tested!

You do have sufficient credit on your sim card don't you?

Hi dannable, thank you for your code, i've tried to test your code to my SIM908 but i still didn't get message to my phone :frowning:

Capture.PNG

If I understand the schematics for the shield correctly, you shouldn't have the usb cable plugged in. The Arduino is trying to communicate with the SIM908 using Rx & Tx.

However, the image you posted shows that the Arduino is sending the correct messages, so if you have configured the shield as per the instructions AND you have sufficent credit on the SIM, it should send. Unfortunately I don't have that shield so I can't actually test it myself.

I also have tried to unplugged the usb cable, configured the shield as per the instruction and my simcard still have sufficient credit, it still didn't send the message to my phone. Thank you dannable for your nice help!

Ok, the following code works. I am using a Dfrobot SIM908 shield, a fake Duemilanove and a 2 amp power supply. I uploaded the code to the 'Arduino' before attaching the shield. Note the switch positions.

// Product name: GPS/GPRS/GSM Module V3.0
// # Product SKU : TEL0051
// # Version     : 0.1

// # Description:
// # The sketch for driving the gsm mode via the Arduino board

// # Steps:
// #        1. Turn the S1 switch to the Prog(right side)
// #        2. Turn the S2 switch to the Arduino side(left side)
// #        3. Set the UART select switch to middle one.
// #        4. Upload the sketch to the Arduino board
// #        5. Turn the S1 switch to the comm(left side) 
// #        6. RST the board 

// #        wiki link- http://www.dfrobot.com/wiki/index.php/GPS/GPRS/GSM_Module_V3.0_(SKU:TEL0051)

byte gsmDriverPin[3] = {3,4,5};//The default digital driver pins for the GSM and GPS mode
//If you want to change the digital driver pins
//or you have a conflict with D3~D5 on Arduino board,
//you can remove the J10~J12 jumpers to reconnect other driver pins for the module!
void setup()
{    
  //Init the driver pins for GSM function
  for(int i = 0 ; i < 3; i++){
    pinMode(gsmDriverPin[i],OUTPUT);
  }
  digitalWrite(5,HIGH);//Output GSM Timing 
  delay(1500);
  digitalWrite(5,LOW);  
  digitalWrite(3,LOW);//Enable the GSM mode
  digitalWrite(4,HIGH);//Disable the GPS mode
  delay(2000);
  Serial.begin(9600); //set the baud rate
  delay(5000);//call ready
  delay(5000);
  delay(5000);
  Serial.println("AT+CMGF=1");
  delay(1000);
  Serial.println("AT+CMGS=\"+447751123456\"");//Change the receiver phone number
  delay(1000);
  Serial.print("Hello from SMIM908");//the message you want to send
  delay(1000);
  Serial.write(26);

}

void loop()
{  
}