Arduino DUE GSM SIM300 interfacing problem


i trying interface arduino due sim300 , while uploading program there no error detected , uploading successful. getting message on serial monitor not sending mobile.the gsm working hyperterminal.
the problem might in "ctrl+z" instruction.
i have attached program file.

void setup(){
serial.begin(9600); // gprs baud rate
delay(2500);

begin:
serial.println("at"); //to check if gsm module working
if(!serial.available())
goto begin;
delay(2000);
serial.println("at+cmgf=1"); // set sms mode text
while(!serial.available());

delay(1500);
}
void loop(){

delay(1500);
serial.print("at+cmgs=");
serial.print('"');
serial.print("xxxxxxxxxx");
serial.print('"');
serial.write(0x0d);  // carriage return in hex
serial.write(0x0a);
delay(3000);
serial.write(0x3e);
delay(2000);
serial.println("this demo message"); //this message sent

delay(2000);


serial.write(0x1a); //ascii code of ctrl+z send message
serial.write(0x0d);  // carriage return in hex
serial.write(0x0a);
delay(5000);
while(1);
}

whether problem due or in program?
please reply

code: [select]
begin:
serial.println("at"); //to check if gsm module working
if(!serial.available())
goto begin;

it unreasonable expect reply within nanoseconds of sending @ command. sending 1 when don't response within nanoseconds unreasonable. end blocking waiting room in buffer send @ command before first response received.

get rid of stupid goto statement. use while statement, instead. , wait!

quote
whether problem due or in program?
that far read in code, i'm going being problem in program.


Arduino Forum > Using Arduino > Programming Questions > Arduino DUE GSM SIM300 interfacing problem


arduino

Comments