Hi All, I not very familiar with the language and am having difficulty setting up my sketch so that the arduino will automatically send commands to the GSM shield without my manual input into two way serial port. I have been able to get the two way communication working to test using the following sketch:

#include <SoftwareSerial.h>char incoming_char=0; //Will hold the incoming character from the Serial Port.SoftwareSerial cell(2,3); //Create a 'fake' serial port. Pin 2 is the Rx pin, pin 3 is the Tx pin.void setup(){ //Initialize serial ports for communication. Serial.begin(9600); cell.begin(9600); Serial.println("Starting SM5100B Communication...");}void loop(){ //If a character comes in from the cellular module... if(cell.available() >0) { incoming_char=cell.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 cell.print(incoming_char); //Send the character to the cellular module. }}

What I would like to do is automate the input of the command "AT=CCED=0,2" retrieve the information and text the retrieved information to another location.

The tutorial I am using for reference with this uses the above code to send an SMS.The tutorial can be found here: http://tronixstuff.wordpress.com/2011/01/19/tutorial-arduino-and-gsm-cellular-part-one/[move][/move]

#include <SoftwareSerial.h>char incoming_char=0; //Will hold the incoming character from the Serial Port.SoftwareSerial cell(2,3); void setup(){ Serial.begin(9600); cell.begin(9600); Serial.println("Starting SM5100B Communication..."); delay(35000); // give the GSM module time to initialise, locate network etc. // this delay time varies. Use example 26.1 sketch to measure the amount // of time from board reset to SIND: 4, then add five seconds just in case}void loop(){ cell.println("AT+CCED=0,2"); //If a character comes in from the cellular module... if(cell.available() >0) { incoming_char=cell.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 cell.print(incoming_char); //Send the character to the cellular module. } delay(20000); // wait 20 seconds.}

I believe this should work (not really) when I upload this and run the serial port the text prints into the serial port letter by letter with 20sec delay. What I need is for this part of the code

Quote

//If a character comes in from the cellular module... if(cell.available() >0) { incoming_char=cell.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 cell.print(incoming_char); //Send the character to the cellular module. } delay(20000); // wait 20 seconds.}