Error Retrieving TCP Data from Module Buffer (AT+KTCPRCV command | HL7800)

I’ve been able to send TCP data properly and also receive into the module’s buffer. But for some reason the reception of data from that buffer keeps failing. In this example, data is sent to web server, 370 bytes come back, and then the web server closes the socket automatically (as expected).

However, when trying to retrieve those 370 bytes from module, keep getting CME 3 “not allowed” errors. Why might this be? This is such a simple command.

AT+CMEE=1
OK

AT+CGACT=0,1
OK

AT+CFUN?
+CFUN: 1

ATI8
HL7800.3.5.0

AT+CCID
+CCID: 89148000005104XXXXXX //Edited for privacy

AT+CGSN
354616090XXXXXX //Edited for privacy

AT+CREG?
+CREG: 0,1

AT+CESQ
+CESQ: 99,99,255,255,18,47

AT+CSQ
+CSQ: 22,0

AT+CGATT?
+CGATT: 1

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

AT+KCNXCFG=1,“GPRS”,“VZWINTERNET”
OK

AT+KTCPCFG=1,0,“52.89.XXX.XXX”,80 //Edited for privacy
+KTCPCFG: 1

AT+KTCPCNX=1
OK

+KCNX_IND: 1,1,0

+KTCP_IND: 1,1

AT+KTCPSND=1,2001
CONNECT

…SEND DATA…
–EOF–Pattern–

+KTCP_DATA: 1,370
// 370 bytes sent from server and received into module buffer

+KTCP_NOTIF: 1,4
// Web server automatically closed socket

AT+KTCPRCV=1, 370
+CME ERROR: 3

//CME 3 = “Operation not allowed” ???

Hi @nsingh,

Since you are testing on VZW live network, I will recommend to first change the carrier configuration in the HL78 device to Verizon. Use AT+KCARRIERCFG=1 to set VZW configuration. Then reset the device.

Once device boots up after a reset, you will need to use PDP context #3 to set up a data session. On VZW, data profile “VZWINTERNET” is in PDP context #3. There is no need to set VZWINTERNET with +CGDCONT command. It should be programmed over the air. You can confirm this with AT+CGCONTRDP command. “AT+CGDCONT?” may show an empty profile in PDP context #3. That is okay. As long as you see “vzwinternet” in +CGCONTRDP command response, you are all set.

Since +CGDCONT reports empty string in context #3, make sure you use KCNXCFG command with an empty string:
AT+KCNXCFG=3,“GPRS”,"",""

Give this try and let us know.

Hi nsingh,
Please remove the Blank space in the command.
Use “AT+KTCPRCV=1,370” instead of “AT+KTCPRCV=1, 370”.

1 Like

No way… didn’t even realize it. Thanks, looks like it’s working!

The issues has been resolved but per your comments, I found this interesting. I originally was using profile 3. However, I was never able to connect sockets properly. My Sierra FAE (Kenneth Cheung) told me to use profile 1 and things started working. I was also told by Verizon ODI to use profile 3. But again, that had unresolved issues.

Any idea why the apparent discrepancies?

Hi @nsingh,
With a Verizon SIM, I recommend you use KCARRIERCFG=1. This will correctly set all the settings required for the device to work correctly on live Verizon network. Once KCARRIERCFG is set correctly, you should use PDP profile #3.

On Verizon, profile #1 is intentionally left empty for CAT-M. Profile #2 is VZWADMIN and is used for over the air provisioning.

Profile #3 is a user data profile to be used to establish TCP/UDP data sessions. As I stated earlier, though +CGDCONT will report an empty string for PDP context #3, you can verify the APN by using AT+CGCONTRDP command.

Again, if you are using Verizon SIM, I highly recommend you use Verizon carrier configuration. This will also be better in case you want to certify your end product at Verizon.