Sob: init = AT^CURC=0
is the right answer. Took just over an hour of googling. :)
|
Sob: You're right, memory_start exists and works perfectly. I somehow missed it among all those other options. ;) Thank you.
And here is quick "works for me" change to make CMGL work:
diff -Naur smstools3-orig/src/smsd.c smstools3-my/src/smsd.c
--- smstools3-orig/src/smsd.c 2009-05-31 19:21:18.000000000 +0200
+++ smstools3-my/src/smsd.c 2009-11-05 23:54:06.765625000 +0100
@@ -1940,7 +1940,8 @@
break;
}
- if ((mnumber = atoi(p +6)) <= 0)
+ mnumber = strtol(p +6, NULL, 0);
+ if (errno==EINVAL)
{
errorstr = "Invalid message number";
break;
|
Sob: Turns out that I didn't read so carefully after all. I din't notice that there are actually two more commands instead of one (CMGD and CMGL). Noticed just after I sent the message. Typical. :)
With check_memory_method=2 receiving messages works.
|
Sob: Operating system name and version: Windows XP SP3 / Cygwin 1.7 beta
Version of smsd: 3.1.5
Smsd installed from: sources
Name and model of a modem / phone: Huawei E220 HSDPA USB Modem
Interface: USB (internal usb2serial)
Sending messages just works, no problem there. Receiving messages didn't work at first, communication went this way:
2009-11-02 19:42:38,7, GSM1: -> AT+CPMS?
2009-11-02 19:42:38,7, GSM1: Command is sent, waiting for the answer
2009-11-02 19:42:39,7, GSM1: <- +CPMS: "SM",1,15,"SM",1,15,"SM",1,15 OK
2009-11-02 19:42:39,6, GSM1: Used memory is 1 of 15
2009-11-02 19:42:39,6, GSM1: Trying to get stored message 1
2009-11-02 19:42:39,7, GSM1: -> AT+CMGR=1
2009-11-02 19:42:39,7, GSM1: Command is sent, waiting for the answer
2009-11-02 19:42:39,7, GSM1: <- OK
<-- cut (was OK for CMGR 2-14) -->
2009-11-02 19:42:47,6, GSM1: Trying to get stored message 15
2009-11-02 19:42:48,7, GSM1: -> AT+CMGR=15
2009-11-02 19:42:48,7, GSM1: Command is sent, waiting for the answer
2009-11-02 19:42:48,7, GSM1: <- +CMS ERROR: 321 (Invalid memory index)
2009-11-02 19:42:48,6, GSM1: No SMS received (reading interrupted)
I tried to set check_memory_method to use CMGL (tried all values), but that didn't work either:
2009-11-05 21:55:15,6, GSM1: Checking memory size
2009-11-05 21:55:15,7, GSM1: -> AT+CMGL=4
2009-11-05 21:55:15,7, GSM1: Command is sent, waiting for the answer
2009-11-05 21:55:16,7, GSM1: <- +CMGL: 0,1,,29
0791246030500200040C912470337644940000901150123555400BEEF21D442FCFE9A09802
OK
2009-11-05 21:55:16,3, GSM1: CMGL handling error: message 0, Invalid message number
2009-11-05 21:55:16,6, GSM1: No SMS received
Finally I tried to change the code to start with AT+CMGR=0 instead of AT+CMGR=1 and it helped:
diff -Naur smstools3-orig/src/smsd.c smstools3-my/src/smsd.c
--- smstools3-orig/src/smsd.c 2009-05-31 19:21:18.000000000 +0200
+++ smstools3-my/src/smsd.c 2009-11-02 20:06:07.046875000 +0100
@@ -3420,7 +3420,7 @@
}
if (!(*line2))
- found = readsim(sim, line1, line2);
+ found = readsim(sim-1, line1, line2);
// 3.1.5: Should stop if there was timeout:
if (found == -2)
Any comments about this? Is there any other way how to achieve AT+CMGR starting from 0? I read the whole smstools website very carefully, but couldn't find any. While this works for me with one modem, it'll break if I use another one that expects indexes starting from 1.
Last little problem is with enexpected input from modem. Lines like these are appearing in log:
2009-11-02 19:06:53,3, GSM1: Unexpected input: ^BOOT:21159041,0,0,0,6
2009-11-02 19:14:36,3, GSM1: Unexpected input: ^RSSI:18
2009-11-02 19:15:41,3, GSM1: Unexpected input: ^RSSI:21
2009-11-02 19:48:59,3, GSM1: Unexpected input: ^RSSI:31 ^SRVST:1 ^MODE:3,3 ^SIMST:1,0
2009-11-02 19:50:27,3, GSM1: Unexpected input: ^BOOT:21159041,0,0,0,6 ^RSSI:20
2009-11-02 20:14:23,3, GSM1: Unexpected input: ^BOOT:21159041,0,0,0,6 ^RSSI:25
At first sight it looks like some status reporting. Is it safe to just ignore it?
Thanks in advance.
|