Getting TCP connection error


#1

Hi all ,
I am new to client server communication.Below is code I have tried to establish connection between my gprs modem and PC to send data.It is showing as TCP connection error.As i gained from discussions,I have to give static Ip for my gprs modem (HL6528).how?? and do “i have to give DNS server address” ?? and one more is “what changes to firewall to be made and how to do?” confused …plz help …how to proceed further…

AT+CGDCONT=1,“IP”,“internet”,“0.0.0.0”,0,0 // idea
OK
atd991#
CONNECT
~ÿ}#À!}!}!} }.}"}&} }
} } }#}$À#óM~~ÿ}#À!}!}!} }.}"}&} }
} } }#}$À#óMÿ}#À!}!}!} }.}"}&} }*} } }#}$À#óMÿ}#À!}!}!} }.}"}&} }} } }#}$À#óM~~ÿ}#À!}!}!} }.}"}&} }} } }#}$À#óM~
NO CARRIER
at&k3
OK
AT+KCNXCFG=0,“GPRS”,“internet”,"","",”0.0.0.0”,”0.0.0.0”,”0.0.0.0”
OK
AT+KCNXTIMER=0,60,2,70
OK
AT+KCNXPROFILE=0
OK

AT+CGATT=1
OK
at+ktcpcfg=0,0,“192.168.1.14”,139 //IP address of my PC and 139 is listening
+KTCPCFG: 1
OK
AT+KTCPCNX=1 //client
+KTCP_NOTIF:1,5 //tcp connection error


#2

192.168.1.14 is a local address on your network. It is not accessible from the internet. You must setup a server on a public IP. The client, in your case the HL6 does not need a public IP.
I suggest that you take a look at the end of the AT command guide for the HL6 and HL8. Section 20.6 includes a few examples of how to setup a tcp connection.

I see no reason to do the ATD command.


#3

thank you krima for your help …i will try


#4

In my application ,I have to send gps data to server but i am trying to send some data initially to server(first step),I have tried as below ,but when sending data without giving end of pattern ,connection is closing immediately as below…how do i solve the problem .please help me anyone

AT+KCNXCFG=0,“GPRS”,“internet”,"","",“0.0.0.0”,“0.0.0.0”,“0.0.0.0”
OK
AT+KCNXTIMER=0,60,2,70
OK
AT+KCNXPROFILE=0
OK
AT+CGATT=1
OK
AT+KTCPCFG=0,0,“www.facebook.com”,80,1 //suppose consider facebook as server
+KTCPCFG: 1
OK
AT+KTCPACKINFO=1
+KTCPACKINFO: 1,2
OK
at+kpattern="#"
OK
AT+KTCPCNX=1
OK
AT+KTCPSND=1,20
CONNECT // After connect I am unable to send data (giving ok response after 1 or 2 seconds ) and not able to see the data which i am sending
OK
+KTCP_NOTIF: 1,6 //generic error
+KTCP_DATA: 1,1300
at+ktcprcv=1,400
CONNECT
HTTP/1.1 400 Bad Request
Content-Type: text/html; charset=utf-8
Date: Sat, 22 Nov 2014 09:48:34 GMT
Connection: close
Content-Length: 3121

           <html lang="en" id="facebook">
                                           <head>
                                                     <title>Facebook | Error</title>
        <meta charset="utf-8">
                                  <meta http-equiv="cache-control" content="no-cache">
          <meta http-equiv="cache-control" content="no-store">
                                                                  <meta http-equiv=#

OK
+KTCP_DATA: 1,900
at+ktcpackinfo=1
+KTCPACKINFO: 1,2
OK
at+ktcpsnd=1,45
CONNECT
OK
+KTCP_NOTIF: 1,6 // generic error
+KTCP_ACK: 1,0 //data sent failure
at+ktcpstat=1
+KTCPSTAT: 3, -1, 0, 900
OK


#5

Pradeep,

I came across this page, it looks like I am also facing the similar issue. I hope you would have resolved your issue.
In my case after CONNECT response from modem i send the data to google.com but i do not any response after that.
Any Idea what could be the problem?