I’m using a Q24PL001 with the TCP/IP stack through AT commands at 9600 baud, connected to a microcontroller. I’m starting a GPRS bearer, connecting a transparent TCP socket to the server, and then requesting a large chunk of data, around 67K. My command sequence is as follows:
at+wopen=1
at+wipcfg=1
at+wipbr=1,6
at+wipbr=2,6,11,“myaccesspoint”
at+wipbr=2,6,0,“myusername”
at+wipbr=2,6,1,“mypassword”
at+wipbr=4,6,0
at+wipcreate=2,2,“myserver.com”,80
at+wipdata=2,2,2
GET mywebsite/myfile.bin HTTP/1.1
Host: myserver.com
The problem is that only around 20K of the data actually shows up. I get the beginning of the file and the ending but a large portion in the middle is missing. It would appear that the TCP flow control in the modem is not correctly throttling the data and lots of it is getting dropped before it reaches the UART.
At first I thought it might be a flow control problem on my end, but I double checked to make sure that flow control is enabled through AT+IFC=2,2 and that my RTS line is working properly and that I’m not getting any overruns on my UART. I even tried increasing my microcontroller receive buffer to 80K and suspending all background tasks but I still only get the same 20K of data.
Just out of curiosity I tried the same test at 19200 baud and this time I got a bit more data, around 40K, but still nowhere near the full 67K. I can’t really go any higher than 9600 baud anyway without changing my oscillator.
Is there a step that I’m missing somewhere? Do I need to set up TCP window sizes on the modem somehow? The manual does show a AT+WIPOPT command where I can set various options on the TCP socket including WIP_COPT_SND_LOWAT and WIP_COPT_RCV_LOWAT but it doesn’t give any explanation as to what these options are or what they do.
Any ideas?