I am using a Q2686RD connected to the UART of an AVR microcontroller (ATXMEGA128A1). I’m controlling the modem through its AT interface. Everything works fine (SMS, GPRS, HTTP downloads), except data uploads (uploading log files to an FTP server): I keep losing bytes, unless I manually insert long delays. The first several KB arrive just fine, and then the output files start showing gaping holes. The same happens if I just open a raw TCP socket and send the data.
It seems like I’m sending data on the UART too quickly. I am doing flow control (RTS/CTS), observing the modem’s CTS line and not sending until it’s clear. However, is it possible I’m overflowing the IP stack’s send buffer? If so, how do I check whether it’s safe to send more?
On the forums, I keep seeing references to the WIP_CEV_WRITE event, but I can’t find any way to get this event, or to deduce whether it’s safe to send more data, through the AT command interface. Is there a way?
Modem firmware version, etc:
AT+CGMI: WAVECOM WIRELESS CPU AT+CGMM: MULTIBAND 900E 1800 AT+CGMR: R73a00gg.Q2686G 2094168 032009 12:40 AT+WOPEN=2: +WOPEN: 2,"AT v06.20","AT v06.20" AT+WIPCFG=3: WIP Soft v511 on Open AT OS v620 Dec 10 2008 11:49:59 WIPlib:v5a06 WIPSoft:v3a0a
For reference, this is the sequence of commands I’m sending:
AT+WOPEN=1 ATE0 AT+WIND=0 AT+CMEE=1 AT+COPS=3,2 AT+CREG=2 AT+CPIN? AT+CNMI=2,2,0,0,0 AT+CNMI? AT+CMGF=0 AT+CSMS=1 AT+WIPCFG=1 AT+WIPCFG=2,13,1 AT+WIPBR=1,6 AT+WIPBR=4,6,0 AT+WIPBR=3,6,15 AT+WIPCREATE=4,1,"xxx.xxx.xxx.xxx",21,"anonymous","" AT+WIPFILE=4,1,2,"upload/log.txt"