Cellular forums Home > Archive > Cellular GSM Technology > February 2008 > AT+CMGL is freaking out









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author AT+CMGL is freaking out
vadim.berman

2008-02-06, 4:33 am

Hi all,

I am building an application sending and receiving SMSes using SMSlib.
It's more or less working with sending, however receiving is a
problem.

I went to the more basic level and after tweaking a lot with
HyperTerminal found out the following:

1. When in PDU mode, AT+CMGL=0 makes the phone hang. Until I switch
the phone off and then back on, it won't receive any more commands.
2. When in text mode, it returns OK for AT+CMGL and ERROR for AT
+CMGL=everything else (REC READ, REC UNREAD, ALL).

I went further and started tinkering with AT+CPMS. AT+CPMS=? returned
("SM"), ("SM"), ("SM") - which is a bit strange but who knows, maybe
normal. I set it to SM (AT+CPMS="SM","SM","SM") and the console
returned that all the storage compartments are empty, which is not
true.

What am I doing wrong? And why AT+CMGL does not want to list the
messages?

The phone is LG C3300 connected via a USB cable to virtual COM3 on
Windows XP.

Thx,
Vadim
John Henderson

2008-02-06, 4:33 am

vadim.berman wrote:

> Hi all,
>
> I am building an application sending and receiving SMSes using
> SMSlib. It's more or less working with sending, however
> receiving is a problem.
>
> I went to the more basic level and after tweaking a lot with
> HyperTerminal found out the following:
>
> 1. When in PDU mode, AT+CMGL=0 makes the phone hang. Until I
> switch the phone off and then back on, it won't receive any
> more commands. 2. When in text mode, it returns OK for AT+CMGL
> and ERROR for AT +CMGL=everything else (REC READ, REC UNREAD,
> ALL).


That's very odd behaviour for a GSM 07.05 compliant phone. All
I can suggest at the moment is some more diagnostics:

What do these commands return?

AT+CFUN? and
AT+CMGF=?

AT+CMGF? and
AT+CMGL=? when in text-mode

AT+CMGF? and
AT+CMGL=? when in PDU-mode

> I went further and started tinkering with AT+CPMS. AT+CPMS=?
> returned ("SM"), ("SM"), ("SM") - which is a bit strange but
> who knows, maybe normal.


That's saying the phone has SIM storage only - no independant
memory on the handset itself for messages.

> I set it to SM (AT+CPMS="SM","SM","SM") and the console
> returned that all the storage compartments are empty, which is
> not true.


Where do you think the messages are stored? If you swap the SIM
to another phone, do the messages go with the SIM? If your
"AT+CPMS=?" result is correct, they should all follow the SIM.

> What am I doing wrong? And why AT+CMGL does not want to list
> the messages?


Are the messages unread? Bear in mind that using "AT+CMGL" to
read unread messages changes their status from "unread" to
"read".

> The phone is LG C3300 connected via a USB cable to virtual
> COM3 on Windows XP.


Just in case you're having a buffering problem somewhere,
causing the hang, try a command which produces a lot of output.
See if that runs to completion without causing a hang. I
suggest

AT+COPN

(read the full list of operator names).

John
vadim.berman

2008-02-06, 4:33 am

Hi John,

Thank you for your reply.

Trying the commands you suggested:

> That's very odd behaviour for a GSM 07.05 compliant phone. =A0All
> I can suggest at the moment is some more diagnostics:
>
> What do these commands return?
>
> =A0 =A0 =A0 =A0 AT+CFUN? =A0 =A0 =A0 =A0and


+CFUN: 1
OK

> =A0 =A0 =A0 =A0 AT+CMGF=3D?


+CMGF: 0

ERROR

> =A0 =A0 =A0 =A0 AT+CMGF? =A0 =A0 =A0 =A0and


+CMFG: 1
OK

> =A0 =A0 =A0 =A0 AT+CMGL=3D? =A0 =A0 =A0 when in text-mode


+CMGL: "REC READ","REC UNREAD","STO SENT","STO UNSENT","ALL"
OK

> =A0 =A0 =A0 =A0 AT+CMGF? =A0 =A0 =A0 =A0and


+CMGF: 0
OK

and here there is something weird: when I tried to switch back to the
PDU mode by AT+CMGF=3D0, it froze! So I had to restart the phone.

> =A0 =A0 =A0 =A0 AT+CMGL=3D? =A0 =A0 =A0 when in PDU-mode


+CMGL: 0,1,2,3,4

OK

>
> That's saying the phone has SIM storage only - no independant
> memory on the handset itself for messages.


Isn't this strange? I mean, it's not a prehistoric phone, and it's not
locked.

>
> Where do you think the messages are stored? =A0If you swap the SIM
> to another phone, do the messages go with the SIM? =A0If your
> "AT+CPMS=3D?" result is correct, they should all follow the SIM.


OK.
Well... the phone has a lot of messages, over a hundred, and according
to CPMS there are only 25*3=3D75 maximum. Could they be breaking the
standard and putting the messages in some kind of proprietary storage
not accessible by AT?

>
> Are the messages unread? =A0Bear in mind that using "AT+CMGL" to
> read unread messages changes their status from "unread" to
> "read".


There are some unread messages, which are still unread according to
the phone's GUI.

>
> Just in case you're having a buffering problem somewhere,
> causing the hang, try a command which produces a lot of output.
> See if that runs to completion without causing a hang. =A0I
> suggest
>
> =A0 =A0 =A0 =A0 AT+COPN
>
> (read the full list of operator names).


This one looks cool :-) . But it did not hang.

Thanks a lot, John. Did you ever encounter anything like this?

Can the provider somehow make the SIM go nuts? Maybe they are denying
the access to the messages out of certain reasons? I mean the phone
works and looks OK, in a very good condition.

This is one weird puzzle.

Regards,
Vadim
John Henderson

2008-02-06, 3:33 pm

vadim.berman wrote:

> Thank you for your reply.
>
> Trying the commands you suggested:
>
>
> +CFUN: 1
> OK


That's the right response.

>
> +CMGF: 0
>
> ERROR


I don't like the look of the "ERROR" here. And why didn't it
list both "0" and "1" (PDU- and text-modes) in its list of
capabilities? Here's the same command used on my Wavecom
modem:

AT+CMGF=?
+CMGF: (0,1)

OK

>
> +CMFG: 1
> OK
>
>
> +CMGL: "REC READ","REC UNREAD","STO SENT","STO UNSENT","ALL"
> OK
>
>
> +CMGF: 0
> OK
>
> and here there is something weird: when I tried to switch back
> to the PDU mode by AT+CMGF=0, it froze! So I had to restart
> the phone.


That definitely shouldn't happen.

>
> +CMGL: 0,1,2,3,4
>
> OK


The other responses to commands so far all look OK.

>
> Isn't this strange? I mean, it's not a prehistoric phone, and
> it's not locked.
>
>
> OK.
> Well... the phone has a lot of messages, over a hundred, and
> according to CPMS there are only 25*3=75 maximum. Could they
> be breaking the standard and putting the messages in some kind
> of proprietary storage not accessible by AT?


Actually, 25 messages maximum of SIM storage (on that particular
SIM). The three storage location arguments to the "AT+CPMS"
command are <mem1>, <mem2>, and <mem3> as defined in GSM 07.05,
section 3.1. In most cases, they are effectively different
views of the same physical storage:

"<mem1> string type; memory from which messages are read and
deleted (commands List Messages +CMGL, Read Message +CMGR and
Delete Message +CMGD)"

"<mem2> string type; memory to which writing and sending
operations are made (commands Send Message from Storage +CMSS
and Write Message to Memory +CMGW) )", and

"<mem3> string type; memory to which received SMs are preferred
to be stored (unless forwarded directly to TE)"

So we're concerned only with the <mem1> view when using the
"AT+CMGL" command.

But that proves there's a problem somewhere. The phone says the
only storage is SIM storage, but you've got more messages
stored than the 25 which can fit onto the SIM!

I have a Siemens S55 phone with both SIM and phone storage, and
here's its response:

AT+CPMS=?
+CPMS: ("MT","SM","ME"),("MT","SM","ME"),("MT","SM","ME")

OK
AT+CPMS?
+CPMS: "SM",11,15,"SM",11,15,"SM",11,15

OK
AT+CPMS="ME","ME","ME"
+CPMS: 29,100,29,100,29,100


OK

(SMS storage capability is 15 SIM + 100 phone, with 11 and 29 of
those locations used respectively).

Do you get the same "SM"-only answer to "AT+CPMS=?" in both
PDU-mode and text-mode?

>
> There are some unread messages, which are still unread
> according to the phone's GUI.
>
>
> This one looks cool :-) . But it did not hang.
>
> Thanks a lot, John. Did you ever encounter anything like this?
>
> Can the provider somehow make the SIM go nuts? Maybe they are
> denying the access to the messages out of certain reasons? I
> mean the phone works and looks OK, in a very good condition.
>
> This is one weird puzzle.


I'd guess the most likely cause of your problems is firmware
bugs, making the phone non-compliant with GSM 07.05. Is there
a firmware upgrade for this phone?

A less likely possibility is that you're interacting with a
corrupted SIM. Can you try another SIM in the phone to see if
the problems persist?

John
vadim.berman

2008-02-07, 10:33 pm

Hi John,

Thank you very much for your involvement.

No, there is no firmware upgrade. And LG (I tried contacting them)
does not seem to have any means of liaison with developers nor people
who know to reply to technical questions.

I switched the SIM and the result is the same. Like someone in another
forum said, "buggy, buggy, buggy" :-) . I'm dropping the case.

I'd like to thank you again; I have to say, usually experts like you
are impossible to find on Usenet and in the forums.


On Feb 7, 6:37=A0am, John Henderson <jhenRemoveT...@talk21.com> wrote:
> vadim.berman wrote:
>
>
>
>
>
>
> That's the right response.
>
>
>
>
> I don't like the look of the "ERROR" here. =A0And why didn't it
> list both "0" and "1" (PDU- and text-modes) in its list of
> capabilities? =A0Here's the same command used on my Wavecom
> modem:
>
> =A0 =A0 =A0 =A0 AT+CMGF=3D?
> =A0 =A0 =A0 =A0 +CMGF: (0,1)
>
> =A0 =A0 =A0 =A0 OK
>
>
>
>
>
>
>
>
>
>
> That definitely shouldn't happen.
>
>
>
>
> The other responses to commands so far all look OK.
>
>
>
>
>
>
>
>
>
> Actually, 25 messages maximum of SIM storage (on that particular
> SIM). =A0The three storage location arguments to the "AT+CPMS"
> command are <mem1>, <mem2>, and <mem3> as defined in GSM 07.05,
> section 3.1. =A0In most cases, they are effectively different
> views of the same physical storage:
>
> "<mem1> string type; memory from which messages are read and
> deleted (commands List Messages +CMGL, Read Message +CMGR and
> Delete Message +CMGD)"
>
> "<mem2> string type; memory to which writing and sending
> operations are made (commands Send Message from Storage +CMSS
> and Write Message to Memory +CMGW) )", and
>
> "<mem3> string type; memory to which received SMs are preferred
> to be stored (unless forwarded directly to TE)"
>
> So we're concerned only with the <mem1> view when using the
> "AT+CMGL" command.
>
> But that proves there's a problem somewhere. =A0The phone says the
> only storage is SIM storage, but you've got more messages
> stored than the 25 which can fit onto the SIM!
>
> I have a Siemens S55 phone with both SIM and phone storage, and
> here's its response:
>
> =A0 =A0 =A0 =A0 AT+CPMS=3D?
> =A0 =A0 =A0 =A0 +CPMS: ("MT","SM","ME"),("MT","SM","ME"),("MT","SM","ME")
>
> =A0 =A0 =A0 =A0 OK
> =A0 =A0 =A0 =A0 AT+CPMS?
> =A0 =A0 =A0 =A0 +CPMS: "SM",11,15,"SM",11,15,"SM",11,15
>
> =A0 =A0 =A0 =A0 OK
> =A0 =A0 =A0 =A0 AT+CPMS=3D"ME","ME","ME"
> =A0 =A0 =A0 =A0 +CPMS: 29,100,29,100,29,100

>
> =A0 =A0 =A0 =A0 OK
>
> (SMS storage capability is 15 SIM + 100 phone, with 11 and 29 of
> those locations used respectively).
>
> Do you get the same "SM"-only answer to "AT+CPMS=3D?" in both
> PDU-mode and text-mode?
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> I'd guess the most likely cause of your problems is firmware
> bugs, making the phone non-compliant with GSM 07.05. =A0Is there
> a firmware upgrade for this phone?
>
> A less likely possibility is that you're interacting with a
> corrupted SIM. =A0Can you try another SIM in the phone to see if
> the problems persist?
>
> John


John Henderson

2008-02-13, 3:33 pm

vadim.berman wrote:

> Hi John,
>
> Thank you very much for your involvement.
>
> No, there is no firmware upgrade. And LG (I tried contacting
> them) does not seem to have any means of liaison with
> developers nor people who know to reply to technical
> questions.
>
> I switched the SIM and the result is the same. Like someone in
> another forum said, "buggy, buggy, buggy" :-) . I'm dropping
> the case.
>
> I'd like to thank you again; I have to say, usually experts
> like you are impossible to find on Usenet and in the forums.


You're welcome.

Is this phone running the Symbian OS? GSM/3GPP standard
SMS-reading "AT" commands apparently won't work on Symbian
phones, as I found out in a thread below. See "how can i See
my PDU at hyper terminal using AT+command".

I'm glad I discovered that when I did, as I was about to buy a
Symbian-powered Nokia UMTS phone.

John
LinkBot





Other Archives: Real Estate forum archive | Web Design archive | Software support archive | PC Hardware reviews archive | Medical topics archive

Copyright 2004 - 2008 cellphonetopics.com