Sign in with
Sign up | Sign in
Your question

AT command problem

Last response: in Technologies
Share
Anonymous
April 5, 2005 10:51:19 PM

Archived from groups: alt.cellular.gsm (More info?)

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

More about : command problem

Anonymous
April 6, 2005 7:53:50 AM

Archived from groups: alt.cellular.gsm (More info?)

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
Anonymous
April 6, 2005 7:56:02 AM

Archived from groups: alt.cellular.gsm (More info?)

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
Related resources
Anonymous
April 6, 2005 7:57:57 PM

Archived from groups: alt.cellular.gsm (More info?)

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
Anonymous
April 6, 2005 11:00:01 PM

Archived from groups: alt.cellular.gsm (More info?)

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
Anonymous
April 7, 2005 10:22:36 AM

Archived from groups: alt.cellular.gsm (More info?)

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
Anonymous
April 7, 2005 1:08:29 PM

Archived from groups: alt.cellular.gsm (More info?)

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

cheers
Rishi
Anonymous
April 7, 2005 6:27:53 PM

Archived from groups: alt.cellular.gsm (More info?)

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
Anonymous
April 9, 2005 1:45:18 AM

Archived from groups: alt.cellular.gsm (More info?)

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
Anonymous
April 10, 2005 6:32:46 AM

Archived from groups: alt.cellular.gsm (More info?)

Hi,
I finally figured it out...it was the baud rate settings issue. Once is
set it to 19200 using th AT+IPR it is quite ok now.

One last problem remaining...when i enter the data mode...i cannot exit
it...
nothing happens when i send +++ also... :( 

its quite fun playing with the modem..but unfortunately round solutions
documentation is not as good as wavecome...

Cheers
Rishi
Anonymous
April 11, 2005 12:04:36 AM

Archived from groups: alt.cellular.gsm (More info?)

rishi.israni@gmail.com wrote:

> One last problem remaining...when i enter the data mode...i
> cannot exit it...
> nothing happens when i send +++ also... :( 

Don't neglect the importance of the guard time. There must be a
significant pause in the data stream both sides of the "+++"
escape string (but not within it). I don't know what the
default is, but 3 seconds should be more than sufficient.

John
Anonymous
April 11, 2005 12:09:35 AM

Archived from groups: alt.cellular.gsm (More info?)

I've experiences quite differing behaviour from various modems in response
to the '+++' and 'ATH' commands.
Some devices tolerate zero guard time, some definitely require it (though
IMHO 3seconds is a lot...). One unit actually responded with an 'OK' to the
'+++'. Be prepared :) 
I decided to turn to the 'drop DTR' method of hanging up - but if the OP
only needs to enter command mode temporarily, that's of course not going to
help him...

Just my 2 cents..

Regards
Per


"John Henderson" <jhenRemoveThis@talk21.com> wrote in message
news:3bsc1lF6kp7prU1@individual.net...
> rishi.israni@gmail.com wrote:
>
> > One last problem remaining...when i enter the data mode...i
> > cannot exit it...
> > nothing happens when i send +++ also... :( 
>
> Don't neglect the importance of the guard time. There must be a
> significant pause in the data stream both sides of the "+++"
> escape string (but not within it). I don't know what the
> default is, but 3 seconds should be more than sufficient.
>
> John
Anonymous
April 11, 2005 12:15:52 AM

Archived from groups: alt.cellular.gsm (More info?)

rishi.israni@gmail.com wrote:

> I finally figured it out...it was the baud rate settings
> issue. Once is set it to 19200 using th AT+IPR it is quite ok
> now.

You might find that 9600 is a better choice for a Wavecom
Fastrack modem, as that's what the DCE => DTE side will revert
to after a reset using "AT+CFUN" or "AT+WRST".

And for GPRS use, 57600 or 115200 are the realistic choices to
get class 10 throughput.

Personally, I like to use autobaud. You might need to save that
setting to EPROM though, using "AT&W".

John
Anonymous
April 11, 2005 10:40:59 AM

Archived from groups: alt.cellular.gsm (More info?)

Per Laursen wrote:

> I've experiences quite differing behaviour from various modems
> in response to the '+++' and 'ATH' commands.
> Some devices tolerate zero guard time, some definitely require
> it (though IMHO 3seconds is a lot...). One unit actually
> responded with an 'OK' to the '+++'. Be prepared :) 

I think it should do that - it's going into command mode, after
all.

> I decided to turn to the 'drop DTR' method of hanging up - but
> if the OP only needs to enter command mode temporarily, that's
> of course not going to help him...

A couple of further thoughts for Rishi: make sure that you
haven't included a <carriage return> with the "+++". And
because some systems will buffer the output (flushing with a
<carriage return> for instance), you might need to read up on
flushing the "+++" from the buffers in your compiler's
documentation.

John
Anonymous
April 11, 2005 9:33:52 PM

Archived from groups: alt.cellular.gsm (More info?)

"John Henderson" <jhenRemoveThis@talk21.com> wrote in message
news:3btharF6jujiiU1@individual.net...
>
> I think it should do that - it's going into command mode, after
> all.

You could very well be right - the 'standards' leave a lot to the
interpretation of manufactures and users, IMO.
Anyway, two of three (Ericsson GM29 and Siemens TC35) do not respond with
'ok' to the '+++', one (OvisLink G??1500 PCMCIA - not sure about the exact
p/n) does.
/Per
Anonymous
April 12, 2005 10:42:14 AM

Archived from groups: alt.cellular.gsm (More info?)

Per Laursen wrote:

> You could very well be right - the 'standards' leave a lot to
> the interpretation of manufactures and users, IMO.
> Anyway, two of three (Ericsson GM29 and Siemens TC35) do not
> respond with 'ok' to the '+++', one (OvisLink G??1500 PCMCIA -
> not sure about the exact p/n) does.

That's interesting. I'm not saying you're wrong, but the TC35
"AT Command Set" manual I've got clearly shows an "OK" response
to "+++". I've never used a TC35 though.

It goes on to specify a guard time of "1000 ms", and mentions
that the three "+" characters must be sent "all within 1000
ms".

As an aside, a modem with zero guard time could not be used to
connect to an ISP and post this message - because it contains
the "escape to command mode" sequence.

John
Anonymous
April 12, 2005 10:56:17 PM

Archived from groups: alt.cellular.gsm (More info?)

i solved my problem...
I was making a mistake..i was hoping to disconnect from a smtp session
using +++. The escape sequence works after i send a QUIT commands to
the smtp and service channel is closed.

I have to be able to send http packets over the gprs connection that i
have established...Is it by anyway possible to direct my program to use
the gprs connection instead of the normal lan that i use...?

There is a class by the name of WebClient in .NET which handles http. I
was hoping if i could redirect the communication via my gprs connection
then i would not need to send http commands on the wire myself.

Cheers
Rishi
Anonymous
April 18, 2005 10:20:05 PM

Archived from groups: alt.cellular.gsm (More info?)

I am using rasdial.exe and i call it from my program to dialup my gprs
connection.

then i can use .net's built in webclient class to access the internet.

cheers
Rishi
!