#98669 - bjoerngiesler - Wed Aug 16, 2006 10:03 pm
I'm announcing DSFTP 1.8. It's getting its own thread because from now on, DSFTP is two things: A stand-alone server (as before), and a software component you can link to your code to run an FTP server from your own program. This component is called libDSFTP.
This means that during development, you can run and test your program, then build a new version of it and upload it to the DS and run it without touching another button, and most important of all, without removing the flash card.
I'm including the source code of the stand-alone server as an example. Also, the documentation contains instructions on how to use libDSFTP. The simple gist is (wrapped into a mainloop() function for simplicity):
Code: |
void mainloop(void)
{
BFTPServer server;
// if you want to use a config file...
BFTPConfigurator configurator(&server);
configurator.configureFromFile("/data/settings/ftp.conf");
// or if you want to add users by hand...
server.addUser("myusername", "mypassword");
while(true)
{
// your own mainloop stuff
// ...
server.handle();
swiWaitForVBlank();
}
}
|
Get the ZIP at http://giesler.biz/~bjoern/downloads/DSFTP-1.8.zip and tell me what you think and if you find any bugs.
EDIT: If you find any bugs, please send me your ftp.conf file and log file (recorded at loglevel 5) via e-mail, together with a description of what version of DSFTP and what hardware you're using.
Have fun!
Last edited by bjoerngiesler on Thu Aug 17, 2006 6:34 am; edited 2 times in total
#98670 - vb_master - Wed Aug 16, 2006 10:07 pm
Nice, but I am getting like 7-10KB/s as opposed to my usual 500-700KB/s.
_________________
Back.
#98672 - bjoerngiesler - Wed Aug 16, 2006 10:11 pm
vb_master wrote: |
Nice, but I am getting like 7-10KB/s as opposed to my usual 500-700KB/s. |
You ain't never gonna get 500-700KB/s from my server, as it's behind a private DSL line with a 256kbit/s uplink.
#98674 - kevinc - Wed Aug 16, 2006 10:18 pm
After a quick reading of BController.cpp, you seem to stop wifiConnect() after getting ASSOCSTATUS_CANNOTCONNECT. That may cause trouble with DHCP, considering the wifi lib often reaches that state spontaneously in the middle of association.
Given that in the case of connection failure you block in a while(1), you lose nothing if instead you keep querying the lib to see if the state has changed.
_________________
http://akzeac.blogspot.com
#98677 - bjoerngiesler - Wed Aug 16, 2006 10:53 pm
kevinc wrote: |
Given that in the case of connection failure you block in a while(1), you lose nothing if instead you keep querying the lib to see if the state has changed. |
Good advice. Thanks!
#98682 - TheRain - Wed Aug 16, 2006 11:09 pm
My FTP client gets no response from a list command and it keeps timing out. I'm using FileZilla, and my flash device is an M3 SD version.
_________________
DSMIDI and dSTAR sequencer brought to you by TheRain
http://www.collinmeyermusic.com/dev/
#98692 - doedill - Thu Aug 17, 2006 12:07 am
is it possible to rename the DATA folder to something else?
There's a huge conflict with DSOrganize, where DSOrganize thinks that the DATA file is it's own and assumes that other folders/files are missing. There by creating all the required folders/files into the Root directory as well as the DATA folder.
#98744 - bjoerngiesler - Thu Aug 17, 2006 6:33 am
TheRain wrote: |
My FTP client gets no response from a list command and it keeps timing out. I'm using FileZilla, and my flash device is an M3 SD version. |
Please mail me your log and ftp.conf files. Thanks.
#98746 - bjoerngiesler - Thu Aug 17, 2006 6:40 am
doedill wrote: |
There's a huge conflict with DSOrganize, where DSOrganize thinks that the DATA file is it's own and assumes that other folders/files are missing. There by creating all the required folders/files into the Root directory as well as the DATA folder. |
First, what version of DSOrganize are you using? I have 2.2p1, and it found the /data and created its own DSOrganize tree underneath it. So now I have a /data/DSOrganize, which is the way it should be.
Second, if DSOrganize thinks a "/data" is its own, that seems like a DSOrganize bug to me.. which is fixed by now, as it seems.
Third, you have the source code. Having the config file somewhere else is one edit (BController.cpp) and one make away.
The "/data" thing stems from this discussion: http://forum.gbadev.org/viewtopic.php?t=10648&highlight=.
EDIT: Please see this post by DragonMinded: http://forum.gbadev.org/viewtopic.php?p=98760#98760 In there, he states that DSOrganize handles the "/data" directory correctly, which fits with my experience.
#98892 - toa - Fri Aug 18, 2006 9:35 am
bjoerngiesler wrote: |
This means that during development, you can run and test your program, then build a new version of it and upload it to the DS and run it without touching another button, and most important of all, without removing the flash card.
Have fun! |
That is SO F#?%?NG cool, best developer tool I've come across on this little maschine yet! Now all we need is a wifi-based debugger and Nitendo can throw their dev-kits in the dumpster faster than you can say "it's meeee Marrioooo" :-)
#98911 - Durandle - Fri Aug 18, 2006 1:59 pm
Doesn't this also open up sending a file from one DS to another - given we have a FTP client on one DS and ther server on the other?
Cos that'd be rather cool. Say for example, DSOrganiser could have the server and client. You play music on your DS, but can also share the music with other people :)
#98918 - JaJa - Fri Aug 18, 2006 2:30 pm
Yes, but not directly.
DSs still can't do ad-hoc.
One DS would have to become an AP for thos to happen, or have to go through a regular AP, much like now.
_________________
LAWL HOOGE
My Blog
#98919 - bjoerngiesler - Fri Aug 18, 2006 2:34 pm
Durandle wrote: |
Doesn't this also open up sending a file from one DS to another - given we have a FTP client on one DS and ther server on the other? |
A FTP client software component is in the works :-)
#98921 - MechaBouncer - Fri Aug 18, 2006 3:11 pm
So, in theory, we could have one in server mode, then one in client mode to transfer data between them? But would they have to switch modes to send data the other way? Or could an application just be written to continuously upload the necessary info from the client DS to the server DS, and then the client would also download the specific information it needs? And can this access memory, or just flashcarts/flash memory adapters? This would be an awesome workaround for ad-hoc if it could! Plus, could it be possible to use this same method for net connections or would things like NAT get in the way? I'm guessing it would probably just be easier to use the current method for net play, wouldn't it?
_________________
Cobalt/Black NDSL
CycloDS Evolution (firmware 1.55 BETA 3) and EZFlash 3-in-1
Kingston SD-C02G JAPAN 2GB MicroSD
MoonShell 1.71, DSOrganize 3.1129, QuakeDS Pre3, ScummVM DS 0.11.1, Pocket Physics 0.6, OpenTyrian DS 0.3
#98929 - kevinc - Fri Aug 18, 2006 3:57 pm
Durandle wrote: |
Doesn't this also open up sending a file from one DS to another - given we have a FTP client on one DS and ther server on the other? |
You don't need a DS FTP client for that, just 2 FTP servers that can do passive and active mode.
You put one into passive, and store the IP and port that it gives you. Then you set the other to active, setting the PORT parameters to the IP and port of the first server. Then just do RETR to the first, and STOR to the second from the computer client.
_________________
http://akzeac.blogspot.com
#98933 - tekknosk8er - Fri Aug 18, 2006 4:30 pm
bjoerngiesler wrote: |
Durandle wrote: | Doesn't this also open up sending a file from one DS to another - given we have a FTP client on one DS and ther server on the other? |
A FTP client software component is in the works :-) |
Correct me if I am wrong, but if you are running a FTP client on one DS and FTP server on the other DS, you still have to use a normal WIFI connection to a WIFI router to communicate. right? Or can you directly FTP between 2 DSs independently?
Is it possible to use the WFC to FTP across? Also enabling communication across the internet.
My thoughts are if you are still having to use a router to connect the two DSs together, you can use an FTP program like Ip switch WS_FTP professional 7 to transfer files between 2 clients now, using the PC as a bridge.
#98973 - bjoerngiesler - Fri Aug 18, 2006 9:01 pm
tekknosk8er wrote: |
Correct me if I am wrong, but if you are running a FTP client on one DS and FTP server on the other DS, you still have to use a normal WIFI connection to a WIFI router to communicate. right? |
Right. As has been said earlier in this thread, DSWifi doesn't do ad-hoc mode yet. So theoretically, in all cases in which you can use DSWifi, you could also use a PC to route between two DSs. I'd find it much nicer to be able to let them communicate directly, though.
#99531 - mattt - Tue Aug 22, 2006 9:14 am
hello
i've sent you a PM regarding port assignation problem
is it possible to define a specific port to use in the ftp.conf file ? i'm sure yes
woops sorry forget to specify my hardware
i'm using a DS(fat) SE mariokart wityh flashme7 FW
and SC CF 1.63b firwmare
#99548 - bjoerngiesler - Tue Aug 22, 2006 10:58 am
mattt wrote: |
hello
i've sent you a PM regarding port assignation problem
is it possible to define a specific port to use in the ftp.conf file ? i'm sure yes
woops sorry forget to specify my hardware
i'm using a DS(fat) SE mariokart wityh flashme7 FW
and SC CF 1.63b firwmare |
No, up to 1.9 it's not possible to change the port the FTP server listens on. Please wait for the next version (hopefully tonight).
#99550 - mattt - Tue Aug 22, 2006 11:24 am
well, i'll try with ver 1.8 then
what could be the commandeline ? "listen 3000" ??
#99553 - bjoerngiesler - Tue Aug 22, 2006 11:29 am
mattt wrote: |
well, i'll try with ver 1.8 then
what could be the commandeline ? "listen 3000" ?? |
Version 2.0, rather :-) The command will be something of that kind, but I'm not quite sure yet.
_________________
DSFTP homepage
#99560 - mattt - Tue Aug 22, 2006 12:31 pm
that's nice, you are awesome
i hope having guyz like you in my job, when request a change for bug or other, took 6 mounths to change a command line -_-
#99623 - bjoerngiesler - Tue Aug 22, 2006 7:06 pm
Please try http://giesler.biz/~bjoern/downloads/dsftp/DSFTP-2.0pre.zip. Changes are:
o Server port configurable with "listen PORTNUM"
o Passive mode supported (PORT and EPRT commands)
...and let me know if that works for you.
_________________
DSFTP homepage
#99728 - mattt - Wed Aug 23, 2006 4:35 pm
unfortunately blocked on "ititialyse"
evenif i've added line "listen PORTNUMBER" or not
that's pretty strange
also because do not initialyse, have nothing in the log file :-/
#99730 - bjoerngiesler - Wed Aug 23, 2006 4:44 pm
mattt wrote: |
unfortunately blocked on "ititialyse"
evenif i've added line "listen PORTNUMBER" or not
that's pretty strange
also because do not initialyse, have nothing in the log file :-/ |
If it blocks on Initialize, that means it can't connect to your Wifi... :-/
EDIT: No, sorry, that's wrong; it either means you're on SuperCard Lite and haven't run the thing through the homebrew patcher, or I made some stupid mistake...
_________________
DSFTP homepage
#99736 - mattt - Wed Aug 23, 2006 5:44 pm
well, i have a DS fat and DSlite both running flashme V7 and Supercard CF with update 1.63b
the same that runs correctly dsftp 1.9 ...
#99954 - mattt - Thu Aug 24, 2006 10:31 pm
ok well, i've installed on another CF card because i've checked other homebrew weren't working ...
it's up and running, on screen see "listen port xxx"
but still cannot connect
for sure it's a internal routing problem
i'll check my side, anyway thank you for the additionnal feat. of port listen ;)