Ligne 1 : |
Ligne 1 : |
| {{FEATHER-ESP8266-NAV}} | | {{FEATHER-ESP8266-NAV}} |
− |
| |
− | {{traduction}}
| |
| | | |
| == Préambule == | | == Préambule == |
Ligne 37 : |
Ligne 35 : |
| | | |
| == Configurer le support ESP8266 == | | == Configurer le support ESP8266 == |
− | When you've restarted, select '''Generic ESP8266 Module''' from the Tools->Board dropdown
| + | Après avoir redémarré votre Arduino IDE, sélectionnez la carte '''Generic ESP8266 Module''' dans le menu '''Outils -> Carte''' (''Tools->Board'') |
| | | |
| {{ADFImage|FEATHER-ESP8266-Config-Arduino-IDE-10.png|640px}} | | {{ADFImage|FEATHER-ESP8266-Config-Arduino-IDE-10.png|640px}} |
| | | |
− | 80 MHz as the CPU frequency | + | 80 MHz comme fréquence pour le CPU |
| | | |
| {{ADFImage|FEATHER-ESP8266-Config-Arduino-IDE-11.png|640px}} | | {{ADFImage|FEATHER-ESP8266-Config-Arduino-IDE-11.png|640px}} |
| | | |
− | 115200 baud upload speed (You can also try faster baud rates, we were able to upload at a blistering 921600 baud but sometimes it fails & you have to retry) | + | 115200 baud comme vitesse de téléversement (''upload speed'', vous pouvez essayer des débits plus élevés... cela fonctionne jusqu'à 921600 baud même si cela échoue de temps à autre à une telle vitesse). |
| | | |
| {{ADFImage|FEATHER-ESP8266-Config-Arduino-IDE-12.png|640px}} | | {{ADFImage|FEATHER-ESP8266-Config-Arduino-IDE-12.png|640px}} |
| | | |
− | The matching COM port for your FTDI or USB-Serial cable
| + | Sélectionnez le port COM correspondant à la connexion série du Feather (ou votre convertisseur FTDI ou câble USB-Série) |
| | | |
| {{ADFImage|FEATHER-ESP8266-Config-Arduino-IDE-13.png|640px}} | | {{ADFImage|FEATHER-ESP8266-Config-Arduino-IDE-13.png|640px}} |
| | | |
− | and '''nodemcu''' as the reset method
| + | et '''nodemcu''' comme méthode de réinitialisation (''reset method'') |
| | | |
| {{ADFImage|FEATHER-ESP8266-Config-Arduino-IDE-14.png|640px}} | | {{ADFImage|FEATHER-ESP8266-Config-Arduino-IDE-14.png|640px}} |
| | | |
− | Check also that you have
| + | Verifiez maintenant votre paramétrage, vous devriez avoir: |
| * '''Flash Mode''' : QIO | | * '''Flash Mode''' : QIO |
| * '''Flash Frequency''' : 40MHz | | * '''Flash Frequency''' : 40MHz |
Ligne 66 : |
Ligne 64 : |
| | | |
| == Exemple Blink == | | == Exemple Blink == |
− | We'll begin with the simple blink test
| + | Nous allons commencer par un exemple simple: "Blink" (faire clignoter une LED) |
| | | |
− | Enter this into the sketch window (and save since you'll have to)
| + | Saisissez le croquis/sketch suivant dans une fenêtre (et sauvez le puisque cela est nécessaire) |
| | | |
| <nowiki>void setup() { | | <nowiki>void setup() { |
Ligne 81 : |
Ligne 79 : |
| }</nowiki> | | }</nowiki> |
| | | |
− | Now you can simply upload! The '''Feather HUZZAH''' has built in auto-reset that puts it into bootloading mode automagically
| + | Vous pouvez maintenant le téléverser! Le '''Feather HUZZAH''' intègre une fonctionnalité ''auto-reset'' qui active le mode bootloader automatiquement. |
| | | |
| {{ADFImage|FEATHER-ESP8266-Config-Arduino-IDE-20.png|640px}} | | {{ADFImage|FEATHER-ESP8266-Config-Arduino-IDE-20.png|640px}} |
| | | |
− | The sketch will start immediately - you'll see the LED blinking. Hooray!
| + | Le croquis démarre immédiatement - vous devriez voir la LED clignoter. Hourra! |
| | | |
| == Se connecter en WiFi == | | == Se connecter en WiFi == |
− | OK once you've got the LED blinking, lets go straight to the fun part, connecting to a webserver. Create a new sketch with this code:
| + | Maintenant que nous avons réussit à faire clignoter une LED, nous devrions nous pencher sur ces choses vraiment amusantes, nous connecter sur un Serveur Web. |
| | | |
− | <nowiki> /* | + | Créez un nouveau croquis avec le code suivant: |
− | * Simple HTTP get webclient test | + | |
| + | <nowiki>/* |
| + | * Test WebClient - simple requete HTTP (get) |
| */ | | */ |
| | | |
| #include <ESP8266WiFi.h> | | #include <ESP8266WiFi.h> |
| | | |
− | const char* ssid = "yourssid"; | + | const char* ssid = "votre_ssid"; |
− | const char* password = "yourpassword"; | + | const char* password = "votre_mot_de_passe"; |
| | | |
| const char* host = "www.adafruit.com"; | | const char* host = "www.adafruit.com"; |
Ligne 105 : |
Ligne 105 : |
| delay(100); | | delay(100); |
| | | |
− | // We start by connecting to a WiFi network | + | // Commencons par nous connecter sur le reseau WiFi |
| | | |
| Serial.println(); | | Serial.println(); |
| Serial.println(); | | Serial.println(); |
− | Serial.print("Connecting to "); | + | Serial.print("Connexion sur "); |
| Serial.println(ssid); | | Serial.println(ssid); |
| | | |
Ligne 120 : |
Ligne 120 : |
| | | |
| Serial.println(""); | | Serial.println(""); |
− | Serial.println("WiFi connected"); | + | Serial.println("WiFi connecté"); |
− | Serial.println("IP address: "); | + | Serial.println("adresse IP: "); |
| Serial.println(WiFi.localIP()); | | Serial.println(WiFi.localIP()); |
| } | | } |
Ligne 131 : |
Ligne 131 : |
| ++value; | | ++value; |
| | | |
− | Serial.print("connecting to "); | + | Serial.print("connexion sur "); |
| Serial.println(host); | | Serial.println(host); |
| | | |
− | // Use WiFiClient class to create TCP connections | + | // Utiliser la classe WiFiClient pour |
| + | // creer une connexion TCP |
| WiFiClient client; | | WiFiClient client; |
| const int httpPort = 80; | | const int httpPort = 80; |
| if (!client.connect(host, httpPort)) { | | if (!client.connect(host, httpPort)) { |
− | Serial.println("connection failed"); | + | Serial.println("Echec connexion"); |
| return; | | return; |
| } | | } |
| | | |
− | // We now create a URI for the request | + | // Créer une URI pour la requete |
| String url = "/testwifi/index.html"; | | String url = "/testwifi/index.html"; |
− | Serial.print("Requesting URL: "); | + | Serial.print("Requete de l URL: "); |
| Serial.println(url); | | Serial.println(url); |
| | | |
− | // This will send the request to the server | + | // Cela envoi la requête vers le serveur |
| client.print(String("GET ") + url + " HTTP/1.1\r\n" + | | client.print(String("GET ") + url + " HTTP/1.1\r\n" + |
| "Host: " + host + "\r\n" + | | "Host: " + host + "\r\n" + |
Ligne 153 : |
Ligne 154 : |
| delay(500); | | delay(500); |
| | | |
− | // Read all the lines of the reply from server and print them to Serial | + | // Lire toutes les lignes de la réponse |
| + | // renvoyée par le serveur. |
| + | // Afficher toutes les signes sur la connexion serie |
| while(client.available()){ | | while(client.available()){ |
| String line = client.readStringUntil('\r'); | | String line = client.readStringUntil('\r'); |
Ligne 160 : |
Ligne 163 : |
| | | |
| Serial.println(); | | Serial.println(); |
− | Serial.println("closing connection"); | + | Serial.println("Fermeture de la connexion"); |
| }</nowiki> | | }</nowiki> |
| | | |
− | Dont forget to update
| + | N'oubliez pas de mentionner l'identifiant de votre connexion WiFi |
| + | |
| + | <nowiki>const char* ssid = "votre_ssid"; |
| + | const char* password = "votre_mot_de_passe";</nowiki> |
| | | |
− | <nowiki>const char* ssid = "yourssid";
| + | ''votre_ssid'' est l'identifiant de votre point d'accès (modem WiFi) et ''votre_mot_de_passe'' le mot de passe de votre connexion WiFi. |
− | const char* password = "yourpassword";</nowiki>
| |
| | | |
− | to your access point and password, then upload the same way: get into bootload mode, then upload code via IDE
| + | Faites votre téléchargement comme pour l'exemple "Blink". |
| | | |
| {{ADFImage|FEATHER-ESP8266-Config-Arduino-IDE-30.png|640px}} | | {{ADFImage|FEATHER-ESP8266-Config-Arduino-IDE-30.png|640px}} |
| | | |
− | Open up the IDE serial console at 115200 baud to see the connection and webpage printout!
| + | Ouvrez le terminal série de votre environnement Arduino IDE (connexion à 115200 baud) pour voir la connexion s'établir... et l'affichage du contenu de la page Web! |
| | | |
| {{ADFImage|FEATHER-ESP8266-Config-Arduino-IDE-31.png|640px}} | | {{ADFImage|FEATHER-ESP8266-Config-Arduino-IDE-31.png|640px}} |
| | | |
− | That's it, pretty easy!
| + | C'est simple comme tout! |
| | | |
− | This page was just to get you started and test out your module. For more information, check out le [https://github.com/esp8266/Arduino dépôt GitHub de l'ESP8266] for much more up-to-date documentation!
| + | L'appel de cette page était juste un point de départ pour tester votre module. Voyez le [https://github.com/esp8266/Arduino dépôt GitHub de l'ESP8266] pour plus de documentation! |
| | | |
| | | |
| {{FEATHER-ESP8266-TRAILER}} | | {{FEATHER-ESP8266-TRAILER}} |