no work send text message , help please

I am sending the phone number from vb.net application I have this scketch, but i have a error i dont know where because it does not send text message,please help i am using arduino mega 2560 and sm5100b-d

char incoming_char=0; //Will hold the incoming character from the Serial Port. char serInString[11]; int serInIndx = 0;

void setup() { Serial.begin(9600); Serial1.begin(9600); //GSM Serial.println("Comunicado..."); delay(20000); // give the GSM module time to initialise, locate network etc. } void readSerialString () { int sb; if(Serial.available()) {

while (Serial.available()) {

sb = Serial.read(); if (sb == '>') { serInString[serInIndx] = '\0'; serInIndx=0; sb=0; } else {

serInString[serInIndx] = sb; serInIndx++; }

}

} }

void loop() {//GSM

readSerialString();

//If a character comes in from the cellular module...

while(Serial1.available()){ if(Serial1.available() >0){ incoming_char=Serial1.read(); //Get the character from the cellular serial port. Serial.print(incoming_char); //Print the incoming character to the terminal. }//If a character is coming from the terminal to the Arduino...

if(Serial.available() >0){ incoming_char=Serial.read(); //Get the character coming from the terminal Serial1.print(incoming_char); //Send the character to the cellular module. } } Serial.print(serInString); Serial1.println("AT+CMGF=1"); // set SMS mode to text Serial1.print("AT+CMGS="); Serial1.print(34,BYTE); // ASCII equivalent of " Serial1.print(serInString); Serial1.println(34,BYTE); // ASCII equivalent of " delay(500); // give the module some thinking time Serial1.print("PIPPO"); Serial1.println(26,BYTE); // ASCII equivalent of Ctrl-Z delay(15000); // the SMS module needs time to return to OK status Serial.print("Msg enviada com sucesso");

do // loop temp just to test sketch { delay(1); } while (1>0); }

please help

yrame: Hi! I am working with a Gizduino with GSM module which will act as an SMS controller of appliances.

What is a Gizduino and what GSM module are you using? It is helpful to others to post links to the pieces are you using.

yrame: 1. I don't know how to interface AT commands with Arduino.

Generally the cell modems support the AT-Command set, which originated with the original land-line based modems. You send it a series of AT commands and get back responses. Your GSM module should (must?) have these commands documented.

yrame: 2. I'm not sure if the GSM module gets the text message being sent, because when I tried to text ON, there was no output in the serial monitor.

Maybe there is a (series of) AT-commands you send to check for available message?

yrame: 3. Serial.print("AT") - does this really make the GSM module respond? Or is it just a mere text output?

What's the difference between a response and "mere text output"? That's all the GSM module can respond with, text.

yrame: Help me please... I wanna graduate already! T-T

I wanna get some pancakes.