{"id":3686,"date":"2024-06-24T14:52:09","date_gmt":"2024-06-24T12:52:09","guid":{"rendered":"https:\/\/www.domotic.phdata.fr\/domotic\/?p=3686"},"modified":"2024-06-24T15:30:35","modified_gmt":"2024-06-24T13:30:35","slug":"librairies-pour-le-wifi-mqtt","status":"publish","type":"post","link":"https:\/\/www.domotic.phdata.fr\/domotic\/librairies-pour-le-wifi-mqtt\/","title":{"rendered":"Librairies pour le wifi &amp; MQTT"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"3686\" class=\"elementor elementor-3686\">\n\t\t\t\t\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#include <WiFi.h>\n#include <AsyncTCP.h>\n#include <ESPAsyncWebServer.h>\n\nconst char* ssid = \"Votre_SSID\";\nconst char* password = \"Votre_Mot_de_passe\";\n\nAsyncWebServer server(80);\n\nvoid setup() {\n  Serial.begin(115200);\n  WiFi.begin(ssid, password);\n\n  while (WiFi.status() != WL_CONNECTED) {\n    delay(1000);\n    Serial.println(\"Connecting to WiFi...\");\n  }\n\n  Serial.println(\"Connected to WiFi\");\n\n  server.on(\"\/\", HTTP_GET, [](AsyncWebServerRequest *request){\n    request->send(200, \"text\/plain\", \"Hello, world\");\n  });\n\n  server.begin();\n}\n\nvoid loop() {\n  \/\/ Code principal\n}\n\n\n<\/pre>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2666977 elementor-widget elementor-widget-heading\" data-id=\"2666977\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Pour ESP8266 :<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-901612d elementor-widget elementor-widget-text-editor\" data-id=\"901612d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#include <ESP8266WiFi.h>\n#include <ESPAsyncTCP.h>\n#include <ESPAsyncWebServer.h>\n\nconst char* ssid = \"Votre_SSID\";\nconst char* password = \"Votre_Mot_de_passe\";\n\nAsyncWebServer server(80);\n\nvoid setup() {\n  Serial.begin(115200);\n  WiFi.begin(ssid, password);\n\n  while (WiFi.status() != WL_CONNECTED) {\n    delay(1000);\n    Serial.println(\"Connecting to WiFi...\");\n  }\n\n  Serial.println(\"Connected to WiFi\");\n\n  server.on(\"\/\", HTTP_GET, [](AsyncWebServerRequest *request){\n    request->send(200, \"text\/plain\", \"Hello, world\");\n  });\n\n  server.begin();\n}\n\nvoid loop() {\n  \/\/ Code principal\n}\n\n\n<\/pre>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-b4f5bd7 e-flex e-con-boxed e-con e-parent\" data-id=\"b4f5bd7\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-3eede9b elementor-widget elementor-widget-text-editor\" data-id=\"3eede9b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<span style=\"color: #000000;\"><strong>Conclusion<\/strong><\/span>\n\nLes biblioth\u00e8ques <span style=\"text-decoration: underline;\"><code>ESPAsyncTCP.h<\/code><\/span> et <span style=\"text-decoration: underline;\"><code>ESPAsyncWebServer.h<\/code> <\/span>fonctionnent sur les deux plateformes, ESP32 et ESP8266, mais vous devez vous assurer d&rsquo;inclure et d&rsquo;utiliser les bonnes versions de <code>AsyncTCP<\/code> ou <code>ESPAsyncTCP<\/code> selon la plateforme sur laquelle vous travaillez.\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-51f9f013 e-flex e-con-boxed e-con e-parent\" data-id=\"51f9f013\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-2c0a4a61 elementor-view-default elementor-widget elementor-widget-icon\" data-id=\"2c0a4a61\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"icon.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-icon-wrapper\">\n\t\t\t<a class=\"elementor-icon\" href=\"#menu\">\n\t\t\t<i aria-hidden=\"true\" class=\"fas fa-arrow-up\"><\/i>\t\t\t<\/a>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-1e2c828d e-flex e-con-boxed e-con e-parent\" data-id=\"1e2c828d\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-1b726e95 elementor-widget elementor-widget-text-editor\" data-id=\"1b726e95\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"2509\" class=\"elementor elementor-2509\">\n\t\t\t\t<div class=\"elementor-element elementor-element-dc37c4c e-flex e-con-boxed e-con e-parent\" data-id=\"dc37c4c\" data-element_type=\"container\" data-e-type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;gradient&quot;}\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-31250bc elementor-widget elementor-widget-image\" data-id=\"31250bc\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"1000\" height=\"140\" src=\"https:\/\/www.domotic.phdata.fr\/domotic\/wp-content\/uploads\/2024\/06\/pied-de-page.webp\" class=\"attachment-large size-large wp-image-3167\" alt=\"\" srcset=\"https:\/\/www.domotic.phdata.fr\/domotic\/wp-content\/uploads\/2024\/06\/pied-de-page.webp 1000w, https:\/\/www.domotic.phdata.fr\/domotic\/wp-content\/uploads\/2024\/06\/pied-de-page-300x42.webp 300w, https:\/\/www.domotic.phdata.fr\/domotic\/wp-content\/uploads\/2024\/06\/pied-de-page-768x108.webp 768w, https:\/\/www.domotic.phdata.fr\/domotic\/wp-content\/uploads\/2024\/06\/pied-de-page-150x21.webp 150w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-da41007 elementor-widget elementor-widget-text-editor\" data-id=\"da41007\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p style=\"text-align: center;\"><strong>Domotique &#8211; informatique &#8211; \u00e9lectronique &#8211; dictionnaire &#8211; projets<\/strong><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8a0e2d2 elementor-widget elementor-widget-text-editor\" data-id=\"8a0e2d2\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Copyright 2024<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-1ab3127f e-flex e-con-boxed e-con e-parent\" data-id=\"1ab3127f\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-3bcc6cba elementor-widget elementor-widget-image\" data-id=\"3bcc6cba\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"228\" height=\"205\" src=\"https:\/\/www.domotic.phdata.fr\/domotic\/wp-content\/uploads\/2024\/06\/image-wifi.webp\" class=\"attachment-large size-large wp-image-3715\" alt=\"\" srcset=\"https:\/\/www.domotic.phdata.fr\/domotic\/wp-content\/uploads\/2024\/06\/image-wifi.webp 228w, https:\/\/www.domotic.phdata.fr\/domotic\/wp-content\/uploads\/2024\/06\/image-wifi-150x135.webp 150w\" sizes=\"(max-width: 228px) 100vw, 228px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7cd95867 elementor-widget elementor-widget-menu-anchor\" data-id=\"7cd95867\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"menu-anchor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-menu-anchor\" id=\"menu\"><\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-2f60c87c e-flex e-con-boxed e-con e-parent\" data-id=\"2f60c87c\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-1f6dea50 elementor-widget elementor-widget-text-editor\" data-id=\"1f6dea50\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-12679334 e-flex e-con-boxed e-con e-parent\" data-id=\"12679334\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t<div class=\"elementor-element elementor-element-68769229 e-con-full e-flex e-con e-child\" data-id=\"68769229\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-6fa71248 elementor-widget elementor-widget-image\" data-id=\"6fa71248\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"280\" height=\"280\" src=\"https:\/\/www.domotic.phdata.fr\/domotic\/wp-content\/uploads\/2024\/06\/logo-wifi.webp\" class=\"attachment-large size-large wp-image-3714\" alt=\"\" srcset=\"https:\/\/www.domotic.phdata.fr\/domotic\/wp-content\/uploads\/2024\/06\/logo-wifi.webp 280w, https:\/\/www.domotic.phdata.fr\/domotic\/wp-content\/uploads\/2024\/06\/logo-wifi-150x150.webp 150w\" sizes=\"(max-width: 280px) 100vw, 280px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-22150f50 e-con-full e-flex e-con e-child\" data-id=\"22150f50\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-775f4f92 elementor-widget elementor-widget-heading\" data-id=\"775f4f92\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h1 class=\"elementor-heading-title elementor-size-default\">Librairies pour le wifi<\/h1>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-464176a5 e-flex e-con-boxed e-con e-parent\" data-id=\"464176a5\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-7baf4955 elementor-widget elementor-widget-text-editor\" data-id=\"7baf4955\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"color: #0000ff;\"><strong>Pour ESP32 :<\/strong><\/span><\/p><ol><li><strong>WiFi.h<\/strong> :<ul><li>Biblioth\u00e8que WiFi officielle pour ESP32, fournie avec l&rsquo;IDE Arduino.<\/li><li>Permet de se connecter \u00e0 des r\u00e9seaux WiFi, de configurer un point d&rsquo;acc\u00e8s, et d&rsquo;autres fonctionnalit\u00e9s li\u00e9es au WiFi.<\/li><\/ul><\/li><li><strong>AsyncTCP.h<\/strong> :<ul><li>Biblioth\u00e8que pour les connexions TCP <strong>asynchrones<\/strong> sur ESP32, utile pour les applications n\u00e9cessitant des connexions r\u00e9seau non bloquantes.<\/li><\/ul><\/li><li><strong>ESPAsyncWebServer.h<\/strong> :<ul><li>Biblioth\u00e8que de serveur web <strong>asynchrone<\/strong> pour ESP32, bas\u00e9e sur AsyncTCP.<\/li><li>Permet de cr\u00e9er des serveurs web avec des fonctionnalit\u00e9s avanc\u00e9es et des requ\u00eates HTTP non bloquantes.<\/li><\/ul><\/li><li><strong>WiFiManager.h<\/strong> :<ul><li>Biblioth\u00e8que pour la gestion dynamique de la configuration WiFi sur ESP32.<\/li><li>Utile pour cr\u00e9er des portails captifs et pour permettre la configuration du WiFi sans avoir \u00e0 modifier le code.<\/li><\/ul><\/li><li><strong>PubSubClient.h<\/strong> :<ul><li>Biblioth\u00e8que MQTT pour ESP32, permettant de publier et de souscrire \u00e0 des messages MQTT sur des serveurs MQTT.<\/li><\/ul><\/li><\/ol><p><!-- notionvc: 2ae4a272-74bc-4225-9972-efcb23d4e8d2 --><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6c12969 elementor-widget elementor-widget-text-editor\" data-id=\"6c12969\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"color: #0000ff;\"><strong>Pour ESP8266 :<\/strong><\/span><\/p><ol><li><strong>ESP8266WiFi.h<\/strong> :<ul><li>Biblioth\u00e8que WiFi officielle pour ESP8266, fournie avec l&rsquo;IDE Arduino.<\/li><li>Permet de se connecter \u00e0 des r\u00e9seaux WiFi, de configurer un point d&rsquo;acc\u00e8s, et d&rsquo;autres fonctionnalit\u00e9s li\u00e9es au WiFi.<\/li><\/ul><\/li><li><strong>ESP8266HTTPClient.h<\/strong> :<ul><li>Biblioth\u00e8que pour effectuer des requ\u00eates HTTP sur ESP8266, utilis\u00e9e pour envoyer et recevoir des donn\u00e9es depuis des serveurs web.<\/li><\/ul><\/li><li><strong>ESP8266WebServer.h<\/strong> :<ul><li>Biblioth\u00e8que pour cr\u00e9er un serveur web sur ESP8266, permettant de g\u00e9rer des requ\u00eates HTTP et de servir des pages web.<\/li><\/ul><\/li><li><strong>WiFiManager.h<\/strong> :<ul><li>Biblioth\u00e8que pour la gestion dynamique de la configuration WiFi sur ESP8266.<\/li><li>Utile pour cr\u00e9er des portails captifs et pour permettre la configuration du WiFi sans avoir \u00e0 modifier le code.<\/li><\/ul><\/li><li><strong>PubSubClient.h<\/strong> :<ul><li>Biblioth\u00e8que MQTT pour ESP8266, permettant de publier et de souscrire \u00e0 des messages MQTT sur des serveurs MQTT.<\/li><\/ul><\/li><\/ol><p><!-- notionvc: 1fd16e9d-ae17-4a31-a28b-edf6ceb12ef5 --><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b7a08a1 elementor-widget-divider--view-line elementor-widget elementor-widget-divider\" data-id=\"b7a08a1\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"divider.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-divider\">\n\t\t\t<span class=\"elementor-divider-separator\">\n\t\t\t\t\t\t<\/span>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-f9d4b0f elementor-widget elementor-widget-text-editor\" data-id=\"f9d4b0f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Ces biblioth\u00e8ques sont largement utilis\u00e9es pour d\u00e9velopper des applications WiFi sur les modules ESP32 et ESP8266. Vous pouvez les trouver et les installer \u00e0 partir de la biblioth\u00e8que de gestion de l&rsquo;IDE Arduino ou en les t\u00e9l\u00e9chargeant depuis des r\u00e9f\u00e9rentiels en ligne.<\/p><p>Les biblioth\u00e8ques <code>ESPAsyncTCP.h<\/code> et <code>ESPAsyncWebServer.h<\/code> sont con\u00e7ues pour fonctionner de mani\u00e8re asynchrone avec les modules ESP32 et ESP8266. Cependant, il y a quelques points importants \u00e0 consid\u00e9rer :<\/p><p><!-- notionvc: d2f06950-51d6-40b1-b7c6-ba306edb772a --><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-42223b1 e-con-full e-flex e-con e-parent\" data-id=\"42223b1\" data-element_type=\"container\" data-e-type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t<div class=\"elementor-element elementor-element-14bccaf e-con-full e-flex e-con e-child\" data-id=\"14bccaf\" data-element_type=\"container\" data-e-type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t<div class=\"elementor-element elementor-element-aa32e3f elementor-widget elementor-widget-image\" data-id=\"aa32e3f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"5\" height=\"59\" src=\"https:\/\/www.domotic.phdata.fr\/domotic\/wp-content\/uploads\/2024\/06\/trait-verticale.png\" class=\"attachment-thumbnail size-thumbnail wp-image-1541\" alt=\"\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-f3b74da e-con-full e-flex e-con e-child\" data-id=\"f3b74da\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-5505f0d5 elementor-widget elementor-widget-text-editor\" data-id=\"5505f0d5\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Pour utiliser ces biblioth\u00e8ques sur ESP32 et ESP8266, vous devez inclure les versions appropri\u00e9es pour chaque plateforme. Voici comment vous pouvez les inclure dans votre projet en fonction de la carte utilis\u00e9e :<br \/><!-- notionvc: 77c7883a-d690-4e16-9c16-a48fe8d2eb6e --><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-1be3f7e e-flex e-con-boxed e-con e-parent\" data-id=\"1be3f7e\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-cd483c3 elementor-widget elementor-widget-text-editor\" data-id=\"cd483c3\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"color: #0000ff;\"><strong>ESPAsyncTCP<\/strong><\/span><\/p><ul><li><strong>ESP32<\/strong> : La biblioth\u00e8que <code>AsyncTCP<\/code> est sp\u00e9cifiquement con\u00e7ue pour l&rsquo;ESP32. Elle permet des connexions TCP asynchrones et est une d\u00e9pendance pour <code>ESPAsyncWebServer<\/code> sur ESP32.<\/li><li><strong>ESP8266<\/strong> : Pour l&rsquo;ESP8266, vous devez utiliser <code>ESPAsyncTCP<\/code> qui est une version diff\u00e9rente de la biblioth\u00e8que <code>AsyncTCP<\/code> adapt\u00e9e pour <br \/>fonctionner avec l&rsquo;ESP8266. Elle permet des connexions TCP asynchrones similaires \u00e0 celles offertes par <code>AsyncTCP<\/code> sur ESP32.<\/li><\/ul><p><span style=\"color: #0000ff;\"><strong>ESPAsyncWebServer<\/strong><\/span><\/p><ul><li><strong>ESP32<\/strong> : La biblioth\u00e8que <code>ESPAsyncWebServer<\/code> fonctionne parfaitement avec l&rsquo;ESP32 lorsqu&rsquo;elle est utilis\u00e9e avec <code>AsyncTCP<\/code>.<\/li><li><strong>ESP8266<\/strong> : La biblioth\u00e8que <code>ESPAsyncWebServer<\/code> fonctionne \u00e9galement avec l&rsquo;ESP8266, mais elle d\u00e9pend de <code>ESPAsyncTCP<\/code> pour l&rsquo;ESP8266.<\/li><li>\u00a0<\/li><\/ul><p><!-- notionvc: b7dd8777-c32c-49d9-8264-75d7fc12c3f6 --><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-ca68976 e-flex e-con-boxed e-con e-parent\" data-id=\"ca68976\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-5452b7a elementor-widget elementor-widget-heading\" data-id=\"5452b7a\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Pour ESP32 :<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2da2780b elementor-widget elementor-widget-text-editor\" data-id=\"2da2780b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#include <WiFi.h>\n#include <AsyncTCP.h>\n#include <ESPAsyncWebServer.h>\n\nconst char* ssid = \"Votre_SSID\";\nconst char* password = \"Votre_Mot_de_passe\";\n\nAsyncWebServer server(80);\n\nvoid setup() {\n  Serial.begin(115200);\n  WiFi.begin(ssid, password);\n\n  while (WiFi.status() != WL_CONNECTED) {\n    delay(1000);\n    Serial.println(\"Connecting to WiFi...\");\n  }\n\n  Serial.println(\"Connected to WiFi\");\n\n  server.on(\"\/\", HTTP_GET, [](AsyncWebServerRequest *request){\n    request->send(200, \"text\/plain\", \"Hello, world\");\n  });\n\n  server.begin();\n}\n\nvoid loop() {\n  \/\/ Code principal\n}\n\n\n<\/pre>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2666977 elementor-widget elementor-widget-heading\" data-id=\"2666977\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Pour ESP8266 :<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-901612d elementor-widget elementor-widget-text-editor\" data-id=\"901612d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<!-- wp:enlighter\/codeblock {\"language\":\"cpp\"} -->\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#include <ESP8266WiFi.h>\n#include <ESPAsyncTCP.h>\n#include <ESPAsyncWebServer.h>\n\nconst char* ssid = \"Votre_SSID\";\nconst char* password = \"Votre_Mot_de_passe\";\n\nAsyncWebServer server(80);\n\nvoid setup() {\n  Serial.begin(115200);\n  WiFi.begin(ssid, password);\n\n  while (WiFi.status() != WL_CONNECTED) {\n    delay(1000);\n    Serial.println(\"Connecting to WiFi...\");\n  }\n\n  Serial.println(\"Connected to WiFi\");\n\n  server.on(\"\/\", HTTP_GET, [](AsyncWebServerRequest *request){\n    request->send(200, \"text\/plain\", \"Hello, world\");\n  });\n\n  server.begin();\n}\n\nvoid loop() {\n  \/\/ Code principal\n}\n\n\n<\/pre>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-b4f5bd7 e-flex e-con-boxed e-con e-parent\" data-id=\"b4f5bd7\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-3eede9b elementor-widget elementor-widget-text-editor\" data-id=\"3eede9b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<span style=\"color: #000000;\"><strong>Conclusion<\/strong><\/span>\n\nLes biblioth\u00e8ques <span style=\"text-decoration: underline;\"><code>ESPAsyncTCP.h<\/code><\/span> et <span style=\"text-decoration: underline;\"><code>ESPAsyncWebServer.h<\/code> <\/span>fonctionnent sur les deux plateformes, ESP32 et ESP8266, mais vous devez vous assurer d&rsquo;inclure et d&rsquo;utiliser les bonnes versions de <code>AsyncTCP<\/code> ou <code>ESPAsyncTCP<\/code> selon la plateforme sur laquelle vous travaillez.\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-51f9f013 e-flex e-con-boxed e-con e-parent\" data-id=\"51f9f013\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-2c0a4a61 elementor-view-default elementor-widget elementor-widget-icon\" data-id=\"2c0a4a61\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"icon.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-icon-wrapper\">\n\t\t\t<a class=\"elementor-icon\" href=\"#menu\">\n\t\t\t<i aria-hidden=\"true\" class=\"fas fa-arrow-up\"><\/i>\t\t\t<\/a>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-1e2c828d e-flex e-con-boxed e-con e-parent\" data-id=\"1e2c828d\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-1b726e95 elementor-widget elementor-widget-text-editor\" data-id=\"1b726e95\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"2509\" class=\"elementor elementor-2509\">\n\t\t\t\t<div class=\"elementor-element elementor-element-dc37c4c e-flex e-con-boxed e-con e-parent\" data-id=\"dc37c4c\" data-element_type=\"container\" data-e-type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;gradient&quot;}\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-31250bc elementor-widget elementor-widget-image\" data-id=\"31250bc\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"1000\" height=\"140\" src=\"https:\/\/www.domotic.phdata.fr\/domotic\/wp-content\/uploads\/2024\/06\/pied-de-page.webp\" class=\"attachment-large size-large wp-image-3167\" alt=\"\" srcset=\"https:\/\/www.domotic.phdata.fr\/domotic\/wp-content\/uploads\/2024\/06\/pied-de-page.webp 1000w, https:\/\/www.domotic.phdata.fr\/domotic\/wp-content\/uploads\/2024\/06\/pied-de-page-300x42.webp 300w, https:\/\/www.domotic.phdata.fr\/domotic\/wp-content\/uploads\/2024\/06\/pied-de-page-768x108.webp 768w, https:\/\/www.domotic.phdata.fr\/domotic\/wp-content\/uploads\/2024\/06\/pied-de-page-150x21.webp 150w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-da41007 elementor-widget elementor-widget-text-editor\" data-id=\"da41007\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p style=\"text-align: center;\"><strong>Domotique &#8211; informatique &#8211; \u00e9lectronique &#8211; dictionnaire &#8211; projets<\/strong><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-8a0e2d2 elementor-widget elementor-widget-text-editor\" data-id=\"8a0e2d2\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Copyright 2024<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>#include #include #include const char* ssid = \u00ab\u00a0Votre_SSID\u00a0\u00bb; const char* password = \u00ab\u00a0Votre_Mot_de_passe\u00a0\u00bb; AsyncWebServer server(80); void setup() { Serial.begin(115200); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(1000); Serial.println(\u00ab\u00a0Connecting to WiFi&#8230;\u00a0\u00bb); } Serial.println(\u00ab\u00a0Connected to WiFi\u00a0\u00bb); server.on(\u00ab\u00a0\/\u00a0\u00bb, HTTP_GET, [](AsyncWebServerRequest *request){ request->send(200, \u00ab\u00a0text\/plain\u00a0\u00bb, \u00ab\u00a0Hello, world\u00a0\u00bb); }); server.begin(); } void loop() { \/\/ Code principal } Pour ESP8266 : [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"","ocean_second_sidebar":"","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"","ocean_custom_header_template":"","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"","ocean_menu_typo_font_family":"","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"","_jetpack_memberships_contains_paid_content":false,"ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"on","ocean_gallery_id":[],"footnotes":""},"categories":[1,16],"tags":[],"class_list":["post-3686","post","type-post","status-publish","format-standard","hentry","category-bienvenue","category-blog","entry"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.domotic.phdata.fr\/domotic\/wp-json\/wp\/v2\/posts\/3686","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.domotic.phdata.fr\/domotic\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.domotic.phdata.fr\/domotic\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.domotic.phdata.fr\/domotic\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.domotic.phdata.fr\/domotic\/wp-json\/wp\/v2\/comments?post=3686"}],"version-history":[{"count":46,"href":"https:\/\/www.domotic.phdata.fr\/domotic\/wp-json\/wp\/v2\/posts\/3686\/revisions"}],"predecessor-version":[{"id":3739,"href":"https:\/\/www.domotic.phdata.fr\/domotic\/wp-json\/wp\/v2\/posts\/3686\/revisions\/3739"}],"wp:attachment":[{"href":"https:\/\/www.domotic.phdata.fr\/domotic\/wp-json\/wp\/v2\/media?parent=3686"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.domotic.phdata.fr\/domotic\/wp-json\/wp\/v2\/categories?post=3686"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.domotic.phdata.fr\/domotic\/wp-json\/wp\/v2\/tags?post=3686"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}