Discussion:
AT+CMGL is freaking out
(too old to reply)
vadim.berman
2008-02-06 05:43:42 UTC
Permalink
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 08:23:08 UTC
Permalink
Post by vadim.berman
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
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
Post by vadim.berman
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.
Post by vadim.berman
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.
Post by vadim.berman
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".
Post by vadim.berman
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 09:19:39 UTC
Permalink
Hi John,

Thank you for your reply.
That's very odd behaviour for a GSM 07.05 compliant phone.  All
What do these commands return?
        AT+CFUN?        and
+CFUN: 1
OK
        AT+CMGF=?
+CMGF: 0

ERROR
        AT+CMGF?        and
+CMFG: 1
OK
        AT+CMGL=?       when in text-mode
+CMGL: "REC READ","REC UNREAD","STO SENT","STO UNSENT","ALL"
OK
        AT+CMGF?        and
+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.
        AT+CMGL=?       when in PDU-mode
+CMGL: 0,1,2,3,4

OK
Post by vadim.berman
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.
Isn't this strange? I mean, it's not a prehistoric phone, and it's not
locked.
Post by vadim.berman
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.
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?
Post by vadim.berman
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".
There are some unread messages, which are still unread according to
the phone's GUI.
Post by vadim.berman
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).
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 19:37:52 UTC
Permalink
Post by vadim.berman
Thank you for your reply.
Post by John Henderson
That's very odd behaviour for a GSM 07.05 compliant phone.
What do these commands return?
AT+CFUN? and
+CFUN: 1
OK
That's the right response.
Post by vadim.berman
Post by John Henderson
AT+CMGF=?
+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
Post by vadim.berman
Post by John Henderson
AT+CMGF? and
+CMFG: 1
OK
Post by John Henderson
AT+CMGL=? when in text-mode
+CMGL: "REC READ","REC UNREAD","STO SENT","STO UNSENT","ALL"
OK
Post by John Henderson
AT+CMGF? and
+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.
Post by vadim.berman
Post by John Henderson
AT+CMGL=? when in PDU-mode
+CMGL: 0,1,2,3,4
OK
The other responses to commands so far all look OK.
Post by vadim.berman
Post by John Henderson
Post by vadim.berman
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.
Isn't this strange? I mean, it's not a prehistoric phone, and
it's not locked.
Post by John Henderson
Post by vadim.berman
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.
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?
Post by vadim.berman
Post by John Henderson
Post by vadim.berman
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".
There are some unread messages, which are still unread
according to the phone's GUI.
Post by John Henderson
Post by vadim.berman
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).
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 21:38:05 UTC
Permalink
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.
Post by John Henderson
Post by vadim.berman
Thank you for your reply.
Post by John Henderson
That's very odd behaviour for a GSM 07.05 compliant phone.
What do these commands return?
AT+CFUN?        and
+CFUN: 1
OK
That's the right response.
Post by vadim.berman
Post by John Henderson
AT+CMGF=?
+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
        AT+CMGF=?
        +CMGF: (0,1)
        OK
Post by vadim.berman
Post by John Henderson
AT+CMGF?        and
+CMFG: 1
OK
Post by John Henderson
AT+CMGL=?       when in text-mode
+CMGL: "REC READ","REC UNREAD","STO SENT","STO UNSENT","ALL"
OK
Post by John Henderson
AT+CMGF?        and
+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.
Post by vadim.berman
Post by John Henderson
AT+CMGL=?       when in PDU-mode
+CMGL: 0,1,2,3,4
OK
The other responses to commands so far all look OK.
Post by vadim.berman
Post by John Henderson
Post by vadim.berman
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.
Isn't this strange? I mean, it's not a prehistoric phone, and
it's not locked.
Post by John Henderson
Post by vadim.berman
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.
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
"<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
        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?
Post by vadim.berman
Post by John Henderson
Post by vadim.berman
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".
There are some unread messages, which are still unread
according to the phone's GUI.
Post by John Henderson
Post by vadim.berman
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).
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
John Henderson
2008-02-13 21:12:03 UTC
Permalink
Post by vadim.berman
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

Loading...