TCP Client Connection Problem

Hello,

I ams using:
WIP Soft v202 on Open AT OS v313
May 24 2007 15:28:40 WIPlib:v2a07 WIPSoft:v1a15

I have implemented a TCP Client (GPRS) connection to a server which seems to be working most of the time. Every 10 connection attempts or so however I am getting the following error:

at

OK
at+cgatt=1

OK
at+creg?

+CREG: 1,1

OK
at+cgreg?

+CGREG: 1,1

OK
at+wipcfg=1

OK
at+wipbr=1,6

OK
at+wipbr=4,6,0

+CME ERROR: 811
aat

OK
at+cpin?

+CPIN: READY

CME ERROR 811 Says: bearer connection failure : SIM not ready (no pin code entered, …)

I do not have a SIM PIN enabled on this unit. AT+CPIN? is returning +CPIN: READY. What could be going on here? Like I said, it doesn’t do it every time, only every 10 power up sequences or so. I have tried stopping the GPRS bearer, turning off the stack and restarting but nothing seems to work except cycling the power.

Thanks,
Greg Dunn

First you say it’s every 10-ish attempts, then you say it’s after every 10-ish power up sequences

Does this mean that a connection attempt always and only follows a power-up sequence?

If so, maybe your timing is marginal?
Maybe it’s such that the SIM is ready 9 times out of 10, but 10% of the time it takes just too long… :question:

Do you take care to positively confirm that the SIM is ready?

Thank you very much for your help!

Each attempt is normally a power cycle. I agree that it seems to be timing related. I have basically assumed that if I get an error from the AT+WIPBR=4,6,0 command that I could just retry it once the SIM is ready and it would work. Should this not be true? I will try to use the AT+CPIN? command to check for ready and see how it goes.

Greg Dunn

Why not enable +WIND: 4, and wait for that?

I think I have finally gotten past the CME ERROR: 811 by implementing your suggestion and waiting for the +WIND: 4.

I now seem to be have a large number of times (3 out of 10) where my initial attempt to open a TCP Client Socket fails with a CME ERROR: 842 when using WIPCREATE. After I get the error, I just re-issue the WIPCREATE command and the second attempt seems to always succeed. With the previous code (not waiting for +WIND: 4), I very rarely received this error.

I don’t know how many different combinations of timings and AT command arrangements I have tried. It just seems like nothing will make the reliability as high as needed for this application. Not nearly as high as acheived with the MTSMC-F2 previous two versions of the Multi-Tech modem which used the older TCP/IP stack (AT#OTCP and AT#OTCP=1).

Below is the current AT command sequence that I am using on each power up cycle to the modem. Can you give any suggestions?

November 19, 2007 14:45:56:906 >: AT[13]
November 19, 2007 14:45:56:906 <: AT[13][13][10]
November 19, 2007 14:45:56:906 : AT[13]
November 19, 2007 14:45:57:078 <: AT[13][13][10]
November 19, 2007 14:45:57:078 : ATI0[13]
November 19, 2007 14:45:57:218 <: ATI0[13][13][10]
November 19, 2007 14:45:57:218 <: WAVECOM MODEM[13][10]
November 19, 2007 14:45:57:218 <: [13][10]
November 19, 2007 14:45:57:234 <: MULTIBAND G850 1900 [13][10]
November 19, 2007 14:45:57:234 <: [13][10]
November 19, 2007 14:45:57:234 : AT+CMEE=1[13]
November 19, 2007 14:45:58:359 <: AT+CMEE=1[13][13][10]
November 19, 2007 14:45:58:359 : AT+STSF=0[13]
November 19, 2007 14:45:58:500 <: AT+STSF=0[13][13][10]
November 19, 2007 14:45:58:500 : AT+CICB=0[13]
November 19, 2007 14:45:59:046 <: AT+CICB=0[13][13][10]
November 19, 2007 14:45:59:078 : AT&C1&D2[13]
November 19, 2007 14:45:59:156 <: AT&C1&D2[13][13][10]
November 19, 2007 14:45:59:187 : ATX4[13]
November 19, 2007 14:45:59:328 <: ATX4[13][13][10]
November 19, 2007 14:45:59:328 : ATE0V1S0=
November 19, 2007 14:45:59:468 : 1[13]
November 19, 2007 14:45:59:484 <: [13][10]
November 19, 2007 14:45:59:484 : AT+CREG?[13]
November 19, 2007 14:45:59:765 <: [13][10]
November 19, 2007 14:45:59:765 <: +CREG: 0,0[13][10]
November 19, 2007 14:45:59:765 <: [13][10]
November 19, 2007 14:45:59:781 <: OK[13][10]
November 19, 2007 14:46:00:031 <: [13][10]
November 19, 2007 14:46:00:031 : AT+CREG?[13]
November 19, 2007 14:46:03:906 <: [13][10]
November 19, 2007 14:46:03:906 <: +CREG: 0,1[13][10]
November 19, 2007 14:46:03:906 <: [13][10]
November 19, 2007 14:46:03:921 : AT+CGATT=1[13]
November 19, 2007 14:46:07:859 <: [13][10]
November 19, 2007 14:46:07:859 : AT+CGREG?[13]
November 19, 2007 14:46:08:109 <: [13][10]
November 19, 2007 14:46:08:109 <: +CGREG: 0,1[13][10]
November 19, 2007 14:46:08:109 <: [13][10]
November 19, 2007 14:46:08:125 : ATI3[13]
November 19, 2007 14:46:09:625 <: [13][10]
November 19, 2007 14:46:09:625 <: 657d09gg.Q24PL001 1956364 052907 16:50[13][10]
November 19, 2007 14:46:09:625 <: [13][10]
November 19, 2007 14:46:09:640 <: OK[13][10]
November 19, 2007 14:46:32:390 <: [13][10]
November 19, 2007 14:46:32:390 : AT+WIPCFG=1[13]
November 19, 2007 14:46:33:562 <: [13][10]
November 19, 2007 14:46:33:562 : AT+WIPBR=1,6[13]
November 19, 2007 14:46:33:734 <: [13][10]
November 19, 2007 14:46:33:750 : AT+WIPBR=4,6,0[13]
November 19, 2007 14:46:35:671 <: [13][10]
November 19, 2007 14:46:35:671 : AT+CSQ[13]
November 19, 2007 14:46:35:953 <: [13][10]
November 19, 2007 14:46:35:953 <: +CSQ: 26,0[13][10]
November 19, 2007 14:46:35:953 <: [13][10]
November 19, 2007 14:46:35:968 : AT+WIPCLOSE=3,1[13]
November 19, 2007 14:46:36:093 <: [13][10]
November 19, 2007 14:46:36:093 : AT+WIPCREATE=2,1,“064.181.037.210”,02102[13]
November 19, 2007 14:47:50:859 <: [13][10]
November 19, 2007 14:47:50:859 : AT+WIPCREATE=2,1,“064.181.037.210”,02102[13]
November 19, 2007 14:47:53:765 <: [13][10]
November 19, 2007 14:47:53:765 <: OK[13][10]
November 19, 2007 14:47:53:765 <: [13][10]
November 19, 2007 14:47:53:781 : AT+WIPDATA=2,1,2[13]
November 19, 2007 14:47:53:937 >: [DCD ON]
November 19, 2007 14:47:53:937 <: [13][10]
November 19, 2007 14:47:53:937 : [2]0000020D86000019010E59C8C0406F824BDC8A240[3]@
November 19, 2007 14:47:56:703 <6>: [2]0000020085000000[3][15]
November 19, 2007 14:47:59:187 <6>: [6]
November 19, 2007 14:48:02:406 >: +++
November 19, 2007 14:48:03:453 >: [DCD OFF]

I can email a version of this communications log with different colors for Tx/Rx if needed. My direct email is greg.dunn@eagleresearchcorp.com

Thanks,
Greg Dunn

My communications log did not come thru correctly with my cutting and pasting. If you wish to look at the real version of the log I have put it on our web site in a rich text file at:
eagleresearchcorp.com/files/ … ComLog.rtf

Thanks,
Greg Dunn