Atmega16 not receiving complete response on serial from GSM sim300
i working on gsm sim300. want receive sms on serial port of atmega16. when send sms " *23# "to gsm modem send,
" \r\n+cmgr:\s"rec\sunread","+919762148043",,"14/03/13,23:04:32+22"\r\n*23#\r\n\r\nok\r\n "
this string in response. parsing string using logic
i expecting " +++r*23@" on lcd display, getting " +++r@".
it means controller receive
" \r\n+cmgr:\s"rec\sunread","+919762148043",,"14/03/13,23:04:32+22"\r\n "
this of string. got stuck here. gsm send complete string(i verified that) controller not receiving complete. please help.
" \r\n+cmgr:\s"rec\sunread","+919762148043",,"14/03/13,23:04:32+22"\r\n*23#\r\n\r\nok\r\n "
this string in response. parsing string using logic
code: [select]
while(serial.available())
{
char tempchar = serial.read();
if(tempchar == '+')
{
ispresms = true;
lcd.print('+');
}
else if((tempchar == '\r') && (ispresms == true))
{
ispresms = false;
lcd.print('r');
}
else if(tempchar == '*')
{
digitalwrite(okled, high);
issms = true;
lcd.print('*');
}
else if((tempchar == '#') && (issms == true))
{
digitalwrite(powerled, high);
issms = false;
lcd.print(sms);
}
else if(issms)
{
digitalwrite(alertled, high);
sms += tempchar;
}
}
lcd.print('@');
}
i expecting " +++r*23@" on lcd display, getting " +++r@".
it means controller receive
" \r\n+cmgr:\s"rec\sunread","+919762148043",,"14/03/13,23:04:32+22"\r\n "
this of string. got stuck here. gsm send complete string(i verified that) controller not receiving complete. please help.
Arduino Forum > Using Arduino > Microcontrollers > Atmega16 not receiving complete response on serial from GSM sim300
arduino
Comments
Post a Comment