Modifications

Sauter à la navigation Sauter à la recherche
1 074 octets ajoutés ,  12 novembre 2016 à 19:28
aucun résumé de modification
Ligne 1 : Ligne 1 :  
{{FEATHER-WEBREPL-NAV}}
 
{{FEATHER-WEBREPL-NAV}}
   −
{{traduction}}
+
== Introduction ==
 +
Une des fonctionnalités pratique de WebREPL est qu'il est possible d'envoyer un fichier vers le système de fichier de la carte. Vous pouvez également prendre un fichier présent sur la carte. [[FEATHER-CHARGER-FICHIER-MICROPYTHON|Des outils comme ampy peuvent envoyer et recevoir des fichiers via la REPL série]] mais accéder à des fichier via WebREPL peut s'avérer très pratique.
   −
One handy feature of the WebREPL is that it can send and get files from the board's filesystem. [[FEATHER-CHARGER-FICHIER-MICROPYTHON|Tools like ampy can send and get files over the serial REPL]] too, but accessing files over the WebREPL can sometimes be more convenient.
+
Gardez à l'esprit que l'accès fichier WebREPL reste élémentaire et ne permet pas de téléverser un fichier à une localisation précise du système de fichier (il n'est pas possible d'accéder aux sous-répertoire, seule les opérations sur la racine du système de fichier sont autorisés). Vous aurez besoin [[FEATHER-CHARGER-FICHIER-MICROPYTHON|d'utiliser d'autres outils]] pour charger des fichiers à d'autres emplacements du système de fichier.
   −
Be aware file access using the WebREPL is very simple and doesn't allow uploading to specific locations on the filesystem (everything is uploaded to the root). You'll need to [[FEATHER-CHARGER-FICHIER-MICROPYTHON|use other tools]] to put files in different locations.
+
Pour utiliser les fonctionnalités fichiers, vous devez d'abord vous connecter en WebREPL sur votre carte ESP8266. Notez le bloc sur la droite de WebREPL qui permet d'accéder aux opérations de fichier:
   −
To use the file features of the WebREPL first connect to the board's WebREPL. Then notice the file operation block on the right of the WebREPL:
+
{{ADFImage|FEATHER-WEBREPL-FICHIERS-00.png}}
   −
{{ADFImage|FEATHER-WEBREPL-FICHIERS-00.png}}
+
== Envoi de fichier ==
   −
To upload a file click '''Choose File''' and select the file. Notice the page will show you the size of the file.
+
Pour téléverser un fichier sur la carte, cliquez sur le bouton '''Choose File''' et sélectionnez le fichier à envoyer. Notez que la page présente la taille du fichier.
    
{{ADFImage|FEATHER-WEBREPL-FICHIERS-01.png}}
 
{{ADFImage|FEATHER-WEBREPL-FICHIERS-01.png}}
   −
Click '''Send to Device''' to initiate the upload. Once finished the file operation status should show all the data was uploaded to the board.
+
Cliquez sur le bouton '''Send to Device''' pour commencer le téléversement vers la carte. Une fois l'opération terminée, la zone de statut "''(File operation status)''" indique que toutes les informations ont étés envoyées sur la carte avec le message "''Sent test.py, xxx bytes''".
    +
== Télécharger un fichier ==
 
{{ADFImage|FEATHER-WEBREPL-FICHIERS-02.png}}
 
{{ADFImage|FEATHER-WEBREPL-FICHIERS-02.png}}
   −
To download a file from the filesystem just enter the name or path to the file in the '''Get a file''' box.  Then click '''Get from device''' and the file should be downloaded through the browser to your computer.
+
Pour télécharger un fichier depuis la carte, il suffit d'entrer le nom du fichier dans la zone de saisie à côté du texte '''Get a file''' puis de cliquer sur le bouton '''Get from device''' (''prendre du périphérique'') pour que le fichier soit téléchargé dans votre navigateur Internet.
    
{{ADFImage|FEATHER-WEBREPL-FICHIERS-03.png}}
 
{{ADFImage|FEATHER-WEBREPL-FICHIERS-03.png}}
 +
 +
== Lister les fichiers ==
 +
Tout cela c'est bien beau... mais comment connaître la liste des fichiers présent sur la carte ESP8266 ?
 +
 +
Pour cela, il suffit de saisir les commandes suivantes dans WebREPL
 +
 +
<syntaxhighlight lang="python">
 +
import os
 +
os.listdir()
 +
</syntaxhighlight>
 +
 +
Ce qui produira le résultat suivant:
 +
 +
[[Fichier:FEATHER-WEBREPL-FICHIERS-10.jpg]]
    
{{FEATHER-WEBREPL-TRAILER}}
 
{{FEATHER-WEBREPL-TRAILER}}
29 918

modifications

Menu de navigation