Homebrew Homebrew app [Release] ftpsrv - A small ftp server

It may just be my imagination, but I feel like the file writing speed has slowed down compared to 0.2.0. It was around 10mb/s before, but now it's around 3.8mb/s.
I apologize if it was a mistake or misunderstanding on my part.
 
It may just be my imagination, but I feel like the file writing speed has slowed down compared to 0.2.0. It was around 10mb/s before, but now it's around 3.8mb/s.
I apologize if it was a mistake or misunderstanding on my part.
you can re-download 0.2.0 and see if you actually did get 10mb/s.
 
  • Like
Reactions: impeeza
I try it but show the old on
If you use the button on Breeze it will launch a forked version of ftpsrv. I have added a number of mounts that are useful for users of Breeze. The purpose is already well served with 0.2.0, you can only fetch the save for one game is the limitation.

Post automatically merged:

you can re-download 0.2.0 and see if you actually did get 10mb/s.
The sysmodule 1.0.0 is slower than 0.2.0 for me.

The zips can't be successfully downloaded. I have tried a few and they all failed with less than 50% transferred. The files version are working fine. I am using the app version.
 
Last edited by TomSwitch,
If you use the button on Breeze it will launch a forked version of ftpsrv. I have added a number of mounts that are useful for users of Breeze. The purpose is already well served with 0.2.0, you can only fetch the save for one game is the limitation.

Post automatically merged:


The sysmodule 1.0.0 is slower than 0.2.0 for me.

The zips can't be successfully downloaded. I have tried a few and they all failed with less than 50% transferred. The files version are working fine. I am using the app version.
> Less than 50% downloaded
It's not actually failed, the zips are created on the fly. There is no way for me to know the size of the zip before it is created, I report a bogus file size to the client that will always be bigger than the actual size (in case some clients self terminate once the size is reached).

I could calculate the size ahead of time, but that would mean when you open the save folder, I'd have to open every single save, traverse through every single file and folder for all games. Extremely slow stuff. Now imagine if multiple clients are open at once, and open the save folder or spam refresh. While unlikely, I do have to handle that case as it's ftp after all, the spec allows it.

A zip *can* fail only of the save folder is empty, ie, you launched the game, hos creates a revered space for the game, and then you never saved. Hence there being a folder but it is empty. And you wouldnt want an empty zip, hence the error ;)

As for it being slower...I am puzzled by this. For me it is substantially faster, and privately a few people have reported the same. But 2 users (yourself and another) has reported the opposite, so I guess I'll need to look into this - unfortunately.

More specifically, I need to know:
- is this one large file, or multiple file?
- client? I assume total commander tho.
- are logs enabled? Does disabling them make a difference?
- is led enabled? Does disabling it make a difference?
- Upload? Download? Both?
- Is the initial transfer speed slow and then gradually gets faster?
- What are the speeds you was getting before and now?
- What is the file size?
 
Last edited by Deleted member 413168,
  • Love
  • Like
Reactions: HoRy205 and impeeza
> Less than 50% downloaded
It's not actually failed, the zips are created on the fly. There is no way for me to know the size of the zip before it is created, I report a bogus file size to the client that will always be bigger than the actual size (in case some clients self terminate once the size is reached).

I could calculate the size ahead of time, but that would mean when you open the save folder, I'd have to open every single save, traverse through every single file and folder for all games. Extremely slow stuff. Now imagine if multiple clients are open at once, and open the save folder or spam refresh. While unlikely, I do have to handle that case as it's ftp after all, the spec allows it.

A zip *can* fail only of the save folder is empty, ie, you launched the game, hos creates a revered space for the game, and then you never saved. Hence there being a folder but it is empty. And you wouldnt want an empty zip, hence the error ;)

As for it being slower...I am puzzled by this. For me it is substantially faster, and privately a few people have reported the same. But 2 users (yourself and another) has reported the opposite, so I guess I'll need to look into this - unfortunately.

More specifically, I need to know:
- is this one large file, or multiple file?
- client? I assume total commander tho.
- are logs enabled? Does disabling them make a difference?
- is led enabled? Does disabling it make a difference?
- Upload? Download? Both?
- Is the initial transfer speed slow and then gradually gets faster?
- What are the speeds you was getting before and now?
- What is the file size?

Looks like what total commander think is the size is smaller than the one shown on the directory display.

The speed of sysmodule 1.0 is about the speed of passive mode of 0.2 and both mode similar speed while 0.2 active mode is about twice the speed of passive mode. This is the speed of upload to Switch of a file that is about 5MB in size.
Post automatically merged:


Perhaps padding the zips with zeros so that the advertised size matches the reported size?
 
Last edited by TomSwitch,
Looks like what total commander think is the size is smaller than the one shown on the directory display.

The speed of sysmodule 1.0 is about the speed of passive mode of 0.2 and both mode similar speed while 0.2 active mode is about twice the speed of passive mode. This is the speed of upload to Switch of a file that is about 5MB in size.
Post automatically merged:


Perhaps padding the zips with zeros so that the advertised size matches the reported size?
I won't pad the zips, it's a huge waste of memory. If they download and open fine, what's the issue?

Active and passive are exactly the same transfer code, the only difference is the port number when the socket is open. 5mb is way too small to declare x is slower than y, use a large file.

I can't reproduce this on my end. You can use git bisect to find the offending commit that slows everything down. There was 10 commits between 0.2.0 and 1.0.0 so it wouldn't take long to build and test each one
 
  • Like
Reactions: impeeza
I won't pad the zips, it's a huge waste of memory. If they download and open fine, what's the issue?
I didn't think those files were good, now that you mentioned it they do uncompressed just fine. It is fine then. Perhaps a note is needed so users are aware.

Thanks for a very nice piece of work you have done. I appreciate it.
 
Last edited by TomSwitch,
I didn't think those files were good, now that you mentioned it they do uncompressed just fine. It is fine then. Perhaps a note is needed so users are aware.

Thanks for a very nice piece of work you have done. I appreciate it.
yeah good idea. i'll create a wiki on github to document everything. i'll link it in the main readme so it will be hard to miss.

fwiw, the file size reported for zips is the total size allocated for that save. for example, a game could reserve 64MB. The game may only have a single 2KB file, but ftpsrv reports the fullsize. i report the max size as the client may kill the connection once the reported filesize has been met - which we dont want. this also should better explain why i dont want to pad the zips, in the above example, it would waste 63MB of space to store a single 2KB file
Post automatically merged:

in the next version, i have added support for custom ftp commands. this means i can now add commands that can do pretty much anything! This is what i've added so far:
  • "REBT". Reboot console.
  • "RTOP". Reboot to payload.
  • "RTOH". Reboot to hekate.
  • "SHUT". Shutdown console.
  • "APID". List application process id.
  • "ATID". List application title id.
  • "PIDS. List all process ids.
  • "TIDS". List all title ids.
  • "TRMP". Terminate process id.
  • "TRMT". Terminate title id.

You can send custom commands using filezilla, or use curl from cli.

Here's an example to get the title id of the game (can be used to make a discord presence app by polling this:
curl -Q "ATID" ftp://192.168.1.71

Here's an example to reboot to any payload:
curl -Q "RTOP /bootloader/payloads/fusee.bin" ftp://192.168.1.71

Here's an example to reboot to Hekate and launch UMS (mount sd card):
curl -Q "RTOH 3" ftp://192.168.1.71
 
Last edited by Deleted member 413168,
1.1.0 is out, main changes for Nx are:
  • added custom commands, full list is here https://github.com/ITotalJustice/ftpsrv/wiki/Nx-‐-Custom-Commands.
  • add timestamp to save zips.
  • improve ftp response latency by sending the response immediately which can save a poll() call.
  • fix building of the app version, this was due to having old libs installed before they were merged into dkp.
i wrote a python script which can backup save files in a zip once the game has closed. It uses the custom command "TID" to retrieve the title_id and name of the currently running application. When that application is closed, it fetches the save data into a zip file.
 
1.1.0 is out, main changes for Nx are:
  • added custom commands, full list is here https://github.com/ITotalJustice/ftpsrv/wiki/Nx-‐-Custom-Commands.
  • add timestamp to save zips.
  • improve ftp response latency by sending the response immediately which can save a poll() call.
  • fix building of the app version, this was due to having old libs installed before they were merged into dkp.
i wrote a python script which can backup save files in a zip once the game has closed. It uses the custom command "TID" to retrieve the title_id and name of the currently running application. When that application is closed, it fetches the save data into a zip file.
That's really cool!
 
1.1.0 is out, main changes for Nx are:
  • added custom commands, full list is here
  • add timestamp to save zips.
  • improve ftp response latency by sending the response immediately which can save a poll() call.
  • fix building of the app version, this was due to having old libs installed before they were merged into dkp.
i wrote a python script which can backup save files in a zip once the game has closed. It uses the custom command "TID" to retrieve the title_id and name of the currently running application. When that application is closed, it fetches the save data into a zip file.
i believe it was a typo on wiki,

example: lftp -e "quote TID;quit" 192.168.1.71
should be: lftp -e "quote TIDS;quit" 192.168.1.71
 
@TotalJustice

In the latest version, you added support for per-app and per-sys configuration options. I’d like to enable mount_devices in [Nx-App] but disable it in [Nx-Sys]. The configuration I tried (shown below) isn’t working. Could you please show me the correct way to set this up?

Code:
##########
# ftpsrv #
##########

[Login]
anon = 0
user = "User1"
pass = "Pass1"

[Network]
port = 5000

[Misc]
use_localtime = 14400

[Log]
log = 0

# options specific to Nintendo Switch
[Nx]
led = 1

# options specific to Nintendo Switch App
[Nx-App]
mount_devices = 1
save_writable = 1
mount_bis = 1
timeout = 0

# options specific to Nintendo Switch Sysmodule
[Nx-Sys]
mount_devices = 0
save_writable = 0
timeout = 20
 
@TotalJustice

In the latest version, you added support for per-app and per-sys configuration options. I’d like to enable mount_devices in [Nx-App] but disable it in [Nx-Sys]. The configuration I tried (shown below) isn’t working. Could you please show me the correct way to set this up?

Code:
##########
# ftpsrv #
##########

[Login]
anon = 0
user = "User1"
pass = "Pass1"

[Network]
port = 5000

[Misc]
use_localtime = 14400

[Log]
log = 0

# options specific to Nintendo Switch
[Nx]
led = 1

# options specific to Nintendo Switch App
[Nx-App]
mount_devices = 1
save_writable = 1
mount_bis = 1
timeout = 0

# options specific to Nintendo Switch Sysmodule
[Nx-Sys]
mount_devices = 0
save_writable = 0
timeout = 20
That should work. Are you sure you're using the latest release? Have you restarted the sysmodule or restarted your switch?

The code for loading overrides is very simple, it loads the value here https://github.com/ITotalJustice/ft...c4912c4d003/src/platform/nx/main_sysmod.c#L44 and then loads the override here https://github.com/ITotalJustice/ft...c4912c4d003/src/platform/nx/main_sysmod.c#L58

Edit: why is the use_localtime set to 14400? It should be either 0 or 1 as it's a true or false value. You either either use local time or gmtime
 

Site & Scene News

Popular threads in this forum