NCS 2.6.0 Serial LTE modem at PCA10090 => Failed to work as a TCP server

Hi Nordic team

 At this link, it said nrf9160 can act as a TCP server. I followed the steps to test but TCP client failed to connect the server. 

https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/applications/serial_lte_modem/doc/slm_testing.html#tcp-ip-at-commands

What I did as below.

1. Connect nrf9160 to base station, Then, "AT+CGDCONT?" to ask its allocated IP address. So, IP address was "10.195.197.95".

Ready
> AT+CFUN=1

OK
> AT+CGDCONT?

+CGDCONT: 0,"IPV4V6","internet.iot","10.195.197.95 2001:B400:E20A:9F37:10A1:5A3C:8241:84D1",0,0

OK

2. Create a python script, named "client_tcp.py". The content was as same as sample code, except IP address and port number.

IP address was from step 1 "10.195.197.95".

3. Initialize TCP server to start listen

AT#XSOCKET=1,1,1

#XSOCKET: 0,1,6

OK

AT#XBIND=22 

OK

AT#XLISTEN

OK

4. Then, run the python script

5. Wait 60 sec to accept TCP client but failed.

- TCP server was timeout to accept TCP client.

AT#XACCEPT=60

ERROR

- At TCP client side (python terminal), it cannot connect TCP server and showed error message.

My questions

1. Anything incorrect in my steps?

2. According to below context, for TCP server, nrf9160 must have global private address.

   I have no idea what you mean and how to have "global private address". Could you explain?

3.  Besides, at every time "AT+CFUN=1", the carrier will assign new IP address to nrf9160.

     So, its address was not static. How can TCP client know correct IP address of TCP server before connecting?

Jeff

  • Hi,

    Jeffery said:
    Did you ever try in your side?

    I have tested myself. I tried to reproduce your error but got the Timeout Error. However, we have tested this internally and result was successful. It might be that your operator does not allow incoming IPv6 (or IPv4) for your SIM card (which I assume also happens in my case). You could first try to test your IPv6 connectivity (for example by running "ping -6 ipv6.google.com") from your computer and if this is successful you can reach out to your network operator with further inquiries.

    Best regards,
    Dejan

Related