TCP/IP data corruption / substitution

  • Q: Type of module? A: GM862-QUAD
    Q: Firmware version? A: 07.03.600
    Q: Type of starter kit you have? none
    (S1, S1B, S2, S3, S4, EVK1, EVK2, none, other)


    I'm experiencing a problem using EASY GPRS and any help understanding the cause would be greatly appreciated.


    While sending data using the AT#SSEND command, i've been experiencing corruption and data substitution within the TCP/IP packets,
    these packets have valid checksums and are subsequently re-assembled and delivered to my web server where they are rejected or sent to my web page for processing.
    See the following output of a TCP/IP Packet capture for an example of this :


    Serial TX data capture from Uart to GM862 :
    GET/DemoWebPage.ashx?DATA=CUD{UID{0004a32b84b0}UPW{***********}}{1A87} HTTP/1.0
    Connection: keep-alive


    TCP/IP Capture of data arriving at Web Server :
    GET/DemoWebPage.ashx?DATA=CUD{UID{0004a32b84b0}UPW{***********}_.V.o.i.c.e.m.a.i.l.O.N.on:keepà.t(t..


    The fullstops between the characters of the substituted text 'VoicemailON on' represent non printable ascii values.


    Hardware handshaking is not implemented in this version of the firmware.


    The following is a capture of the AT commands and data sent and received to and from the GM862 during my configuration and data
    transmission sequence :


    Data sent to GM862 & Received from GM862


    ATZ ATZ
    ATE0 OK
    ATV0 0
    AT#SELINT=2 0
    AT+IPR=38400 0
    AT+CMEE=1 0
    AT&K0 0
    AT&D1 0
    AT+CPIN? 4
    ... <Wait for SIM ready>
    AT+CPIN? +CPIN: READY
    AT+CREG? +CREG: 0,2
    ... <Wait for Network registration>
    AT+CREG? +CREG: 0,1
    AT#SGACT=2,0 0
    AT+CGDCONT=2,IP,asdamobiles.co.uk,0.0.0.0,0,0 0
    AT#SCFG=2,2,512,65535,300,100 0
    AT#SCFGEXT=2,0,0,0,0,0 0
    AT#SGACT=2,1,web,web #SGACT: XXX.XXX.XXX.XXX
    AT#SD=2,0,XXXX,"XXX.XXX.XXX.XXX",0,0,1 0
    AT#SS <Get socket status>
    AT#SI <Wait until>
    ... <socket>
    AT#SI <is empty>
    AT#SSEND=2 > 0
    GET /DemoWebPage.ashx?DATA=CUD{UID{0004a32b84b0}UPW{************}<CTRL-Z>
    AT#SI <Wait until>
    ... <socket>
    AT#SI <is empty>
    AT#SSEND=2 > 0
    }{0A06} HTTP/1.0
    Connection: keep-alive<CTRL-Z>


    Thanks in advance for any insights into the cause of this problem.

  • RaymondB59,


    I have had this problem too. I wrote both TCP client and TCP server (Web server).


    The client connects with #SD and then writes data directly to the port. I have never had any problem with the client.


    The server, however, accepts connection in command mode and then receives data with #SRECV sends data with #SSEND. And the data the server sends once for while gets corrupted. I captured the data with Wireshark and indeed the data was corrupted within the TCP segments. Because GM862 doesn't have the capability to let you monitor what is going out, all I could do was to verify what is going into GM862 and what is received by the server. So far I have not resolved it and I do believe GM862 is resposible for this problem.


    Please let me know if you find out what is causing it. Good luck.


    Anjing Zhang

  • Hello Wilhelm.


    Thank you for your response.
    I'm puzzled as to why you believe that the character format is responsible for the data corruption / substitution, especially since i've copied the same data into Internet Explorers address bar and sent it to my web server hundreds of times without it ever getting corrupted. Could you please explain why you think my data is the cause ?. In the meantime i'll setup an experiment to send HTML conforming data to my server and let you know the results.


    Thank you for your time and effort


    Raymond Barber

  • Thankyou Wilhelm for your reply.


    I'm sending you a string of data that i send using EASY GPRS to my server,
    could you please convert this into a HTML conforming string and post it back to me. Please respond as soon as possible as i have to meet a completion deadline for this product at the end of this week.


    GET /UnitLogin/UnitLogin.ashx?DATA=CUD{UID{0004a32b84b0}UPW{threed______}}{1259} HTTP/1.0
    Connection: keep-alive


    Your help is greatly appreciated.


    Raymond Barber

  • Thankyou for your advice Wilhelm.


    Unfortunately even with a HTML compatible string the problem still occured.
    After searching the forum i found another user who had the same problem
    (T:Data corrupted during transfer) and took their
    advice and converted my code to just use the #SO command and +++
    escape sequence. I'm happy to say that my data is now being delivered
    100% reliably by TCP/IP. It would seem that under certain conditions the
    #SSEND command does not deliver data reliably, although using just #SO
    and sending data to the modem seems to work every time, any ideas on
    why this is so ?


    Thankyou for your time and help


    Raymond Barber