This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

FTP support for nrf9160

i want to start evaluating FTP client in nrf9160 SoC.  Can you provide an example code for FTP client mode. 

Parents
  • Hi, it is my understanding that you are using a CMW500 callbox to do the testing? Based on the IP address of your FTP server, 192.168.1.80, I assume that the FTP server is on your local network and you want the nRF91 to be communicating with this server through the CMW500. So first I want to be sure that you have setup the CMW500 Data Application Unit properly in order to communicate with your local network. 

    First make sure that your local network is connected to the "LAN DAU" network port on the back side of the CMW500.

    1. Go to the Setup dialog
    2. System section
    3. Click on Go to config, to configure DAU
    4. Open the IP Config tab
    5. Click on Config at the bottom
    6. In the address configuration you can select "DHCP from LAN". Now the DAU and the connected LTE devices will get the IP configuration from the local network. Click apply, and OK.
    7. Verify that the DAU IP address matches the local network subnet.

    In the signaling task, after the LTE devices has connected, verity that the given IP address matches the local network subnet:

    Also make sure that the "connection type" is set to "Data application" in the Config window:

    Now you should be able to communicate with the local FTP server through the FTP client example.

    For more information about configuring the CMW500, please refer to the R&S CMW500 user manual or the R&S CMW Data Application Unit user manual.

Reply
  • Hi, it is my understanding that you are using a CMW500 callbox to do the testing? Based on the IP address of your FTP server, 192.168.1.80, I assume that the FTP server is on your local network and you want the nRF91 to be communicating with this server through the CMW500. So first I want to be sure that you have setup the CMW500 Data Application Unit properly in order to communicate with your local network. 

    First make sure that your local network is connected to the "LAN DAU" network port on the back side of the CMW500.

    1. Go to the Setup dialog
    2. System section
    3. Click on Go to config, to configure DAU
    4. Open the IP Config tab
    5. Click on Config at the bottom
    6. In the address configuration you can select "DHCP from LAN". Now the DAU and the connected LTE devices will get the IP configuration from the local network. Click apply, and OK.
    7. Verify that the DAU IP address matches the local network subnet.

    In the signaling task, after the LTE devices has connected, verity that the given IP address matches the local network subnet:

    Also make sure that the "connection type" is set to "Data application" in the Config window:

    Now you should be able to communicate with the local FTP server through the FTP client example.

    For more information about configuring the CMW500, please refer to the R&S CMW500 user manual or the R&S CMW Data Application Unit user manual.

Children
  • Hi Stian,

    I have configured Call box as you mentioned. 

    but i still not able to connect .

    I have even tried with new hex file (13.05.hex) shared on Serial lte modem i could not able to connect for the TCP server.

    Please find the logs in attachments.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    2020-05-14T06:28:20.810Z INFO Application data folder: C:\Users\h197614\AppData\Roaming\nrfconnect\pc-nrfconnect-linkmonitor
    2020-05-14T06:28:21.080Z DEBUG App pc-nrfconnect-linkmonitor v1.1.1 official
    2020-05-14T06:28:21.080Z DEBUG App path: C:\Users\h197614\.nrfconnect-apps\node_modules\pc-nrfconnect-linkmonitor
    2020-05-14T06:28:21.080Z DEBUG nRFConnect 3.3.3 is supported by the app (^3.2.0)
    2020-05-14T06:28:21.080Z DEBUG nRFConnect path: C:\Users\h197614\AppData\Local\Programs\nrfconnect\resources\app.asar
    2020-05-14T06:28:21.080Z DEBUG HomeDir: C:\Users\h197614
    2020-05-14T06:28:21.080Z DEBUG TmpDir: C:\Users\h197614\AppData\Local\Temp
    2020-05-14T06:28:21.083Z VERBOSE Could not fetch serial number for serial port at COM1
    2020-05-14T06:28:24.964Z INFO Modem port is opened
    2020-05-14T06:28:24.970Z DEBUG modem >> AT+CFUN?\x0D\x0A
    2020-05-14T06:28:24.976Z DEBUG modem << +CFUN: 1\x0D
    2020-05-14T06:28:24.978Z DEBUG modem << \x0A
    2020-05-14T06:28:24.980Z DEBUG modem << OK\x0D\x0A\x00
    2020-05-14T06:28:25.006Z DEBUG modem >> AT+CGSN=1\x0D\x0A
    2020-05-14T06:28:25.020Z DEBUG modem << +CGSN: "352656100378499"\x0D\x0A
    2020-05-14T06:28:25.022Z DEBUG modem << OK\x0D\x0A
    2020-05-14T06:28:25.026Z DEBUG modem >> AT+CGMI\x0D\x0A
    2020-05-14T06:28:25.039Z DEBUG modem << Nordic Semiconductor ASA\x0D\x0A
    2020-05-14T06:28:25.040Z DEBUG modem << OK\x0D\x0A
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Thanks,

    Praveen k.

  • Hi Praveen,
    Let's keep the "Serial LTE Modem" sample out of this discussion since it does not support FTP client yet.
    (However, there are some PRs awaiting to get merged that brings FTP client support to the Serial LTE modem Sample: https://github.com/NordicPlayground/fw-nrfconnect-nrf/pull/2275 and https://github.com/NordicPlayground/fw-nrfconnect-nrf/pull/2178)


    In Stian's response he used the "FTP Client sample" with the CMW500 and was able to get a connection to the local FTP server. 
    Could you please share the output log and could you confirm that you followed the callbox steps shown in his answer. Please also make sure you are using the correct IP when building the FTP client sample.

    Best regards,

    Martin L.

  • Hi Praveen,

    What is the IP address of the nRF91 and what is the IP address of the DAU unit? Have you confirmed that they are on the same subnet? Did the nRF91 also get an IP from the same subnet?

    Did you connect a network cable to the DAU unit, not just the remote control port? You will usually need two network cables connected to the CMW500. One for remote access, and one separate for the DAU unit.

    If you open a "Data Application Measurement" you can start the "IP Analysis" here you will see all socket connections between the UE and the local network. It will show you the source and destination port/addr for all active connections.

    You can also start a http or ftp server on the CMW500 DAU. Click on the HTTP or FTP tab and start the server. The IP address of these servers is the same as the DAU unit and is shown in the IP Config window:

    Try to open up a connection to port 80 which is the HTTP server and see if that works. In the above example the AT command would be:

        AT#XSOCKET=1,1,0
    AT#XCONNECT="192.168.16.149",80

    Are you sure that the TCP server on your local network is reachable? Have you tried connecting to it from other computers on the same network?

    I'm using the serial_lte_modem here, the same hex-file as you got from Martin, and there is no problem communicating with the local server through the CMW500.

    The TCP "server" is a simple python script that listens to a port on the network. Here is the script:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    import socket
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.bind(('',3442))
    s.listen(5)
    while True:
    (clientsocket, address) = s.accept()
    print(clientsocket, address)
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Here are the AT commands sent to the serial lte modem, just to set up a simple test:

    Ready
    
    AT%XSYSTEMMODE=1,0,0,0
    OK
    
    AT+CEREG=5
    OK
    
    AT+CFUN=1
    OK
    
    +CEREG: 2,"0001","00000100",7,0,0,"11100000","11100000"
    +CEREG: 1,"0001","00000100",7,,,"11100000","11100000"
    
    AT#XSOCKET=1,1,0
    #XSOCKET: 1, 1, 0, 6
    OK
    
    AT#XCONNECT="192.168.16.153",3442
    #XCONNECT: 1
    OK

    And here is the output from the python scrpt, when the nRF91 (192.168.16.157) connects:

    $ python3 tcp_server.py
    <socket.socket fd=4, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('192.168.16.153', 3442), raddr=('192.168.16.157', 52236)> ('192.168.16.157', 52236)
  • Hi Stian,

    Are you using R&S CMW500 call box?

    Can you share your call box profile file.So that we will quickly load your settings in our call box and try TCP client.

    With regards,

    Praveen Palaparthi

  • Hi, yes I'm using R&S CMW500. Here is config file for DAU, remote setup, LTE-M1 signalling and NB1 signalling. Hope that helps

    https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-9d4a912378454724831e5b8284d96607/DAU_2D00_NB1_2D00_M1.dfl