MicroPython_ESP32_psRAM_LoBo icon indicating copy to clipboard operation
MicroPython_ESP32_psRAM_LoBo copied to clipboard

FTP Download Firmware

Open bdespatis opened this issue 6 years ago • 3 comments

After transfering a file 5 times with FTP, I can't manage to send it again. It's exactly the internal file system size. Should I understand that I need to clear somethings ? FTP will run forever without being able to update the file in place. I was doing this as an OTA.fromfile procedure. I had to erase through serial connection to be able to access the file system again. Same thing after 5 updates.

Let me know how to correct the situation. It's not a big deal as I plan to move to PPPoS and OTA from a Web File Hosting Server (no issue there as it's direct reprogramming).

Regards, Benoit Despatis, P. Eng.

bdespatis avatar Dec 07 '18 21:12 bdespatis

Which filesystem type are you using? You may try to use a different one. I think the filesystem size should be at least 16K larger than the largest file you are going to write. Erasing the file before (over)writing it may help.

Some improvements to the Ftp module will be aavilable after this month's update. Writing large files to the internal filesystem can be quite slow (each 4K sector erase takes ~100 ms to finish). It is much faster if you can use SD Card for large files.

loboris avatar Dec 17 '18 11:12 loboris

I use SPIFFS.

I tried to remove it first and it did not change the result. It's easy and fast to test. Send a big file through FTP, with REPL remove it. Do this the number of time needed to fill up the flash (ex: 9MB, file of 2 MB). Last time you try, FTP will run in an infinite loop.

I can try with FatFS and LittleFS.

Regards, Benoit

bdespatis avatar Dec 17 '18 11:12 bdespatis

Can you try to uncrease the size of Ftp transfer buffer: → MicroPython → System settings → FTP Server Configuration → Transfer buffer size (bytes) to 4K or even 8K. As I've mentioned, writing to internal Flash is very slow and Ftp client may have issues waiting for block transfer confirmation. If you are using minicom or other terminal emulator supporting YModem, you can try to transfer the file using the ymodem module to see if it behaves the same.

loboris avatar Dec 17 '18 11:12 loboris