gnokii-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: smsd problem with AT model


From: A. Andria
Subject: Re: smsd problem with AT model
Date: Fri, 01 Sep 2006 07:25:46 +0700
User-agent: Thunderbird 1.5.0.5 (Windows/20060719)

Daniele Forsi wrote:
> A. Andria wrote:

>> address@hidden:~# gnokii --getsms SM 1
>> [...]
>> Message sent: 0x12 / 0x0009
>> 41 54 2b 43 50 4d 53 3f 0d                      | AT+CPMS?
>> write: [AT+CPMS?<cr>]
>> read : [AT+CPMS?<cr><cr><lf>+CPMS:
>> "SM",2,30,"SM",2,30<cr><lf><cr><lf>OK<cr><lf>]
>> Message received: 0x12 / 0x002d
>> 02 41 54 2b 43 50 4d 53 3f 0d 0d 0a 2b 43 50 4d |  AT+CPMS?   +CPM
>> 53 3a 20 22 53 4d 22 2c 32 2c 33 30 2c 22 53 4d | S: "SM",2,30,"SM
>> 22 2c 32 2c 33 30 0d 0a 0d 0a 4f 4b 0d          | ",2,30    OK
>> Received message type 12
>> GetSMS SM 1 failed! (Command failed.)
>> Serial device: closing device

the answer you get is shorter than what is expected by the AT driver

you get:
+CPMS: "SM",2,30,"SM",2,30

while the driver needs a third group like this:
+CPMS: "SM",33,50,"SM",33,50,"MT",44,200

so the driver should take into account both cases

can you test the following patch?

Index: common/phones/atgen.c
===================================================================
RCS file: /sources/gnokii/gnokii/common/phones/atgen.c,v
retrieving revision 1.126
diff -u -r1.126 atgen.c
--- common/phones/atgen.c       8 Aug 2006 22:06:39 -0000       1.126
+++ common/phones/atgen.c       30 Aug 2006 12:36:35 -0000
@@ -1441,7 +1441,9 @@

if (sscanf(buf.line2, "+CPMS: \"%*c%*c\",%d,%*d,\"%*c%*c\",%*d,%*d,\"%c%c\",%*d,%*d",
                   &data->sms_status->number, &store[0], &store[1]) != 3)
-               return GN_ERR_FAILED;
+ if (sscanf(buf.line2, "+CPMS: \"%c%c\",%d,%*d,\"%*c%*c\",%*d,%*d",
+                  &store[0], &store[1], &data->sms_status->number) != 3)
+                       return GN_ERR_FAILED;

        data->sms_status->unread = 0;
        data->sms_status->changed = 0;


Thanks for the clue Daniele.

After applying the patch, now gnokii --getsms SM 1 got an Error 302

address@hidden:~# gnokii --getsms SM 1
GNOKII Version 0.6.14
[.....]
Initializing AT capable mobile phone ...
Serial device: opening device /dev/ttyS0
Serial device: setting RTS to high and DTR to high
Message sent: 0x00 / 0x0004
41 54 5a 0d                                     | ATZ
write: [ATZ<cr>]
read : [ATZ<cr><cr><lf>OK<cr><lf>]
Message received: 0x00 / 0x000a
02 41 54 5a 0d 0d 0a 4f 4b 0d                   |  ATZ   OK
Received message type 00
Message sent: 0x00 / 0x0005
41 54 45 31 0d                                  | ATE1
write: [ATE1<cr>]
read : [ATE1<cr><cr><lf>OK<cr><lf>]
Message received: 0x00 / 0x000b
02 41 54 45 31 0d 0d 0a 4f 4b 0d                |  ATE1   OK
Received message type 00
Message sent: 0x00 / 0x000a
41 54 2b 43 4d 45 45 3d 31 0d                   | AT+CMEE=1
write: [AT+CMEE=1<cr>]
read : [AT+CMEE=1<cr><cr><lf>OK<cr><lf>]
Message received: 0x00 / 0x0010
02 41 54 2b 43 4d 45 45 3d 31 0d 0d 0a 4f 4b 0d |  AT+CMEE=1   OK
Received message type 00
Message sent: 0x06 / 0x0008
41 54 2b 43 47 4d 4d 0d                         | AT+CGMM
write: [AT+CGMM<cr>]
read : [AT+CGMM<cr><cr><lf> MULTIBAND 900E 1800 <cr><lf><cr><lf>OK<cr><lf>]
Message received: 0x06 / 0x0029
02 41 54 2b 43 47 4d 4d 0d 0d 0a 20 4d 55 4c 54 |  AT+CGMM    MULT
49 42 41 4e 44 20 20 39 30 30 45 20 20 31 38 30 | IBAND  900E  180
30 20 0d 0a 0d 0a 4f 4b 0d                      | 0     OK
Received message type 06
Message sent: 0x06 / 0x0008
41 54 2b 43 47 4d 49 0d                         | AT+CGMI
write: [AT+CGMI<cr>]
read : [AT+CGMI<cr><cr><lf> WAVECOM MODEM<cr><lf><cr><lf>OK<cr><lf>]
Message received: 0x06 / 0x0020
02 41 54 2b 43 47 4d 49 0d 0d 0a 20 57 41 56 45 |  AT+CGMI    WAVE
43 4f 4d 20 4d 4f 44 45 4d 0d 0a 0d 0a 4f 4b 0d | COM MODEM    OK
Received message type 06
Message sent: 0x61 / 0x0009
41 54 2b 43 53 43 53 3f 0d                      | AT+CSCS?
write: [AT+CSCS?<cr>]
read : [AT+CSCS?<cr><cr><lf>+CSCS: "PCCP437"<cr><lf><cr><lf>OK<cr><lf>]
Message received: 0x61 / 0x0023
02 41 54 2b 43 53 43 53 3f 0d 0d 0a 2b 43 53 43 |  AT+CSCS?   +CSC
53 3a 20 22 50 43 43 50 34 33 37 22 0d 0a 0d 0a | S: "PCCP437"
4f 4b 0d                                        | OK
Received message type 61
Initialisation completed
Message sent: 0x12 / 0x0009
41 54 2b 43 50 4d 53 3f 0d                      | AT+CPMS?
write: [AT+CPMS?<cr>]
read : [AT+CPMS?<cr><cr><lf>+CPMS: "SM",1,35,"SM",1,35<cr><lf><cr><lf>OK<cr><lf>]
Message received: 0x12 / 0x002d
02 41 54 2b 43 50 4d 53 3f 0d 0d 0a 2b 43 50 4d |  AT+CPMS?   +CPM
53 3a 20 22 53 4d 22 2c 31 2c 33 35 2c 22 53 4d | S: "SM",1,35,"SM
22 2c 31 2c 33 35 0d 0a 0d 0a 4f 4b 0d          | ",1,35    OK
Received message type 12
Message sent: 0x00 / 0x0017
41 54 2b 43 50 4d 53 3d 22 53 4d 22 2c 22 53 4d | AT+CPMS="SM","SM
22 2c 22 53 4d 22 0d                            | ","SM"
write: [AT+CPMS="SM","SM","SM"<cr>]
read : [^A.+CPMS="SM","SM","SM"<cr><cr><lf>+CMS ERROR: 302<cr><lf>]
Message received: 0x00 / 0x002a
04 01 2e 2b 43 50 4d 53 3d 22 53 4d 22 2c 22 53 |   .+CPMS="SM","S
4d 22 2c 22 53 4d 22 0d 0d 0a 2b 43 4d 53 20 45 | M","SM"   +CMS E
52 52 4f 52 3a 20 33 30 32 0d                   | RROR: 302
Received message type 00
GetSMS SM 1 failed! (Command failed.)
Serial device: closing device

I got the same Error 302 with minicom if using AT+CPMS="SM","SM","SM".
The +CPMS: "SM",1,35,"SM",1,35 means that i have 1 message on the SIM Card.
The +CPMS: "SM",3,35,"SM",3,35 means that i have 3 message on the SIM Card.

But with minicom i can read the sms from the SIM Card.
Below is the result from minicom

Welcome to minicom 2.1

OPTIONS: History Buffer, F-key Macros, Search History Buffer, I18n
Compiled on Apr 14 2005, 06:17:43.

Press CTRL-A Z for help on special keys

AT S7=45 S0=0 L1 V1 X4 &c1 E1 Q0
OK
AT
OK
AT+CPIN?
+CPIN: READY
AT+CREG?
+CREG: 0,5

OK
AT+COPS?
+COPS: 0,0,"IND INDOSAT"

OK
AT+CMGF=1
OK
AT+CMGS="+6285659969486"
> Sending SMS from Minicom
+CMGS: 187

OK

+CMTI: "SM",3
AT+CPMS?
+CPMS: "SM",3,35,"SM",3,35

OK
AT+CMGR=3
+CMGR: "REC UNREAD","+6285659969486",,"06/08/31,23:25:26+28"
Sending SMS from Minicom

OK
AT+CMGR=2
+CMGR: "REC READ","+6281572030993",,"06/08/31,23:17:26+28"
test from other mobile phone sent to the modem

OK
AT+CPMS="SM","SM","SM"
+CMS ERROR: 302
AT+CPMS="ME","ME","ME"
+CMS ERROR: 302

And next ... what should i do? Is there any patch to solve the problem? Thanks for the help.

--
Regards,

Asep Andria I.W.
http://asepandria.blogspot.com
--





reply via email to

[Prev in Thread] Current Thread [Next in Thread]