Ligne 156 : |
Ligne 156 : |
| | | |
| == Exemple WebClient == | | == Exemple WebClient == |
| + | Une fois l'adresse IP obtenue, vous pouvez vous connecter sur un site (Adafruit par exmple) et lire + afficher le contenu d'une page web. |
| | | |
− | Once you're got the IP address you can connect to adafruit, for example, and read a webpage and print it out:
| + | Saisissez le code suivant: |
| | | |
| <nowiki>sk=net.createConnection(net.TCP, 0) | | <nowiki>sk=net.createConnection(net.TCP, 0) |
Ligne 165 : |
Ligne 166 : |
| </nowiki> | | </nowiki> |
| | | |
− | You can also have the module do DNS for you, just give it the hostname instead of IP address:
| + | Vous pouvez également demander au module de faire une résolution DNS pour vous. Il suffit de lui communiquer le nom de l'hôte (''hostname'') à la place de l'adresse IP: |
| + | |
| + | Saisissez le code suivant: |
| | | |
| <nowiki>sk=net.createConnection(net.TCP, 0) | | <nowiki>sk=net.createConnection(net.TCP, 0) |
Ligne 172 : |
Ligne 175 : |
| sk:send("GET /testwifi/index.html HTTP/1.1\r\nHost: www.adafruit.com\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n")</nowiki> | | sk:send("GET /testwifi/index.html HTTP/1.1\r\nHost: www.adafruit.com\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n")</nowiki> |
| | | |
− | This is just a light overview of testing out your HUZZAH ESP breakout! For much more, check out NodeMCU's tutorial page [https://github.com/nodemcu/nodemcu-firmware/wiki/nodemcu_api_en https://github.com/nodemcu/nodemcu-firmware/wiki/nodemcu_api_en] for the details on what functions are available to you, as well as [http://www.lua.org/ http://www.lua.org] to learn more about the Lua scripting language
| + | Voici qui termine cette petite introduction (et tests) deu breakout ESP8266 / Feather ESP8266! |
| + | |
| + | Pour plus d'information, voyez la page du tutoriel NodeMCU sur [https://github.com/nodemcu/nodemcu-firmware/wiki/nodemcu_api_en https://github.com/nodemcu/nodemcu-firmware/wiki/nodemcu_api_en]. Vous y obtiendrez de nombreux détails sur les fonctions disponibles. Vous pouvez également consulter le lien [http://www.lua.org/ http://www.lua.org] pour en apprendre plus sur le langage de scripting Lua. |
| + | |
| {{FEATHER-ESP8266-TRAILER}} | | {{FEATHER-ESP8266-TRAILER}} |