Modem error with big outbound sms queue

Modem error with big outbound sms queue SearchSearch
Author Message
Irwanto
New member
Username: Viriya123

Post Number: 1
Registered: 05-2011
Posted on Saturday, May 28, 2011 - 11:44 am:   

I've been using NowSms lite for 1 month now, and I notice that whenever I have hundreds of outbound sms queue that need to be processed, the modem's status sometimes becomes error giving this red line :
"Unable to access modem, ensure that it is powered on and passes diagnostic tests"

And I have to unplug the modem and plug it back, then stop and start the service to bring it back to normal.
Or I could stop the service and send AT+CFUN=1 to fix the problem.

This happens once or twice per day.

Modem : Wavecom fasttrack 1306B serial
NowSms Lite : v2010.11.04
Sms sent : 2000+ daily
Sms received : 500 daily

Please someone help me

regards,
Irwanto
Irwanto
New member
Username: Viriya123

Post Number: 2
Registered: 05-2011
Posted on Sunday, May 29, 2011 - 01:37 am:   

I just noticed today, this error also happened when the outbound sms queue was empty as well.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 3204
Registered: 08-2008
Posted on Tuesday, May 31, 2011 - 09:41 pm:   

Hi Irwanto,

Are you sure that you can stop the NowSMS service and manually send AT+CFUN=1 to fix the modem (without unplugging the modem)?

The reason I ask, is because when a modem is non-responsive, this is one of the tricks that we use to try to recover automatically.

There is a configuration option to configure NowSMS to reboot if a modem is not accessible, but this is more for USB devices than serial devices. If you want to enable this, manually edit SMSGW.INI and under the [Modem - modem name here] header, add RebootOnModemError=Yes

That said, I am very curious to determine why AT+CFUN=1 is not working when NowSMS tries to send it.

Could you enable the SMSDEBUG.LOG? I would like to see the SMSDEBUG.LOG when the modem becomes unresponsive in order to better understand what is happening.

Also, verify that you can actually reset the modem by manually sending AT+CFUN=1 after shutting down the NowSMS service. If there is something we could change about how we send AT+CFUN=1 when serious modem problems occur, we will investigate further.

--
Des
NowSMS Support
Irwanto
New member
Username: Viriya123

Post Number: 3
Registered: 05-2011
Posted on Tuesday, May 31, 2011 - 10:00 pm:   

Yes I was able to fix the problem with sending AT+CFUN=1 without unplugging the modem.

Now I just added this line
RebootOnModemError=Yes to SMSGW.INI
and enable SMSDEBUG.LOG

I'll report back the result later.

Thanks for your help
Irwanto
New member
Username: Viriya123

Post Number: 4
Registered: 05-2011
Posted on Thursday, June 02, 2011 - 11:06 am:   

Here is the start of the error (from smsdebug.log):
16:41:01:529 [13] ThreadProcessConnection: Request processing complete
16:41:01:529 [1] ThreadListenForConnections: Before accept
16:41:01:529 [1] ThreadListenForConnections: After accept
16:41:01:529 [13] ThreadProcessConnection: Processing connection from 127.0.0.1:26633...
16:41:01:545 [13] ThreadProcessConnection: Processing request /?Phone=%2B6285676346940&Text=ID%20Bethadn271390%2C%20total%20201.940%2C%20trf%2 0ke%20rek%20Bi%20Mari%2C%20BCA%208650077980%2C%20Mandiri%201170004133047%2C%20BN I%200188888579%2C%20BRI%20050501005467504%2C%20tq%20
16:41:01:545 [13] Debug: 1 recipient entries
16:41:01:545 [13] WaitForSocketClose: WinSock reported ioctlsocket complete
16:41:01:545 [13] ThreadProcessConnection: Request processing complete
16:41:27:201 [3] ThreadProcessModem: ERROR - Modem Response (2): A3DD5820A1330982C5703 +STIN: 0 +STIN: 98 +STIN: 99
16:41:27:201 [3] ThreadProcessModem: OUT: 
16:41:27:311 [3] ThreadProcessModem: OUT: \r
16:41:27:311 [3] ThreadProcessModem: OUT: AT
16:41:27:358 [3] ThreadProcessModem: IN: 
AT OK

16:41:28:108 [3] ThreadProcessModem: Error: ERROR - Modem Response (2): A3DD5820A1330982C5703 +STIN: 0 +STIN: 98 +STIN: 99

///////////////////////////////////////////////
Here where the modem reset automatically and back normal :

16:44:15:076 [3] ModemTest: Standard 9600 bps Modem
16:44:15:451 [3] ModemTest: OK
16:44:17:170 [3] ModemReceiveMessages: AT+CPMS?
16:44:17:170 [3] ModemReceiveMessages:
+CPMS: "SM",1,30,"SM",1,30,"SM",1,30

OK

16:44:17:233 [3] ModemReceiveMessages:
ERROR

16:44:17:233 [3] ModemReceiveMessages: AT+CPMS=?
16:44:17:342 [3] ModemReceiveMessages:
+CPMS: (("SM","ME","BM","SR"),("SM","ME"),("SM","ME"))

OK

16:44:17:420 [3] ModemHardReset: Hard reset technique #1
16:44:19:014 [3] ModemHardReset: Hard reset ok
16:44:19:139 [3] ModemHardReset: Hard reset technique #1
16:44:20:748 [3] ModemHardReset: Hard reset ok
16:44:24:248 [3] ThreadProcessModem: Before ModemRelease - Standard 9600 bps Modem
16:44:24:248 [3] ThreadProcessModem: After ModemRelease - Standard 9600 bps Modem
16:44:45:248 [3] ThreadProcessModem: Before ModemAllocate - Standard 9600 bps Modem
16:44:45:248 [3] ThreadProcessModem: After ModemAllocate - Standard 9600 bps Modem - OK
16:44:45:248 [3] ThreadProcessModem: Re-initializing modem: Standard 9600 bps Modem ...
16:44:45:639 [3] ThreadProcessModem: ATI0
16:44:45:639 [3] ThreadProcessModem:
WAVECOM MODEM

MULTIBAND 900E 1800

OK
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 3211
Registered: 08-2008
Posted on Thursday, June 02, 2011 - 08:29 pm:   

"Hard reset technique #1" = AT+CFUN=1,1

Some modems don't support the ",1" ... so we test first with AT+CFUN=? to see if the modem supports more than one parameter with this command.

The good news is that in this case, NowSMS was able to recover the modem.

What may be interesting in this case is that several unsolicited responses are recorded as being received:

+STIN: 0
+STIN: 98
+STIN: 99

According to Wavecom documentation, these are SIM Toolkit notifications, defined as follows:


0: Indicates that a ‘Setup Menu’ pro-active command has been sent from the SIM
98: Indicates the timeout when no response from user.
99: Indicates that a “End Session” has been sent from the SIM

This is very odd, and I expect that these notifications are related to whatever is causing the modem to crash.

NowSMS does not send any SIM toolkit commands, so it is very puzzling that there would be unsolicited messages being returned suggesting SIM toolkit activity.

Wavecom modems do have an API for supporting embedded applications on the modem. Is there any chance you have loaded any such application on the modem, and it might be generating some activity?

I'm not an expert in that area, but as you have been sending some of your own AT commands, here are some commands related to embedded application functionality:

AT+WOPEN=2

This will return:

+WOPEN: 2,"xxx","yyy"

If both an "xxx" and "yyy" parameter are present, this suggests there is an embedded application installed on the modem.

To remove an application, I believe the following steps can be taken:

AT+WOPEN=0
AT+WOPEN=3

That said, it may just be that the modem has some memory corruption that is causing problems.

If configuring NowSMS to reboot does not resolve the problem, there is also a Wavecom modem command to configure the modem to automatically reset itself.

The following command tells the modem to reset itself after 2 hours:

AT+WRST=1,"002:00"

It is possible to configure NowSMS to send this command to the modem when it initialises the modem. To do this, under the [Modem - Standard 9600 bps Modem] header of SMSGW.INI, add this:


CommandPostInit1=AT+WRST=1,"002:00"

This will configure NowSMS to send this command to the modem at the end of each init sequence. After the time period elapses, NowSMS should experience modem connectivity problems, and then automatically reconnect. Using this timer may be more reliable than NowSMS rebooting the computer to trigger a reset.

--
Des
NowSMS Support
Irwanto
New member
Username: Viriya123

Post Number: 5
Registered: 05-2011
Posted on Thursday, June 02, 2011 - 10:43 pm:   

AT+WOPEN=2 give me 'error'.

Now I've put the postinit command :
CommandPostInit1=AT+WRST=1,"002:00" in SMSGW.INI

regards,
Irwanto
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 3216
Registered: 08-2008
Posted on Friday, June 03, 2011 - 01:05 am:   

Hi Irwanto,

Make sure to check the activity to see what happens after 2 hours.

--
Des
NowSMS Support
Irwanto
New member
Username: Viriya123

Post Number: 6
Registered: 05-2011
Posted on Friday, June 03, 2011 - 12:50 pm:   

I changed my modem to a newer one,
it still gave this error from time to time,
the error would last for about 3 minutes
then Hard reset technique #1 kicked in to fixed the problem.

The error :
15:08:02:029 [4] ReceiveModemCommand: Received New Message Notification
15:08:02:279 [4] ReceiveModemCommand: Received New Message Notification
15:08:02:529 [4] ReceiveModemCommand: Received New Message Notification
15:08:02:779 [4] ReceiveModemCommand: Received New Message Notification
15:08:03:029 [4] ReceiveModemCommand: Received New Message Notification
15:08:03:029 [4] ThreadProcessModem: ERROR - Modem Response (2): +CMTI: "SM",1
15:08:03:029 [4] ThreadProcessModem: OUT: 
15:08:03:139 [4] ThreadProcessModem: OUT: \r
15:08:03:139 [4] ThreadProcessModem: OUT: AT
15:08:03:170 [4] ThreadProcessModem: IN: 
AT OK

15:08:04:170 [4] ThreadProcessModem: Error: ERROR - Modem Response (2): +CMTI: "SM",1
15:08:05:170 [4] ModemTest: Standard 33600 bps Modem
15:08:05:326 [4] ModemTest: OK
15:08:05:358 [4] ModemReceiveMessages: AT+CPMS?
15:08:05:358 [4] ModemReceiveMessages:
+CPMS: "SM",1,30,"SM",1,30,"SM",1,30

OK

15:08:05:389 [4] ModemReceiveMessages:
ERROR

15:08:05:389 [4] ModemReceiveMessages: AT+CPMS=?
15:08:05:420 [4] ModemReceiveMessages:
+CPMS: (("SM","ME","BM","SR"),("SM","ME"),("SM","ME"))

OK

15:08:06:170 [4] ModemTest: Standard 33600 bps Modem
15:08:06:326 [4] ModemTest: OK
15:08:08:139 [4] ModemReceiveMessages: AT+CPMS?
15:08:08:139 [4] ModemReceiveMessages:
+CPMS: "SM",1,30,"SM",1,30,"SM",1,30

OK

15:08:08:170 [4] ModemReceiveMessages:
ERROR

15:08:08:170 [4] ModemReceiveMessages: AT+CPMS=?
15:08:08:201 [4] ModemReceiveMessages:
+CPMS: (("SM","ME","BM","SR"),("SM","ME"),("SM","ME"))

OK

15:08:08:201 [4] ThreadProcessModem: Processing 4DCBDD3C.req...
15:08:08:233 [4] ThreadProcessModem: OUT: AT+CMGS=147 15:08:08:264 [4] ThreadProcessModem: IN:
>
15:08:08:264 [4] ThreadProcessModem: OUT: 0001950C912618528056570000994922A8C84C4EF37AD90D268BC55820FA9B1E6683622E19CDE6CA D1602C105D6E06ADCB2079790D12BEDD6750332C4F87DD611648380C8270B61A0C76BBE5703016A8 197693D3F2342816BBC160305A6C3683D16E2C90D09904C162381C0E87ABDD722C90509A04C16AB0 1A2C0683D568B65B0D466381E871103DEC0EA35B6171D87D768DDF6D
15:08:08:311 [4] ThreadProcessModem: IN:
ERROR

15:08:09:061 [4] ModemTest: Standard 33600 bps Modem
15:08:09:217 [4] ModemTest: OK
15:08:09:217 [4] ThreadProcessModem: Processing 4DCBDD3D.req...
15:08:09:248 [4] ThreadProcessModem: OUT: AT+CMGS=147 15:08:09:279 [4] ThreadProcessModem: IN:
>
15:08:09:279 [4] ThreadProcessModem: OUT: 0001960D91265832801411F10000984922C89D76A7E76FB7EC06B3CD622C10FD4D0FB341B598CD45 83C15820BADC0C5A9741F2F21A247CBBCFA066589E0EBBC32C90701804E16C3518EC76CBE1602C50 33EC26A7E569502C7683C160B4D86C06A3DD5820A1330982C570381C0E57BBE55820A1340982D560 35580C06ABD16CB71A8CC602D1E3207AD81D46B7C2E2B0FBEC1ABFDB
15:08:09:326 [4] ThreadProcessModem: ERROR - Modem Response (2): ERROR
15:08:09:326 [4] ThreadProcessModem: OUT: 
15:08:09:436 [4] ThreadProcessModem: OUT: \r
15:08:09:436 [4] ThreadProcessModem: OUT: AT
15:08:09:467 [4] ThreadProcessModem: IN:
OK

///////////////////////////////////////////
this next lines hard reset :

15:10:26:311 [4] ModemReceiveMessages:
ERROR

15:10:26:311 [4] ModemReceiveMessages: AT+CPMS=?
15:10:26:342 [4] ModemReceiveMessages:
+CPMS: (("SM","ME","BM","SR"),("SM","ME"),("SM","ME"))

OK

15:10:26:373 [4] ModemHardReset: Hard reset technique #1
15:10:28:014 [4] ModemHardReset: Hard reset ok
15:10:28:139 [4] ModemHardReset: Hard reset technique #1
15:10:29:795 [4] ModemHardReset: Hard reset ok
15:10:33:045 [4] ThreadProcessModem: Before ModemRelease - Standard 33600 bps Modem
15:10:33:045 [4] ThreadProcessModem: After ModemRelease - Standard 33600 bps Modem
15:10:54:045 [4] ThreadProcessModem: Before ModemAllocate - Standard 33600 bps Modem
15:10:54:045 [4] ThreadProcessModem: After ModemAllocate - Standard 33600 bps Modem - OK
15:10:54:045 [4] ThreadProcessModem: Re-initializing modem: Standard 33600 bps Modem ...
15:10:54:233 [4] ThreadProcessModem: ATI0
15:10:54:233 [4] ThreadProcessModem:
WAVECOM MODEM

MULTIBAND 900E 1800

OK


Irwanto
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 3217
Registered: 08-2008
Posted on Friday, June 03, 2011 - 03:04 pm:   

Hi Irwanto,

It appears that the modem is entering an unstable state when a new message is received.

In this particular case, a new message notification is received while we are sending a message, and the modem fails to respond to an outstanding send message command. After this point, the modem is responding with an ERROR to any further sending attempts.

What setting are you using for "SMS Message Storage" in NowSMS? Different settings here often work more reliably with different modems.

I would suggest using the "Direct to Modem" setting.

--
Des
NowSMS Support
Irwanto
New member
Username: Viriya123

Post Number: 7
Registered: 05-2011
Posted on Saturday, June 04, 2011 - 03:11 am:   

I tried your suggestion by using "Direct to Modem" for SMS Message Storage, and nowsms became very unstable, a lot of hang and retries. So I revert back to "Default" setting.
Irwanto
New member
Username: Viriya123

Post Number: 8
Registered: 05-2011
Posted on Saturday, June 04, 2011 - 06:39 am:   

The errors still there, as you said : the error happened when receiving message while sending a message.

Is there any other way to fix the error, beside setting the SMS Message Storage to "Direct to Modem"?

--
Irwanto
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 3231
Registered: 08-2008
Posted on Monday, June 06, 2011 - 04:08 pm:   

Hi Irwanto,

I'd check for a firmware update for the modem. This should not occur.

It's not NowSMS that is unstable ... NowSMS is sending commands to the modem, and by all indications, the modem is entering a type of confused state, as evidenced by the ERROR responses.

That said, we've studied a lot of different modem quirks, so here are some things to try:

1.) I would also try the "SMS Message Storage" = "SIM card" setting. The "Default" setting polls both "SIM Card" and "Device Memory" for new messages. There is no active polling taking place when a message is being sent, but it still should be tried.

2.) There is also another setting worth trying ... in NowSMS heavy we call this "Direct to Modem Phase 2+". This setting is not in the configuration menu in NowSMS Lite, but can be manually enabled. Set "SMS Message Storage" to "Direct", and then add the following under the [Modem - Standard 9600 bps Modem] header of SMSGW.INI:

AllowPhase2Plus=Yes

If this setting doesn't improve stability, be sure to remove it.

3.) Going back to the "Default" configuration, I've got one other idea, and maybe you should try this first. Before things go bad in your log above we see the following unsolicited command being received indicating that a new message has been received: +CMTI: "SM",1

We could try turning off those notifications, as NowSMS will poll even if it does not receive these notifications.

Earlier I suggested trying a CommandPostInit1 parameter to the [Modem - Standard 9600 bps Modem] section of SMSGW.INI. To turn off notifications, try replacing it with the following:

CommandPostInit1=AT+CNMI=2,0

(If you want to keep both commands, add this one but change CommandPostInit1 to CommandPostInit2.)

--
Des
NowSMS Support