Homebrew WiiU FTP Server (use WUT, fix inject failures and increase bandwith)

Laf111

Well-Known Member
OP
Member
Joined
Mar 19, 2019
Messages
163
Trophies
0
XP
1,378
Country
France
Based on ftpiiu but with the following issues fixed :
  • connections failures and crashs
  • file's dates (timestamps)
  • file injection (add rights on files received using IOSUHAX lib)
  • remove the one slot limitation on upload and unlock up to 8 simultaneous transfers (download/upload)
  • much more faster than the original

Few games such as WWHD check the save files'rights and refuse to import them if permissions rights are not set using IOSUHAX_FSA_ChangeMode.


WiiuFtpServer comes also with some extra features :

  • support Wiiu PRO and Wiimote controllers
  • you can choose to disable or enable the power saving feature
  • enable / disable VERBOSE mode on server side
  • mount NAND paths only if you ask for it
  • a network unbrick feature
  • a CRC calculation on server side and a tool to verify the CRC of files transferred

Download and details : https://github.com/Laf111/WiiUFtpServer


When using Ethernet (Wii-U adapter and Ethernet 5) :

 
Last edited by Laf111,

ploggy

WAKA! WAKA!
Member
Joined
Aug 29, 2007
Messages
4,811
Trophies
2
XP
7,805
Country
United Kingdom
Thank you for this :)
Is there a reason why you haven't released a readymade installable wup of the Channel? and is the Channel a forwarder?
If it is a forwarder I wont have to reinstalling the Chan every time there's an update :P
 

ploggy

WAKA! WAKA!
Member
Joined
Aug 29, 2007
Messages
4,811
Trophies
2
XP
7,805
Country
United Kingdom
@Laf111 your Chan files seem to be messed, Possibly the tga files are wrong?

Edit: got the Chan to work but once you load the app it doesn't exit so.. kinda pointless :/
 
Last edited by ploggy,

Laf111

Well-Known Member
OP
Member
Joined
Mar 19, 2019
Messages
163
Trophies
0
XP
1,378
Country
France
Sweet! No rush :) and you too

Hey,

V2 is out.

Took me more time than expected because i had to modify the code for the channel behaviour.
The channel version shutdown the Wii-U when exiting (bug with WUT:;procui = fail to go back to the Wiiu Menu...).

Have a nice day
 
Last edited by Laf111,
  • Like
Reactions: Masana and ploggy

ploggy

WAKA! WAKA!
Member
Joined
Aug 29, 2007
Messages
4,811
Trophies
2
XP
7,805
Country
United Kingdom
Hey,

V2 is out.

Took me more time than expected because i had to modify the code for the channel behaviour.
The channel version shutdown the Wii-U when exiting (bug with WUT:;procui = fail to go back to the Wiiu Menu...).

Have a nice day
Thank you. i'll check it out :)
 

V10lator

Well-Known Member
Member
Joined
Apr 21, 2019
Messages
2,599
Trophies
1
Age
36
XP
5,400
Country
Germany
Did you ever check the return value of https://github.com/Laf111/WiiUFtpServer/blob/main/src/net.c#L67 ? It should be 0, else it didn''t work. I'm asking this as I'm pretty sure it returns a none-zero value as you can't specify a 128 KB buffer without specifying a userspace buffer before (max kernel space is 63 KB). Have a look at these codes for how to set a userspace buffer: https://github.com/V10lator/NUSspli/blob/master/src/downloader.c#L229-L266 - Important: somemopt() will block untill socket_lib_finish() gets called, that's why you need to run it in its own thread).

Other than that you need to tune storage I/O, too. It doesn't help if you're able to transfair data faster than you're able to read and write it. The important part for high-speed is to specify a I/O buffer here, too. just like this: https://github.com/V10lator/NUSspli/blob/master/src/ioThread.c#L243 - If you don't do that WUT/libIOSUHAX will use a new buffer for each read()/write(), making it horrible slow. Note that the buffer needs to be 0x40 aligned and that you need to free() it after fclose().
 
Last edited by V10lator,
  • Like
Reactions: Laf111

Laf111

Well-Known Member
OP
Member
Joined
Mar 19, 2019
Messages
163
Trophies
0
XP
1,378
Country
France
Did you ever check the return value of https://github.com/Laf111/WiiUFtpServer/blob/main/src/net.c#L67 ? It should be 0, else it didn''t work. I'm asking this as I'm pretty sure it returns a none-zero value as you can't specify a 128 KB buffer without specifying a userspace buffer before (max kernel space is 63 KB). Have a look at these codes for how to set a userspace buffer: https://github.com/V10lator/NUSspli/blob/master/src/downloader.c#L229-L266 - Important: somemopt() will block untill socket_lib_finish() gets called, that's why you need to run it in its own thread).

Other than that you need to tune storage I/O, too. It doesn't help if you're able to transfair data faster than you're able to read and write it. The important part for high-speed is to specify a I/O buffer here, too. just like this: https://github.com/V10lator/NUSspli/blob/master/src/ioThread.c#L243 - If you don't do that WUT/libIOSUHAX will use a new buffer for each read()/write(), making it horrible slow. Note that the buffer needs to be 0x40 aligned and that you need to free() it after fclose().

Thank you !
I'll have a look.
 
  • Like
Reactions: V10lator

V10lator

Well-Known Member
Member
Joined
Apr 21, 2019
Messages
2,599
Trophies
1
Age
36
XP
5,400
Country
Germany
Great work. :) Still it seems to be slower than it could be. Maybe the next speed improvement could be multitasking? I didn't look how much is implemented already but you could do it like this:
  • Network I/O on core 0.
  • UI on core 1.
  • Storage I/O on core 2.
This needs an I/O queue but such a queue is a good thing anyway.

//EDIT: One question: Is there a reason to embed WUT and libIOSUHAX? I mean you depend on devkitPro anyway and with devkitPro getting these deps is as simple as
Code:
pacman -S wut wut-tools wiiu-libiosuhax
 
Last edited by V10lator,
  • Like
Reactions: Laf111

Laf111

Well-Known Member
OP
Member
Joined
Mar 19, 2019
Messages
163
Trophies
0
XP
1,378
Country
France
Great work. :) Still it seems to be slower than it could be. Maybe the next speed improvement could be multitasking? I didn't look how much is implemented already but you could do it like this:
  • Network I/O on core 0.
  • UI on core 1.
  • Storage I/O on core 2.
This needs an I/O queue but such a queue is a good thing anyway.

//EDIT: One question: Is there a reason to embed WUT and libIOSUHAX? I mean you depend on devkitPro anyway and with devkitPro getting these deps is as simple as
Code:
pacman -S wut wut-tools wiiu-libiosuhax

I struggled to find a version of FtpiiU that compiles... Then i removed all uneeded dependencies (libfat, ogc), choose WUT instead of dynamic libs. So i want to save some time to other user who want to rebuild it.
 
  • Like
Reactions: Cyan

Laf111

Well-Known Member
OP
Member
Joined
Mar 19, 2019
Messages
163
Trophies
0
XP
1,378
Country
France
Is the embedded WUT latest git master or latest release? I'm asking cause master has socket API changes you want to avoid (I'm using this WUT fork cause of that: https://github.com/V10lator/wut ).

Sorry, i was not connected since this morning.

I got this version with the pacman command when i installed devKitPro (early days of april).

I began to have a look to your socket optimization (i mean use user buffers). Thank you for that !
If i understand correctly, i need to use the release version of WUT ? ?

But i wanted to fix the timestamps first (this fix should be in libIOSUHAX. That's also why i compile the lib : i was pretty sure that the fix should be there).

In fact, i achieved my initial goals (fix injection + timestamp) needed for Cemu2WiiU to work (mainly injection, timestamp is only for a display purpose since the FTP server does not implement the MTDM function) and in that use, slow transferts are not a problem since save files represent only few MB to transfert.
 
Last edited by Laf111,

Laf111

Well-Known Member
OP
Member
Joined
Mar 19, 2019
Messages
163
Trophies
0
XP
1,378
Country
France
Funny, I get much slower speeds with your version.
I get around 950KB/s with FTPiiu-everywhere and 250KB/s with this one.

Damn, you're right !!!
I must have used a WUT version of ftp-everwhere for my bench...

https://1drv.ms/u/s!Apr2zdKB1g7fgnKD7aZwKpN5oDrU

The WUT socket API seems worse that dynamic_libs one.
It proves that "newer" does not always mean "better"...

Using the ftp-everywhere CBHC from the homebrew app store :

https://1drv.ms/u/s!Apr2zdKB1g7fgnPZAdR-Exd2Z43F

WiiuFtpServer using dynamic_libs + optim :

https://1drv.ms/u/s!Apr2zdKB1g7fgnTqtJOgwjaAal0M

This version will be available in v4-2. i'm currently tying to make a channel with it.

Thanks for your feeback.
 
Last edited by Laf111,

piratesephiroth

I wish I could read
Member
Joined
Sep 5, 2013
Messages
3,453
Trophies
2
Age
103
XP
3,228
Country
Brazil
Last edited by piratesephiroth,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BigOnYa @ BigOnYa:
    @K3Nv2 What is nps you mentioned?
  • K3Nv2 @ K3Nv2:
    Because your pc has a hamster innit
    +3
  • BakerMan @ BakerMan:
    R.I.P. LittleBigPlanet PS3 servers
  • BakerMan @ BakerMan:
    LBP2 still the goat tho
  • K3Nv2 @ K3Nv2:
    That can be played on ps5 iirc
  • BigOnYa @ BigOnYa:
    I'm surprised any PS3 servers are still up, tbh
  • K3Nv2 @ K3Nv2:
    Alot of manufactures do care about older consoles they just want to whine about piracy
    +2
  • S @ salazarcosplay:
    @BigOnYa I had 4.89 hfw on super slim that was great, but when I got a new hard disk I forgot where the guide was and could only find a guide for 4.90 and its resources
  • S @ salazarcosplay:
    @BigOnYa I think another reason to want to update is if the hfw is at the level of the fw
  • S @ salazarcosplay:
    you can sync trophies
  • BigOnYa @ BigOnYa:
    Yea that's what I'm sitting on now- 4.9, and it seems fine, have had no issues at all
  • S @ salazarcosplay:
    I don't know if people play online or such
  • K3Nv2 @ K3Nv2:
    My ps3 short circuited during a deep clean still salty about it after downloading 2tbs worth but SteamDeck okay with emulation still just can't run mgs4 worth shit
  • BigOnYa @ BigOnYa:
    Yea forgot bout trophies. They just silly to me. Just like the xbox achievements. Hey, to each they own tho.
  • K3Nv2 @ K3Nv2:
    It keeps players in touch with the game like a check list of things to do after they beat it
  • S @ salazarcosplay:
    @BigOnYa they ruined the gaming experience for me to be honest
  • S @ salazarcosplay:
    @BigOnYa Im not crazy about getting all of them, i feel like I have something to show for for the time put in
  • S @ salazarcosplay:
    @BigOnYa If you want to do rgh or 360 mod
  • S @ salazarcosplay:
    does it matter if you update your 360 or not before trying is it advisable or not
  • BigOnYa @ BigOnYa:
    Yea I don't pay attention to them really. Or do I try to 100% a game. I just play till story ends/ or I get the girl!
  • K3Nv2 @ K3Nv2:
    Bigonya uses his wiener to mod 360s
    +1
  • Xdqwerty @ Xdqwerty:
    Going to the water park, see ya
  • BigOnYa @ BigOnYa:
    You should update the 360 to newest dash before RGHing it yes. But not a big deal if you don't, you can install new dash/avatar updates after. It's just easier to do it auto online before, instead manual offline after.
  • BigOnYa @ BigOnYa:
    Have fun @Xdqwerty. If you see a chocolate candy bar floating in the water, don't eat it!
  • AncientBoi @ AncientBoi:
    :O:ohnoes: Y didn't U Tell ME that ALSO @BigOnYa :ohnoes: 🤢🤮
    AncientBoi @ AncientBoi: :O:ohnoes: Y didn't U Tell ME that ALSO @BigOnYa :ohnoes: 🤢🤮