IPB

Benvenuto Visitatore ( Log In | Registrati )

Seguici su:    
> [GUIDA] Guida all'uso del DSFTP
Nemo_DS
messaggio Saturday 25 November 2006 - 19:11
Messaggio #1

Who cares?
Gruppo icone

Gruppo: Membri
Messaggi: 4.803
Iscritto il: Wed 15 February 2006 - 15:53
Da: Se vuoi venire a trovarci, scambiare due chiacchiere, o mandarci a quel paese: Azzurra - #gbarl.it :P
Utente Nr.: 10.478
Feedback: 9 (100%)




Saluti a lor signori!
Visto che oggi ho un pò di tempo libero e un pò di voglia per farlo, abbozzerò una guida su come usare il DSFTP, noto programma che ci permette di passare qual si voglia file sulla nostra flashcard, senza togliere il nostro supporto (la SD , ad esempio ) dall'interno della flashcard! smile.gif
Una bella comodità, nevvero? smile.gif

Ebbene, ciò di cui necessitiamo:Il primo passaggio da fare, è quello di portare su DS il nostro homebrew. Questa volta, saremo costretti ad usare un lettore di SD o per il supporto che avete...tongue.gif
Anyway, per gli SC users, consiglio di prendere il file ds.gba, rinominarlo in sc.nds, e di usare quello. Ora, il DSFTP legge le sue impostazioni da un file di configurazione , che deve esistere in /data/settings/ftp.conf. Gli utenti che si loggano al DS, devono essere definiti in questo file, dato che non ci sono user di default, già integrati nel codice.

Ecco un esempio di file ftp.conf:
CODICE
  motd /ftp/motd.txt
  logfile /data/logs/ftp.log
  loglevel 4
  timeout 60
  portrangestart 9000
  portrangeend 9999

  screensaver 30
  wakeonlog false

  user nemo
    pass whatever
    root /
    home /
    write true
    boot true
  end user

  user anonymous
    root /ftp/anonymous
    write false
  end user


Ci sono molte altre opzioni che possono essere settate nel file di configurazione. Tutte queste, le potete trovare nel sito ufficiale ( http://giesler.biz/bjoern/en/sw_dsftp.html ), ma al momento sembra essere down. Dalla cache di google, sono riuscito a recuperare un pò di dati, ed eccoveli serviti:
» Clicca per leggere lo Spoiler! «
Whitespace in the configuration file is ignored (the indents in the example file are purely cosmetic), as are empty lines and lines starting with "#". The following settings are valid:

motd FILE
Defines a file that contains the message of the day, which will be printed on logon.

logfile FILE
Defines the name of a file to store log messages in.

loglevel LEVEL
Only messages with a loglevel below LEVEL will be printed / logged to file. LEVEL ranges from 0 (critical) to 5 (informational).

masquerade NAME
Specifies that the server masquerades as the host NAME. This is very useful if the server is behind a NAT gateway, and its actual IP address is not visible to the world. In this case, for clients using PASV instead of EPSV for the passive mode, the reply to PASV will contain the IP address for NAME, not the actual server's IP.
Note: Do not use this if you're not behind a NAT gateway and the server is not actually reachable under the given name. It won't work.

timeout SECONDS
Specifies that the server will close the data connection after the given period of inactivity. Default is 60 seconds.

portrangestart NUM / portrangeend NUM
Specifies what port range to use for passive connections. If these aren't given, the portrange goes from 1024 to INT_MAX.

screensaver SECONDS
Specifies the timeout for the screen saver. Can also be the string "off", which disables the screen saver altogether. Default is 60 seconds.

wakeonlog BOOL
If this is "true", the screensaver will wake up on every log entry. Default is true.

user NAME
Starts a new user block, which must be finished by "end user". Only users named by a user block will be accepted for login. Exception: If no users at all are specified, a default user and pass are generated automatically and displayed in the log.
Settings valid in the user block are:

pass PASSWORD
Set the password for the current user, stored in cleartext. If the user's name is "anonymous", this will be ignored, and the user will be asked to specify his email address for a password.

root DIR
Restrict the user to the directory hierarchy below DIR.

home DIR
Upon logon, set the current directory to DIR (relative to the user's root dir).

write BOOL
Grant the user write permission (including permission to rename and delete!) for everything below his root dir.

boot BOOL
Grant the user permission to boot files and to power down the DS.

Protocol Additions
DSFTP defines the additional command "BOOT", with the filename to be booted as an argument. Since the "BOOT" command is not in the official protocol, the FTP client doesn't know it. For text-based ftp, the "quote" prefix allows you to send it anyway, like this:

quote BOOT /mydsfile.nds

Possible reply codes to the BOOT command are 530 (No permission to boot) and 250 (Booting file). Booting currently only works on Supercard CF. No checks are performed; it is legal to boot a ".txt" file, which will most likely crash your DS. On a successful boot, the data connection to the client is closed. Since booting doesn't return on success, a success message is always printed. If the file to boot could not be found, nothing is reported to the FTP client, but the connection remains intact.

DSFTP defines the additional command "POWR", which can be used to power the DS off. Possible reply codes are 530 (No permission to power off) and 250 (Powering off). DSFTP defines the additional command "UNZP" to uncompress files compressed with GNU zip. Usage is: quote UNZP /zipfile.gz

This will create a file named /zipfile (without the .gz ending). The original, zipped file will not be removed. Possible reply codes are 530 (Unable to open file or error unpacking) and 226 (unpacking succeeded.
Using DSFTP for development
This section describes how you can use libDSFTP to add an FTP server to your own applications. For all of these steps, you can use the included source for DSFTP as an example.
Preliminaries
Adding an FTP server is very easy. First, you should make sure that the following components are added to your build process. That means their include files must be accessible, and their libraries/object files must be linked with your program.

* gba_nds_fat (either chishm's FAT lib or REIN's)
* dswifi
* libDSFTP

Then, you initialize the Wifi and FAT libraries as usual. Please refer to their respective examples for info on how to do it, or to the DSFTP source.
Creating the server
Next, you create an instance of BFTPServer somewhere in your program, like so:

BFTPServer server;


If you want to, you can also create an instance of BFTPConfigurator to configure the server. This is not mandatory, but it allows you to configure the FTP server via config file. This would look as follows.

BFTPConfigurator configurator(&server);
configurator.configureFromFile("/data/settings/ftp.conf");


...or wherever you want the config file to be.

If you do not use a BFTPConfigurator, you must add users to the FTP server manually. Otherwise, you won't be able to log in. The simplest way to do this is like this:

server.addUser("myusername", "mypassword");


Please refer to BFTPServer.h for other arguments to this command.

Letting it do its work
That's it, your FTP server is ready! Now, whenever your program is idle (e.g. from the main loop), you should let the server do its work, like this:

server.handle();


Wrapping it up
And that's all you have to do. All the code inside of a nice little mainloop function would look like this:

void mainloop(void)
{
BFTPServer server;
BFTPConfigurator configurator(&server);
configurator.configureFromFile("/data/settings/ftp.conf");
while(true)
{
server.handle();
swiWaitForVBlank();
}
}



Please refer to the source code of DSFTP and the header files of libDSFTP for other possible settings and features.
Known Bugs and Limitations
The following bugs and limitations are known at the time of writing:

* Sometimes sockets seem not to be reaped correctly.

If any bugs pop up, please send me the log output with a full description to bjoern@giesler.de. Thank you and have fun!


Possono esservi utili o meno, ma l'esempio sopracitato è più che sufficiente smile.gif
Ecco, ora accendiamo il nostro DS, facciamo partire il nostro DSFTP, e connettiamoci all'AP.
Dovrebbe apparire una schermata, simile a questa:



Una volta connesso l'homebrew, connettiamoci anche dal PC. Per farlo, possiamo usare un qualsiasi client ftp; nel mio caso userò FileZilla, ma uno vale l'altro. Con FileZilla, le impostazioni sono molto semplici:



Come vediamo, basta inserire alla voce "user", l'user che abbiamo inserito nel file ftp.conf, e fare lo stesso per la password. Una volta connesso, il client ci mostrerà le cartelle del nostro DS, e procederemo a cancellare/spostare/rinominare i file che vogliamo.

C'è da dire, che molti utenti anche su siti come dcemu o altri, hanno avuto problemi in quanto non vengono rilevati il file ftp.conf e il file ftp.log, e il DSFTP assegna una psw e un nome user casuale. Inserendoli nella cartella "root:/data/settings/" , comunque, non dovrebbero esserci problemi. Io sto testando il tutto su SCMiniSD, e non ci sono problemi di sorta.

All'atto dello spegnimento, una volta finito, teniamo schiacciati i pulsanti A+B+X+Y, per lo spegnimento sicuro.
Non sarebbe stato eccessivamente difficile usarlo, il DSFTP, ma meglio avere le guide che non averle :


Se avete domande, critiche o altro, ditelo pure smile.gif

Guida scritta da Nemo_DS ; se copiate anche solo in parte la seguente guida, abbiate almeno la compiacenza di linkare questo thread , e di riconoscerne l'autore biggrin.gif
 Go to the top of the page
 
+Quote Post

Inserisci in questo messaggio
- Nemo_DS   [GUIDA] Guida all'uso del DSFTP   Saturday 25 November 2006 - 19:11
- - xitpu   Vorrei aggiungere una nota per i possessori di EZ4...   Saturday 25 November 2006 - 21:50
- - Aurelio   Bella guida nemo. Grazie   Sunday 26 November 2006 - 17:47
- - ateicos   io non riesco, forse perchè ho il router? boh, c...   Monday 27 November 2006 - 17:40
|- - sKoMo   CITAZIONE (ateicos @ Monday 27 November 2006 ...   Friday 9 November 2007 - 12:54
- - DaitarnX   forse fa casino con gli ip strano   Monday 27 November 2006 - 21:19
|- - Criminal90   non mi funziona forze avro sbagliato gli IP   Thursday 28 December 2006 - 01:43
- - koda   ohhb finalmente una guida veloce per la configuraz...   Thursday 28 December 2006 - 14:53
- - kcatta   Ciao, sono nuovo e dopo tante ore passate davanti ...   Tuesday 2 January 2007 - 00:51
- - sardinianguy88   io non ho la più pallida idea di come farlo funzio...   Wednesday 10 January 2007 - 02:22
- - GeniusCode   Mi sembra che nella guida manchi un passaggio fond...   Wednesday 10 January 2007 - 09:03
|- - pablo73   Io sono riuscito a farlo partire, mi riporta anche...   Wednesday 10 January 2007 - 11:07
- - GeniusCode   CITAZIONE (pablo73 @ Wednesday 10 January 200...   Wednesday 10 January 2007 - 11:18
- - pablo73   Ho trovato la soluzione (anche grazie ad un forum ...   Thursday 11 January 2007 - 16:12
|- - zate84   CITAZIONE (pablo73 @ Thursday 11 January 2007...   Tuesday 16 January 2007 - 22:42
||- - fabri22   CITAZIONE (zate84 @ Tuesday 16 January 2007 ...   Wednesday 17 January 2007 - 00:11
||- - zate84   CITAZIONE (fabri22 @ Wednesday 17 January 200...   Wednesday 17 January 2007 - 09:44
|- - Matt3o   [quote name='pablo73' date='Thursday 1...   Tuesday 26 February 2008 - 12:58
- - koda   ma è normale che il trasferimento impieghi tantiss...   Thursday 11 January 2007 - 16:45
|- - Davi92   CITAZIONE (koda @ Thursday 11 January 2007 ...   Tuesday 16 January 2007 - 14:41
- - pablo73   E' molto lento, però per trasferire 3 mega io ...   Thursday 11 January 2007 - 17:23
- - fabio536   io dopo aver creato il file ftp.conf il programma ...   Friday 12 January 2007 - 19:10
- - fabri22   Bella guida nemo ! DSFTP (patchato dldi x la ...   Monday 15 January 2007 - 22:55
|- - zate84   CITAZIONE (fabri22 @ Monday 15 January 2007 ...   Tuesday 16 January 2007 - 15:32
- - BlackTiger   Salve Ragazzi, è da un pò ke bazzico da queste par...   Tuesday 16 January 2007 - 14:34
|- - zate84   CITAZIONE (BlackTiger @ Tuesday 16 January 20...   Tuesday 16 January 2007 - 15:16
|- - Jackinstoon   grazie per la guida funziona a meraviglia!   Thursday 14 February 2008 - 17:42
- - BlackTiger   Ma se io configuro la wifi come rete ad-hoc il ds,...   Tuesday 16 January 2007 - 23:39
|- - zate84   CITAZIONE (BlackTiger @ Tuesday 16 January 20...   Wednesday 17 January 2007 - 09:13
- - BlackTiger   Non ho condiviso la connessione xkè non mi interes...   Wednesday 17 January 2007 - 12:28
|- - zate84   CITAZIONE (BlackTiger @ Wednesday 17 January ...   Wednesday 17 January 2007 - 12:42
- - ness88   Io ho una R4 Revolution, il programma parte, ma no...   Friday 9 March 2007 - 22:15
- - ness88   Ora invece non mi trova il file ftp.log   Tuesday 13 March 2007 - 14:05
|- - supergont   CITAZIONE (ness88 @ Tuesday 13 March 2007 ...   Sunday 18 March 2007 - 11:45
- - FallChallenge   Guida Molto interessante THX.   Saturday 7 April 2007 - 10:33
- - sn0z33r   niente ragazzi non c'e' verso.. il dsftp s...   Friday 13 April 2007 - 15:54
|- - Aurelio   CITAZIONE (sn0z33r @ Friday 13 April 2007 ...   Wednesday 2 May 2007 - 21:39
- - Amon Sul   Io ho provato un po di tutto (ho la chiavetta nin...   Thursday 3 May 2007 - 19:35
- - Amon Sul   certo che per tradurre 2 righe , metterci davanti ...   Wednesday 9 May 2007 - 11:55
|- - scoobydoo   CITAZIONE (Amon Sul @ Wednesday 9 May 2007 ...   Wednesday 9 May 2007 - 12:53
|- - Nemo_DS   CITAZIONE (Amon Sul @ Wednesday 9 May 2007 ...   Wednesday 9 May 2007 - 13:04
|- - scoobydoo   CITAZIONE (Nemo_DS @ Wednesday 9 May 2007 ...   Wednesday 9 May 2007 - 14:38
|- - Nemo_DS   CITAZIONE (scoobydoo @ Wednesday 9 May 2007 ...   Wednesday 9 May 2007 - 14:47
|- - scoobydoo   CITAZIONE (Nemo_DS @ Wednesday 9 May 2007 ...   Wednesday 9 May 2007 - 15:12
- - Shocker   Salve a tutti, sono nuovo del Forum e del mondo DS...   Friday 1 June 2007 - 12:33
- - iljo   domanda idiota: mi posso connettere direttamente a...   Monday 4 June 2007 - 07:34
- - Shocker   Qualcuno mi spiega come si imposta il wireless nel...   Monday 4 June 2007 - 13:22
- - Squall89   scusate, ma come lo trovo l'IP del DS?   Monday 4 June 2007 - 13:48
- - Maya   Molto bello ma: 1. non mi rileva il file di config...   Monday 4 June 2007 - 14:12
- - Shocker   Non capisco perché non vada, su MaroKart riesco a ...   Tuesday 5 June 2007 - 06:43
- - Maya   controlla di avere l'SSID broadcast attivato, ...   Tuesday 5 June 2007 - 06:47
- - Shocker   Avevo la WPA2 e molte altre impostazioni non propr...   Tuesday 5 June 2007 - 07:00
- - Shocker   Ma non mi è chiara una cosa, leggendo nel forum mi...   Tuesday 5 June 2007 - 07:05
- - Maya   Per Brain Training e' un discorso a parte, anc...   Tuesday 5 June 2007 - 08:00
- - Shocker   Wireless SSID Broadcast: Enable Non è proprio qu...   Tuesday 5 June 2007 - 09:35
- - latios 93   salve scuisate ma nn ho capito la guida, il file ...   Sunday 1 July 2007 - 13:30
- - latios 93   nessuno??? vi prego   Tuesday 3 July 2007 - 13:14
- - Maya   si', lo devi creare tu   Tuesday 3 July 2007 - 13:42
|- - latios 93   CITAZIONE (Maya @ Tuesday 3 July 2007 - ...   Tuesday 3 July 2007 - 15:48
- - shiny pidgeotto   Dopo aver fatto funzionare la WFC sul ds, il brows...   Tuesday 3 July 2007 - 13:53
- - latios 93   mi raccomando nn rispondete in troppi...   Wednesday 4 July 2007 - 14:25
- - Maya   Crea un file vuoto e chiamalo ftp.log, mettilo su ...   Wednesday 4 July 2007 - 17:30
|- - latios 93   CITAZIONE (Maya @ Wednesday 4 July 2007 ...   Wednesday 4 July 2007 - 20:47
- - shiny pidgeotto   dove si trova sta cartella "data" ?????   Wednesday 4 July 2007 - 21:34
- - latios 93   la devi creare tu sulla sd   Thursday 5 July 2007 - 08:49
|- - Shocker   Vi è mai successo che durante degli upload sulla m...   Tuesday 31 July 2007 - 14:26
- - Shocker   Vi è mai successo che durante degli upload sulla m...   Tuesday 31 July 2007 - 14:30
|- - Shocker   Per aggiungere informazioni, l'os sull'R4 ...   Tuesday 31 July 2007 - 15:08
||- - Shocker   Possibile che è stabile a tutti tranne che a me ? ...   Thursday 2 August 2007 - 07:43
|- - N0A   CITAZIONE (Shocker @ Tuesday 31 July 2007 ...   Saturday 20 October 2007 - 14:53
|- - DaG   CITAZIONE (N0A @ Saturday 20 October 2007 ...   Sunday 21 October 2007 - 21:15
- - megaleon   Ragazzi, ho un problema. Praticamente DSFTP trova ...   Wednesday 19 September 2007 - 17:37
- - BiLife   Ciao. Porte ed IP sono due cose separate. Ad ogni...   Wednesday 19 September 2007 - 18:07
- - BiLife   Sono stato un po' prolisso ma (tra i miei amic...   Wednesday 19 September 2007 - 18:08
- - megaleon   Non capisco, il DSFTP continua a connettersi saltu...   Friday 21 September 2007 - 15:22
- - Most   Mh strano, sembra andare tutto bene, però quando a...   Tuesday 13 November 2007 - 20:50
- - WIINZE   Dato che il mio router è settato con protezione WP...   Thursday 14 February 2008 - 20:03
|- - Nicolai21   CITAZIONE (WIINZE @ Thursday 14 February 2008...   Saturday 23 February 2008 - 17:03
- - zilmo   ma qual'è l'ip del ds ò.ò   Friday 23 May 2008 - 09:25
- - eclettic   E' l'ip che gli hai dato durante la config...   Friday 23 May 2008 - 10:26
- - Guillotine   Salve, ho una g6 e per portare software su card de...   Tuesday 27 May 2008 - 09:43
- - Most   Usando filezilla non riesco a cancellare files dal...   Friday 20 June 2008 - 21:38
- - Zak3456ces   ragazzi...ho configurato dsftp,ma le velocità di t...   Monday 12 January 2009 - 21:20
- - Goomba93   Bella guida nemo!!!! Mi hai rispar...   Tuesday 10 February 2009 - 19:15
- - Guillotine   anch'io non posso cancellare files, nè su G6 n...   Saturday 7 March 2009 - 15:46
|- - TorettoMilano   CITAZIONE (Guillotine @ Saturday 7 March 2009...   Saturday 7 March 2009 - 16:01
- - vairus88   avrei da farti alcune domande 1) è possibile gioc...   Saturday 28 March 2009 - 17:29
- - Jhyrachy   Io ho un problema, non mi so connette il server ft...   Wednesday 29 April 2009 - 16:16
- - Aurelio   Io non ho problemi, uso un ip statico dato che il ...   Thursday 30 April 2009 - 17:24
- - Jhyrachy   l'ip è gia statico   Thursday 30 April 2009 - 17:31
- - JerryUomoFagiolo   Ci ho provato in tutte le salse, pure col bagnosch...   Sunday 30 August 2009 - 13:25
- - Aurelio   Ma la chiavetta nintendo ha i driver modificati?Al...   Sunday 30 August 2009 - 14:00
- - JerryUomoFagiolo   no la chiavetta non ha driver modificati, ma devo ...   Sunday 30 August 2009 - 14:06
|- - Aurelio   CITAZIONE (JerryUomoFagiolo @ Sunday 30 Augus...   Sunday 30 August 2009 - 14:17
- - JerryUomoFagiolo   ah, mannaggia! e quando mi connetto per sfide ...   Sunday 30 August 2009 - 14:20
- - RèMarioBoo   mi spiegate come creare il file ftp.conf??? io non...   Tuesday 8 September 2009 - 12:20
- - Andrew374   il tuo link essendo fallato ho cercato su google e...   Sunday 8 November 2009 - 17:29
- - exrogerdj   Scusate se riesumo questo topoic...r4 originale......   Thursday 22 July 2010 - 13:47


Reply to this topicStart new topic
1 utenti stanno leggendo questa discussione (1 visitatori e 0 utenti anonimi)
0 utenti:

 

Modalità di visualizzazione: Passa a: Normale · Passa a: Lineare · Outline


RSS Versione Lo-Fi Oggi è il: Sun 28 April 2024- 12:52

.: GBArl.it :. Copyright © 2003-2020, All Rights Reserved.
Loghi, documenti e immagini contenuti in questo Sito appartengono ai rispettivi proprietari,
e sono resi pubblici sotto licenza Creative Commons

Creative Commons License
.::.