Open phatpaul opened 6 years ago
Yikes, it looks like a lot of this micropython port (for ESP32) was written for WiFi only. I not going to butcher your code @loboris. Hopefully you can improve the Ethernet support someday.
Lots of references to WiFi in modnetwork.c which should also take into account Eth connection. https://github.com/loboris/MicroPython_ESP32_psRAM_LoBo/blob/master/MicroPython_BUILD/components/micropython/esp32/modnetwork.c
ftp.c also assumes Wifi only, since it is based off of Pycom's code (pycom modules don't seem to support Ethernet) https://github.com/loboris/MicroPython_ESP32_psRAM_LoBo/blob/master/MicroPython_BUILD/components/micropython/esp32/libs/ftp.c
Looks like I'm going back to using uftpd.py server for now.
https://github.com/robert-hh/FTP-Server-for-ESP8266-and-ESP32.git
I'm planning to make some improvements to the ethernet module next month and ftp/telnet support will be included.
The ethernet module has been update. Both Ftp server and Telnet server now works on any network interface (WiFi-STA, WiFi-AP, Ethernet). Multiple network interfaces can be active at the same time, FTP and Telnet will accept the connection on any of them.
Thanks Boris. I'm giving the new code a try.
I'm having trouble listing directory contents on the built-in FTP server.
The server is sending 227 (0,0,0,0,7,232) for passive mode - which should include the server's IP address.
Here's the Filezilla log: ''' Status: Connecting to 192.168.33.208:21... Status: Connection established, waiting for welcome message... Status: Server does not support non-ASCII characters. Status: Logged in Status: Retrieving directory listing... Command: PWD Response: 257 / Command: TYPE I Response: 200 Command: PORT 192,168,33,215,245,198 Response: 502 Command: PASV Response: 227 (0,0,0,0,7,232) Command: LIST Error: The data connection could not be established: WSAEADDRNOTAVAIL - Cannot assign requested address Response: 150 Error: Connection timed out after 20 seconds of inactivity Error: Failed to retrieve directory listing '''
Here's how I started the server: import network sta_if = network.WLAN(network.STA_IF) sta_if.active(1) sta_if.connect('xxx', 'xxx') sta_if.ifconfig() network.ftp.start(user="micro", password="python", buffsize=1024, timeout=300)
I haven't tried it with Ethernet yet... Unfortunately there's no dev board with the WROVER and Ethernet? But I'll try it on my Olimex ESP32-EVB.
Sorry, there is a bug in Ftp server in the latest update I've discovered today. The fix will be commited tomorrow.
The Ftp server bug fix is commited.
@phatpaul
Unfortunately there's no dev board with the WROVER and Ethernet?
External board like this one can be used. Small modification is needed:
An expansion board for ESP32 Devkitc is also available.
I can check with my electric engineer. We can release files for jlcpcb and it would be cheap to build your own if someone doesn't have the skill to design it. We can also manufacture some and sell it, we have our new reflow oven to do small batches.
Let me know.
Can you point me to where the FTP code is in this repository and I'll take a stab at hacking it?