HL8548 How to create a TCP connection

My AT command is as follows:

AT+CREG?

+CREG: 0,1

OK
AT+CGATT=1

OK
AT+CGACT=0

OK
AT+CGDCONT=1,“IP”,“CMNET”

OK
AT+CGACT=1

OK
AT+KTCPCFG=1,0,“translate.google.cn”,80,1,

+KTCPCFG: 1

OK
AT+KTCPCNX=1

+CME ERROR: 921
AT+KTCPSTART=1

+CME ERROR: 921

Did I miss any order?

How do I connect to a TCP service?

Thanks for all the suggestions.

sorry The English you see is not my mother tongue!!!

Hello,

Please check page 801 of AirPrime_HL6_and_HL8_Series_AT_Commands_Interface_Guide_Rev18_0.pdf (How to Use TCP Commands - Client Mode)

I usually do:

AT+KCNXCFG=1,“GPRS”,yourapn

AT+KTCPCFG=1,0,“youripserver”,yourportserver

AT+KTCPCNX=1

Wait until +KTCP_IND: 1,1

AT+KTCPSND=1,10 //to send 10 characters

0123456789 //Data sent (send without enter)

–EOF–Pattern-- //to return to AT mode (send without enter>

AT+KTCPCLOSE=1,1 //to close TCP connection

Done

Best regards,

If possible, could you post example commands for receiving a TCP reply message from the server during the same TCP connection session as the data send?

You can find the answer in the same document section showed above. Anyway, when you send --EOF–Pattern-- in order to finish your sending data, you will receive +KTCP_DATA: 1,xxxx (xxxx = number of bytes received and pending to be read), so you shall AT+KTCPRCV=1,xxxx to read all those bytes received. After that, you can close this TCP connection by the same way: AT+KTCPCLOSE=1,1

Best regards,

Thanks dlopeziot! Reading the documentation was my first step and I repeatedly review it when things don’t work. Trouble is it sometimes leaves out some subtle details or parts of it are confusing, at least for me. For example, the step you included in your example above for sending, i.e., “Wait until +KTCP_IND: 1,1” was not included in the example from the AT command reference for the modules I’m using (HL7588 & HL7648). I had already figured that much out since I actually get three separate +KTCP_IND unsolicited responses during execution with “…: 1.1” being the final one. Also, since I am using Verizon version modules, it took some digging for me to figure out that I have to use a of 3 in AT+CGDCONT command and the same value of 3 for <cnx_cnf> in AT+KCNXCFG command. I was just hoping I might gain more insight from better actual examples. Thanks again though.

I agree with you. For those that have not messed with cellular and AT commands much, the documentation is not very good. I am trying to follow some TCP examples from my document for the HL7748, but I get an error on the AT+KCNXCFG command.

Alex, Did you resolve your issue? I’m using different modules but for the 3 HL modules I’ve used they seem fairly consistent (mostly). Anyway, I may be able to give you some advice if you still need it. Cheers!

Yeah , the issue is the 7748 does not support TCP. So I am waiting on a 7800, and will have to figure out how to update it with beta firmware so the 7800 can support TCP. I have not updated firmware with the HL chips. Hopefully it is straightforward ? Because trying to install USB drivers was complicated for the HL7748

Alex, I’ve used HL7588 with Verizon firmware and HL7648s for use on AT&T and T-Mobile networks. We have to upgrade firmware on the HL7648s to get them to work for our application which uses TCP data connections. The HL7648 FW upgrade process was tricky to accomplish at first but we do them on every module now without issue. I personally don’t handle the module upgrade but I’m told the process being used now is reliable and straight forward. Good luck with yours and let me know if you run into issues. I might be able to help or get you some useful instructions from our experiences.

Thank you so much for the reply!! I have had a busy last month or two and am getting back on this project. I received the HL 7800 and apparently it can do the TCP connections with the FW upgrade. So I might talk to you before I attempt it. What kind of SIM cards are you using for it? The chips I am using at CATM1 and trying to get these type of SIM cards from ATT has been a pain. I got one from Aeris, but you cannot send an SMS to a non Aeris SIM card device.

Team,
image

I am following the exact same steps given in the AirPrime_HL6_and_HL8_Series_AT_Commands_Interface_Guide_Rev19_0 page number 780 How to Use TCP Commands but i am not able to create the successful TCP connection.

As soon as I Get CONNECT response from Modem, i send “GET / HTTP/1.0 but i do not get any response after that.
it stays here for 1 min, after that timeout happens.
It looks like i am not getting any response from HTTP/1.0 page?
any help will be greatly appreciated!

AT+KTCPSND=1,18
Send data with KPATTERN string at the end. e.g. “GET / HTTP/1.0
CONNECT

I am getting +KTCP_NOTIF:1, 8, and then +KTCP_NOTIF: 1,4
so it looks like it is waiting for more or less characters as per the manual.
I wanted to know how many bytes I should mention in AT+KTCPSND=1,
when i request below
“GET / HTTP/1.0–EOF–Pattern–

Hello, any news about the HL7800?
I’m trying myself to create a tcp request but like you, it doesn’t work

Hi all,

I am currently doing some testing using the HL7800.
After a few days of struggle, I managed to get a reply to the GET HTTP request.
Using wireshark, I compared a successful request performed with another device to the request actually sent by the HL7800. It appeared that the end of line characters CR+LF were not correctly sent, due to copy-paste.
I managed to sent the request using :
echo -e “GET / HTTP/1.0\r\n\r\n–EOF–Pattern–” > /dev/ttyUSB0
after AT+KTCPSND=1,18.
I hope this will help.

1 Like