# HL7802 TCP IPV6 configuration

**URL:** <https://forum.sierrawireless.com/t/hl7802-tcp-ipv6-configuration/23078>\
**Category:** HL78\
**Created:** [March 10, 2021, 10:07am UTC](https://forum.sierrawireless.com/t/hl7802-tcp-ipv6-configuration/23078 "2021-03-10T10:07:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hkiol](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/hkiol/32/5998_2.png) [@hkiol](https://forum.sierrawireless.com/u/hkiol)\
**Post date:** [March 10, 2021, 10:07am UTC](https://forum.sierrawireless.com/t/hl7802-tcp-ipv6-configuration/23078/1 "2021-03-10T10:07:03Z")

</div>

Hey,  
I have succesfully connected my device (with HL7802) to an MQTT broker via TCP and IPV4.  
I am now looking to do the same but with IPV6 (supported by the broker). I am a little confused with the configuration command and would like a little bit of guidance.  
Here is the command in question:

 ![1](https://us1.discourse-cdn.com/flex025/uploads/sierrawireless/original/2X/5/5cbe44aa55d698faa4dbabfdff944239c6507af1.png) ![2](https://us1.discourse-cdn.com/flex025/uploads/sierrawireless/original/2X/7/7ceb17ae18cc683f43de8ca353f3217b4e0d94b7.png)

My configuration is: at+ktcpcfg=1,0,“the actual IPV6 address”,1883,0,0,0,1  
session ID = 1  
mode = 0 (client)  
tcp remote address = the IPV6 address  
tcp\_port = 1883  
status = 0 (disconnected, i later plan on using at+ktcpcnx (?))  
serverID = left blank (?) since it’s not in child mode  
source\_port = ?  
data\_mode = 0  
URC-ENDTCP-enable = 0  
af = 1 (IPV6)

The command returns:  
+KTCPCFG: 1  
OK

But when i use AT+KTCPCNX=1 i get +CME ERROR: 923 (Error due to invalid state of terminate port data mode)

My configuration for the IPV4 connection was simpler: at+ktcpcfg=1,0,“the IPV4 address”,1883 so i didn’t have any issues. at+ktcpcfg? returned: +KTCPCFG: 1,0,1,0,“5.172.194.30”,1883,2249,0,0,0,0,0

thanks

---

<div class="post-metadata">

**Author:** ![Donald](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@Donald](https://forum.sierrawireless.com/u/Donald)\
**Post date:** [March 10, 2021, 10:40am UTC](https://forum.sierrawireless.com/t/hl7802-tcp-ipv6-configuration/23078/2 "2021-03-10T10:40:50Z")

</div>

Hi @hkiol,

We may have some things which need to be checked before we go deeper in this issue

1. Do you set the +KCNXCFG command before setting these commands? If not, please set it first then show me the response of AT+KCNXCFG?, please!
2. What operator do you use? Please make sure that your SIM operator supports IPV6.
3. Can you please show me the response of +CGDCONT?
4. What FW is your device running?

Beside that, according to your information. Assumming that you dont care about two last parameters: \<profile\_idx\> and \<restore\_on\_boot\>, I think your +KTCPCFG command should be:

AT+KTCPCFG=1,0,“your server IPV6 address”,1883, , ,0,1 (Please remove the blank space if you copy this command)

Can you please try to send again?

Thanks,

---

<div class="post-metadata">

**Author:** ![hkiol](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/hkiol/32/5998_2.png) [@hkiol](https://forum.sierrawireless.com/u/hkiol)\
**Post date:** [March 10, 2021, 10:52am UTC](https://forum.sierrawireless.com/t/hl7802-tcp-ipv6-configuration/23078/3 "2021-03-10T10:52:00Z")

</div>

Hi @Donald,

1. I do, here is the responce: +KCNXCFG: 1,“GPRS”,“iot”,"","",“IPV6”,“0.0.0.0”,“0.0.0.0”,“0.0.0.0”,"::","::","::",2
2. I am sure my operator uses IPV6
3. +CGDCONT: 1,“IPV6”,“iot”,0,0,0,  
+CGDCONT: 2,“IPV4V6”,0,0,0,0,0,0,
4. HL7802.4.6.6.0

I copied your command and it connected fine…  
So just to clarify so that i learn to read datasheets (…),  
from your command: AT+KTCPCFG=1,0,“your server IPV6 address”,1883,X ,Y ,0,1  
X is status and Y is source\_port?

thanks

---

<div class="post-metadata">

**Author:** ![Donald](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@Donald](https://forum.sierrawireless.com/u/Donald)\
**Post date:** [March 10, 2021, 11:05am UTC](https://forum.sierrawireless.com/t/hl7802-tcp-ipv6-configuration/23078/4 "2021-03-10T11:05:05Z")

</div>

Hi @hkiol,

X is your device’s port for this connection. We should not define any number here. It will be generated automatically when device makes the connection.

Y is the data mode. It should be 0 if you enter because we just have only one option following the document or you can leave it blank  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/sierrawireless/original/2X/4/423a115c0d81c4eacf91962579eb34923ca0cc16.png)

the structure of the set command is below, following the document:  
AT+KTCPCFG=[\< cnx cnf \>],\< mode \>,[\< tcp remoteaddress \>],\< tcp\_port \>[,[\< source\_port \>][,[\< data\_mode \>][,[\< URCENDTCPenable \>][,[\< af \>][,[\< profile\_idx \>][,[\< restore\_on\_boot \>]]]]]]]]

If your issue is solved, please help to tick “Solution” 🙂 It may help for the other having same concern.

Thanks so much,
