serial_lte_modem AT#XFTP="put" SLM data mode and escaping data?

So I have to upload a bunch of files, some contain arbitrary data that might contain +,\r,\n,\ ext

So there are two different ways of using the FTP put command, one is in SLM data mode, the other is inline in quotes and I am having huge issues with both

**inline Mode?**
AT#XFTP="open","******username********","*******password*****","*******domain*******"
AT#XFTP="verbose","on"
AT#XFTP="binary"
AT#XFTP="put","test.txt","this is test content"
AT#XFTP="close"


**SLM Data Mode**
AT#XFTP="open","******username********","*******password*****","*******domain*******"
AT#XFTP="verbose","on"
AT#XFTP="binary"
AT#XFTP="put","test.txt"
this is test content
AT#XFTP="close"

We can talk about these two options:

Option1 is what I call inline mode:

if I try to include a  \" inside the first option, or a \r\n in the next the modem will just lock up for a long time. Is there any way to send a bunch of arbitrary binary data as long as I escape it somehow? since backslash doesn't seem to be working

Example that will fail:

AT#XFTP="open","******username********","*******password*****","*******domain*******"
AT#XFTP="verbose","on"
AT#XFTP="binary"
AT#XFTP="put","test.txt","this is\" test content"
AT#XFTP="close"

Option2: Is what you guys call SLM data mode:

According to the documentation and from what I can see in the code, the only way the modem should exit SLM data mode is after a timeout, or by sending +++

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/serial_lte_modem/doc/slm_data_mode.html

But this doesn't happen, it only seems to exit SLM mode when I send a \r\n but there appears to be no way of escaping this?

Another problem is if I just pretend the first issue isnt a thing and remove all new lines from my data(which I really can't do, this is just for exploring the other problem I am having) and send +++ it shows up in the file that is uploaded to the server?

Example that will write part of a file and then get an error because it drops out of SLM too soon:

AT#XFTP="open","******username********","*******password*****","*******domain*******"
AT#XFTP="verbose","on"
AT#XFTP="binary"
AT#XFTP="put","test.txt"
this is \r\ntest content+++
AT#XFTP="close"

If I try to use the +++ as intended from the documentation:

AT#XFTP="open","******username********","*******password*****","*******domain*******"
AT#XFTP="verbose","on"
AT#XFTP="binary"
AT#XFTP="put","test.txt"
this is test content+++
AT#XFTP="close"

I end up with a file on the server including the +++:

this is test content+++

This example will also fail if you do not send a \r\n at the end of the test content line even though the +++ is supposed to terminate it.

Few quite baffling things that do not follow normal conventions or even the documentation?

Parents
  • Hi Kyle,

    Thanks for your feedback, I have tested your observation and agree that we should improve the implementation of these parts.

    I will talk with our development team and give you a reply later.

    Best regards,

    Charlie

  • Charlie,

    Did you hear back from the dev team about this issue?

    Thanks,

    Kyle

  • In Summery, I bought a cellular booster to rule out bad connection being the source of my problem, it was not my problem.

    So it comes down to 4 issues:

    •  1) SLM mode for MPUT doesn't seem to be exiting ever, its ignoring the exit string of "+++" even though i made sure it was "+++" in the conf file. Take a look at the last comment about the ESP32, same thing with MPUT

    • 2) With my signal strength at: RSRQ: -10.50db RSRP: -63.00db both:

    AT#XFTP="open","******username********","*******password*****","*******domain*******"

    and

    AT#XHTTPCCON=1,"****DOMAIN****",80

    are very unreliable, I have tried many domains

    • 3) Another issue I have been having is with simple HTTP post:

    > AT#XHTTPCCON=1,"***DOMAIN***",80
    *** wait for "#XHTTPCCON: 1"
    > AT#XHTTPCCON?
    *** check for '#XHTTPCCON: 1,"***DOMAIN***"' to make sure connection active
    > AT#XHTTPCREQ="POST","/?filename=text.txt","Content-Type: text/plain\r\nContent-Length: 5\r\n",5
    *** wait for "#XHTTPCREQ: 1"
    > 12345

    But I always get this back:

    #XHTTPCRSP:0,1

    no 200, no 500, nothing at all. this happens on a lot of different domains.

    I am despite to get log files transferred to the server. This used to work.

    Edit: I got the ping function working and google.ca works most of the time but other domains like ours, stack overflow, speed test .net among others are a roll of the dice if it will ever get a response, even when using the direct IP address instead of the domain name

  • Hi Kyle,

    1) As I explained before, Document Running in data mode mentioned "FTP unique or single put operations are completed." will trigger data mode exists, so make sure you have all your content at one put action. Every time you send some data through FTP put/mput data mode, it will trigger a single put operation, when it is completed, the data mode exists. so "+++" is not necessary to be used here. It is also applied to HTTP commands.

    2) 3) Looks like they are the same issue, the FTP/HTTP server is not connected. Are you testing with LTE-M network? Did you experience the same symptoms with the nRF9160DK board?

    The current log information is outputted through RTT viewer, try to capture it after adding "CONFIG_SLM_LOG_LEVEL_DBG=y" and comment "#CONFIG_SLM_LOG_LEVEL_INF=y".

    Best regards,

    Charlie

  • Hello Charlie,

    In regards to the last post on the other thread, I am running 1.3.1 MFW

    1) I know the documentation says its a 1 second timeout on this but in practice my modem seems to be staying in MPUT mode until hardware reset.

    2)3) Exact same issue on the DK hardware vs my own board. I think the simplest example will be to just turn the modem on and PDA connect, then ping google.ca and then a few other domains including nordicsemi.com

    Thanks

    Kyle

    Edit: I should add, these logs were done on the DK hardware using MFW 1.3.1 and serial_lte_modem 1.8.0

  • Here is a log from the rare event when I actually get connected to the server, I am basically connecting with the LTE Link monitor... setting up my network and connecting to the FTP server then sending:

    AT#XFTP="put","test.txt"
    this is test content\x0A\x0Dand more on another line

    and then the modem mostly just locks up for a LONNGG time and I need to reset it.

    Here is a log of the connection/ping when it does manage to connect and the SLM failure following:

Reply
  • Here is a log from the rare event when I actually get connected to the server, I am basically connecting with the LTE Link monitor... setting up my network and connecting to the FTP server then sending:

    AT#XFTP="put","test.txt"
    this is test content\x0A\x0Dand more on another line

    and then the modem mostly just locks up for a LONNGG time and I need to reset it.

    Here is a log of the connection/ping when it does manage to connect and the SLM failure following:

Children
No Data
Related