views:

1048

answers:

2

Hi. I've been trying to do TCP communication using my Wavecom Fastrack modem. What I want to achieve is make the modem connect to a specified TCP server port to enable me to transfer data to and from the server. I found some information on than in the user's guide. Basing on the information you can find on page 66 I created an application that opens the serial port to which the modem is connected and writes the following AT commands:

AT+WIPCFG=1 //start IP stack
AT+WIPBR=1,6 //open GPRS bearer
AT+WIPBR=2,6,11,"APN" //set APN of GPRS bearer
AT+WIPBR=2,6,0 //username
AT+WIPBR=2,6,1 //password
AT+WIPBR=4,6,0 //start GPRS bearer

AT+WIPCREATE=2,1,"server_ip_address",server_port //create a TCP client on port "server_port"

AT+WIPDATA=2,1,1 //switch do data exchange mode

This is exactly what the user's guide says. After the last command is sent to the modem, the device switches to data exchange mode and from then on everything what is written to the serial port opened by my application should be received by the server and everything the server sends should appear in the input buffer of that port.

The thing is that I did not manage to maintain stable bidirectional communication between the server and my modem. When I write some data to the serial port (only a few bytes), it takes a lot of time before the data appears on the server's side and in many cases the data does not reach the server at all.

I performed a few tests writing about 100 bytes to the serial port at once. Logging the data received by my server application I noticed that the first piece of data (8-35 bytes) is received after a second or two. The rest of the data appears in 2-5 seconds (either as a whole or in pieces of the said size) or does not appear at all.

I do not know where to look for the reason of that behaviour. Did I use wrong AT commands to switch the modem to TCP client mode? I can't believe the communication may be so slow and unstable.

Any advice will be appreciated. Thank you in advance.

A: 

Hi, what OS are you running? Windows does a pretty good job of hiding the messy details of communicating with the GPRS modem, all you have to do is create a new dial-up connection. To establish the connection you can make a call to the Win32 RasDial function. Once connected, you can use standard sockets to transfer data on a TCP port.

Patrick J Collins
Hi. Thanks for the answer. The thing was that I wanted to control the way data travels to the server. I did not want modem to transfer data when there is a LAN Internet connection available. Even when I set connection priorities in advanced connections configuration, all data was transferred by modem. If it comes to the modem TCP client connections, I finally managed to handle them properly.
Mariusz
A: 

HI, I NEED to know the local ip address of my TCP connection fro mmy wavecom WM100 module, can anyone send that AT command which tell local IP address.

jeyatnhi