FTP Server IP - Passive Mode

  • Pycom MicroPython 1.18.1.r1 [v1.8.6-849-b0520f1] on 2018-08-29; GPy with ESP32

    Issue with the FTP server. The IP returned after receiving a PASV command is port 2024 or "(0,0,0,0,7,232)".

    How can I fix this? Can I specify what IP to return to the client so FTP works?


  • @robert-hh So the issue was the LTE modem being initialized sets the WLAN ip address to I was printing the IP before the LTE initialized so I missed that. Thanks for pointing me in the right direction.

    I suppose the LTE ought to have its own IP storage, but I guess it shares the WLAN object's.

  • @panda It is still strange. So just to confirm.
    Since the device works in station mode, you can get the IP address of that device, using:

    from network import WLAN

    ifconfig() can also be used to set the IP address of your device using:

    ifconfig(config=(<ip>, <netmask>, <gateway>, <dns_server>))

    See also https://docs.pycom.io/firmwareapi/pycom/network/wlan#quick-usage-example:

    • Can you use telnet to connect to your board using that address, with the command telnet <ip>?
    • You seem to work with Windows. At least you should be able to connect to you device using command line ftp, with ftp <ip> You will not be able to transfer data or run dir, since Windows ftp works in active mode only.
      If that works, I see no reason why you cannot configure FileZilla to work.

  • @robert-hh I did. I wish filezilla would just ignore and use the server ip used for the initial connection.

    Is there a way to edit address space that holds the IP the ftp server uses? I can't see how I would otherwise do this. No api functions available to set the local IP of the device.

    Could the LTE radio be the problem? How and where does the GPy store the local IP for each network (wifi and lte)?

  • Banned

    This post is deleted!

  • @panda Sorry for asking, you wrote that in your first post. Yes, then it's strange that you receive that value. What I see are the proper addresses. I do not have a GPy, but the ftp code is the same on all models. Did you restrict the number of connections to 1 in the Filezilla settings?

  • 1.18.1.r1

  • @panda That's strange, since the address to be returned e.g. for ls is the Modules own IP address, which should be known since you can connect to the device. Which version of the firmware are you using on the GPy?

  • @robert-hh Thanks I'll give that a try, but the PASV response is coming from the GPy so curious whats causing that. Filezilla works good except you can't configure it to ignore the bad server address response so I am stil looking for an FTP client that otherwise works.

  • Sorry, I'm using STA mode...mind not working this AM.

  • @panda I also had difficulties with WinSCP. Therefore I do not use it. What works for me is the FireFTP plug-in of Firefox.
    Some file managers can be used too, like Nautilus and Thunar of Linux.

  • AP Mode,

    I also have trouble with various FTP programs with the DELE command. I get a 550 response. FileZilla works ok, but SmartFTP and WinSCP do not.

  • @panda How do you run your GPy's WiFi, as AP or as STA? I cannot reproduce this response here, but I have all devices set up in STA mode.

Log in to reply

Pycom on Twitter