FTP connection

6 thoughts on “FTP connection

  1. Hello Cosmin,


    we work with GC864-PY FW 07.03.301.


    we make a FTP connection to our server.


    With this command it works without any problems

    a = MDM.send(‘AT#FTPOPEN="<our serveraddress>","<user>","<password>",0r’,5)

    We are going to read the settings from a config file and change to this:

    FTPSERVER = <our serveraddress>

    FTPUSER = <user>

    FTPPASS = <password>


    a = MDM.send(‘AT#FTPOPEN=" ‘ +FTPSERVER+ ‘ "," ‘ +FTPUSER+ ‘ "," ‘ +FTPPASS+ ‘ ",0r’,5)


    This syntax don’t work. What could be wrong? Where is my mistake?


    Thank you for your help.

    1. Hi Michael,


      When I copy from your post

      a = MDM.send(‘AT#FTPOPEN=" ‘ +FTPSERVER+ ‘ "," ‘ +FTPUSER+ ‘ "," ‘ +FTPPASS+ ‘ ",0r’,5)


      I get some unwanted spaces, they are there indeed?


      What errros are you getting? Try to build command stringfirst and print it:


      FTPSERVER = "s"
      FTPUSER = "u"
      FTPPASS = "p"

      a = ‘AT#FTPOPEN="’ +FTPSERVER+ ‘","’ +FTPUSER+ ‘","’ +FTPPASS+ ‘",0r’

      print a
      print len(a)



    2. The spaces I add just for better reading here.


      We tried also to make a string first and this variable to AT#FTPOPEN.


      The message we get is "ERROR"


      However, I will check our code again for unwanted spaces.

      Thank you.

      1. OK, and do the print on module to be 100% sure string is correct, including the "/r". And set AT+CMEE=2 maybe you’ll get a more informative error message.


        1. We found it. As you supposed it was a space. We don’t see it at that moment.

          Thank you for assistance.