AT command problem

Posted: 04-06-2005, 02:51 AM
I am polling my GSM modem for new messages every 10 seconds...
and it works fine for some 5 minutes or so and returns OK.

after that it starts returning funny charracters. Character that looks
like
a small rectangle( some what like this []).

I have tried this on wavecom and round solutions modems and its the
same on both.

any clues ?

Cheeros
Rishi

Reply With Quote

Responses to "AT command problem"

John Henderson
John Henderson's Avatar
Posts: n/a
 
Re: AT command problem
Posted: 04-06-2005, 06:57 AM
rishi.israni@gmail.com wrote:

> I am polling my GSM modem for new messages every 10 seconds...
> and it works fine for some 5 minutes or so and returns OK.
>
> after that it starts returning funny charracters. Character
> that looks like a small rectangle( some what like this []).
>
> I have tried this on wavecom and round solutions modems and
> its the same on both.
>
> any clues ?


This looks like a speed (baud rate) or character framing (number
of data or stop bits, or parity) problem.

Is the modem set to auto-baud? What do "AT+IPR?", "AT+ICF", and
"AT+WRST?" return?

John
Reply With Quote
rishi.israni@gmail.com
rishi.israni@gmail.com's Avatar
Posts: n/a
 
Re: AT command problem
Posted: 04-06-2005, 11:53 AM
Will try once i reach my place...but is it possible for the modem to
function correctly for a while and then all of a sudden start returning
junk if it is in autoo-baud ?

Cheeros
Rishi

Reply With Quote
rishi.israni@gmail.com
rishi.israni@gmail.com's Avatar
Posts: n/a
 
Re: AT command problem
Posted: 04-06-2005, 11:56 AM
Hi John,
thanks for the help last time. The wavecom modem did not
have GPRS stack enabled so i switched to a round solutions modem.
I was able to send mail using AT command.

Cheeros
Rishi

Reply With Quote
John Henderson
John Henderson's Avatar
Posts: n/a
 
Re: AT command problem
Posted: 04-06-2005, 09:22 PM
rishi.israni@gmail.com wrote:

> Will try once i reach my place...but is it possible for the
> modem to function correctly for a while and then all of a
> sudden start returning junk if it is in autoo-baud ?


It shouldn't be possible, but that doesn't mean it isn't
happening

Another possibility is that you're running at a fixed rate and
character framing, and have got Wavecom reset (AT+WRST) set to
5 minutes (undoing your configuration).

John
Reply With Quote
rishi.israni@gmail.com
rishi.israni@gmail.com's Avatar
Posts: n/a
 
Re: AT command problem
Posted: 04-07-2005, 03:00 AM
Hi,
I am using a round solutions modem now. My wavecom has some issues.
wanted to ask u something. When i send AT command to the modem using my
program...what is the best way of reading the return buffer.

I mean how do i know when to stop reading. \r\n does not work for all
commands...
i look for the expected return, lets say OK when i send an AT command
via my program and then i ignore what is after that and i flush before
every send to the modem.

Any good modem programming articles that u can point me to ?

Cheers
Rishi

Reply With Quote
John Henderson
John Henderson's Avatar
Posts: n/a
 
Re: AT command problem
Posted: 04-07-2005, 05:27 AM
rishi.israni@gmail.com wrote:

> Hi,
> I am using a round solutions modem now. My wavecom has
> some issues.
> wanted to ask u something. When i send AT command to the modem
> using my program...what is the best way of reading the return
> buffer.
>
> I mean how do i know when to stop reading. \r\n does not work
> for all commands...
> i look for the expected return, lets say OK when i send an AT
> command via my program and then i ignore what is after that
> and i flush before every send to the modem.


The following works for me:

I handle the reading of the buffer with a purpose-built
subroutine. I pass it 2 (optional) parameters: the
response-termination string I'm expecting (usually
"\r\nOK\r\n"), and the number of seconds to wait for further
input if I don't see that string. This means that I might get
other responses as well (I also expect unsolicited responses
like "+CREG:", "+CSQ:", "+CCED:" and "+CBM:"), and need to
separate these outside of this subroutine. So I always check
the buffer for every type of response that might be expected.
If the response happens to be incomplete, I leave the
incomplete part of the response string there so that the
remainder of that response gets concatenated to it at the next
call to the input subroutine.

This input subroutine waits around for a half-second or so for
further input in any case, and I find it works perfectly
reliably.

I hope that helps.

> Any good modem programming articles that u can point me to ?


http://www.programmersheaven.com/ is a good starting point.

John
Reply With Quote
rishi.israni@gmail.com
rishi.israni@gmail.com's Avatar
Posts: n/a
 
Re: AT command problem
Posted: 04-07-2005, 05:08 PM
setting the baud rate works....
hey do u know how i can turn off the RING and other such disturbing
unsolicited responses

cheers
Rishi

Reply With Quote
John Henderson
John Henderson's Avatar
Posts: n/a
 
Re: AT command problem
Posted: 04-08-2005, 12:45 PM
rishi.israni@gmail.com wrote:

> setting the baud rate works....
> hey do u know how i can turn off the RING and other such
> disturbing unsolicited responses


I haven't tested it, but you could have a look at "AT+CMER"
(perhaps "AT+CMER=0,0,0" might work, but you might lose output
you need too).

A better, more defensive programming approach is to deal with
them.

I keep the device output in a buffer string variable. I
frequently search that string for all result code introducers
that interest me, and process them in a logical, sensible
order. Having dealt with one, I immediately destroy it (by
overwriting a character, changing "+CBM:" to "+ BM:" for
instance). At appropriate points, I shorten the string or
clear it completely.

For commands that don't produce a leading result code (like
"AT+CGSN"), I temporarily turn command echo on, and take my cue
from the echoed command instead.

John
Reply With Quote
Meff via CellPhoneKB.com
Meff via CellPhoneKB.com's Avatar
Posts: n/a
 
Re: AT command problem
Posted: 04-09-2005, 01:01 PM
Some hints on the Round Solutions modem www.roundsolutions.com you will
find on http://www.gsm-modem.de/gsm-modem-faq.html .
Sending of emails is descripted on http://www.gsm-modem.de/smtp-gprs.html .
Regards
Meff
Reply With Quote
 
Thread Tools Display Modes
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
AT Command Robert Collard GSM 3 03-08-2005 01:01 AM
T610 AT Command set Digital Sony Ericsson 8 05-21-2004 12:02 PM
T610 AT command set Tym Sony Ericsson 0 04-30-2004 03:05 PM
T610: AT command for sms Rudi Hofer Sony Ericsson 4 11-03-2003 04:55 PM
R300LX AT Command Set? Todd T. Fries Sony Ericsson 0 06-24-2003 04:57 PM


All times are GMT. The time now is 12:47 AM.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33