TCP server / client set up running in continuous mode

Hi All,

Hopefully someone out there can help me with this. We are interfacing with the WIP stack from an external UART using the AT+WIP commands, developing a product that requires a server / client connection across a GPRS network, modem to modem. I am seeing some… aberrant behavior that I need some advice on.

We have 2 Q24NG modems, one is set up as a server like this:

at+wipcfg=1

OK

at+wipbr=1,6

OK

at+wipbr=4,6

OK

at+wipbr=3,6,15

+WIPBR: 6,15,"121.90.164.56"

OK

at+wipcreate=3,1,80,5,5

OK

The other is set up to connect to it as a client:

at+wipcfg=1

OK

at+wipbr=1,6

OK

at+wipbr=4,6

OK

 

+CGREG: 1

at+wipcreate=2,1,"121.90.164.56",80

OK

 

+WIPREADY: 2, 1

After we have connected from the client with the +wipcreate the server receives the +WIPACCEPT: 2, 5 as expected. +WIPDATA is received on both ends, we send AT+WIPDATA and we can get a continuous mode connection up. Data flies back and forward as you would expect, until we shut it down with +++ and AT+WIPCLOSE.

Server:

at+wipdata=2,5,1

CONNECT

And it works both ways!

OK

at+wipclose=2,5

OK

Client:

+WIPREADY: 2, 1

at+wipdata=2,1,1

CONNECT

There we have it, a solid connection+++

OK

 

at+wipclose=2,5

OK

So the first connect works just fine. However… when we try to connect to that same server a second time we can’t.

Client:

at+wipcreate=2,1,"121.90.164.56",80

OK

 

+WIPREADY: 2, 1

at+wipdata=2,1,1

At that point there is NO response to the AT+WIPDATA command. No error, no OK, nothing. We can send other AT commands, but whatever we do we can’t use the socket that was partially opened. The server end shows similar behavior:

Server:

+WIPACCEPT: 1,5

at+wipdata=2,5,1

Then nothing.

I’ve also attempted to open a socket to a known good POP3 server, the first time works perfectly well, the second time shows the same behaviour as I am seeing here.

At the moment I’m resetting both modems before we attempt to make the connection. It’s the only way I’ve found of getting it up reliably, but it takes around 50 seconds for each modem to init properly and that’s intolerably long.

Any suggestions would be gratefully received.

Cheers
-Blair Steven

I have the same problem at the moment. I have 2 modems, and the one is working fine and alwasy responds with a CONNECT, but the other modem has the same problem you expreinced.

I have managed a work around, where after each wipclose command, you disable OpenAT with wopen=0, and then start the whole procedure again. Then the 1st socket connection attemp is successful, but the second is not, then you repeat the process again with wopen=0. So that after each connection you have to disable, and then enable with wopen again.

Have anyone found a solution to this problem yet?

What version of WIPSoft are you using?

I ended up moving to the 2.02 stack for another application, and that seems to have solved my problems. However, when I first posted this the 2.02 wasn’t available as production code, so that didn’t help any

Good luck!