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

Parents
  • Hi Jeff,

    I have replicated the problem. I have also tested with different Python server and the connection to the server was successfully established. I think the issue might be related to addressing and accessibility of the device.

    1. Anything incorrect in my steps?

    It does not seem to be anything obviously wrong in your 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?

    This does not seem to be correct. I will ask internally for clarification and potential correction.

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

    Yes, this is correct. After each power off/on device gets new IP address from the network.

    I will get back to you when I get needed clarification, probably by the end of this week.

    Best regards,
    Dejan

Reply
  • Hi Jeff,

    I have replicated the problem. I have also tested with different Python server and the connection to the server was successfully established. I think the issue might be related to addressing and accessibility of the device.

    1. Anything incorrect in my steps?

    It does not seem to be anything obviously wrong in your 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?

    This does not seem to be correct. I will ask internally for clarification and potential correction.

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

    Yes, this is correct. After each power off/on device gets new IP address from the network.

    I will get back to you when I get needed clarification, probably by the end of this week.

    Best regards,
    Dejan

Children
No Data
Related