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

**URL:** <https://forum.sierrawireless.com/t/error-retrieving-tcp-data-from-module-buffer-at-ktcprcv-command-hl7800/18772>\
**Category:** HL78\
**Created:** [December 20, 2019, 12:20am UTC](https://forum.sierrawireless.com/t/error-retrieving-tcp-data-from-module-buffer-at-ktcprcv-command-hl7800/18772 "2019-12-20T00:20:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nsingh](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/nsingh/32/4885_2.png) [@nsingh](https://forum.sierrawireless.com/u/nsingh)\
**Post date:** [December 20, 2019, 12:20am UTC](https://forum.sierrawireless.com/t/error-retrieving-tcp-data-from-module-buffer-at-ktcprcv-command-hl7800/18772/1 "2019-12-20T00:20:30Z")

</div>

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” ???

---

<div class="post-metadata">

**Author:** ![AE5000](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/ae5000/32/4828_2.png) [@AE5000](https://forum.sierrawireless.com/u/AE5000)\
**Post date:** [December 20, 2019, 1:26am UTC](https://forum.sierrawireless.com/t/error-retrieving-tcp-data-from-module-buffer-at-ktcprcv-command-hl7800/18772/2 "2019-12-20T01:26:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Sierra\_klin2](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/sierra_klin2/32/4769_2.png) [@Sierra\_klin2](https://forum.sierrawireless.com/u/Sierra_klin2)\
**Post date:** [December 20, 2019, 2:23am UTC](https://forum.sierrawireless.com/t/error-retrieving-tcp-data-from-module-buffer-at-ktcprcv-command-hl7800/18772/3 "2019-12-20T02:23:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nsingh](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/nsingh/32/4885_2.png) [@nsingh](https://forum.sierrawireless.com/u/nsingh)\
**Post date:** [December 20, 2019, 3:59am UTC](https://forum.sierrawireless.com/t/error-retrieving-tcp-data-from-module-buffer-at-ktcprcv-command-hl7800/18772/4 "2019-12-20T03:59:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nsingh](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/nsingh/32/4885_2.png) [@nsingh](https://forum.sierrawireless.com/u/nsingh)\
**Post date:** [December 20, 2019, 4:02am UTC](https://forum.sierrawireless.com/t/error-retrieving-tcp-data-from-module-buffer-at-ktcprcv-command-hl7800/18772/5 "2019-12-20T04:02:15Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![AE5000](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/ae5000/32/4828_2.png) [@AE5000](https://forum.sierrawireless.com/u/AE5000)\
**Post date:** [December 20, 2019, 5:08pm UTC](https://forum.sierrawireless.com/t/error-retrieving-tcp-data-from-module-buffer-at-ktcprcv-command-hl7800/18772/6 "2019-12-20T17:08:18Z")

</div>

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.
