HL7802 TCP IPV6 configuration

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:

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

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,

1 Like

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

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

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” :slight_smile: It may help for the other having same concern.

Thanks so much,

1 Like