{"id":2286,"date":"2023-09-15T14:56:56","date_gmt":"2023-09-15T13:56:56","guid":{"rendered":"https:\/\/lesmrdtrucs.mataf35400.fr\/?page_id=2286"},"modified":"2023-09-15T22:12:34","modified_gmt":"2023-09-15T21:12:34","slug":"esp32-01s-petite-carte","status":"publish","type":"page","link":"https:\/\/lesmrdtrucs.mataf35400.fr\/index.php\/esp32-01s-petite-carte\/","title":{"rendered":"ESP32-01s (petite-carte)"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"2286\" class=\"elementor elementor-2286\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-ddf89b7 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"ddf89b7\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-0909c6e\" data-id=\"0909c6e\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-f5512f6 elementor-widget elementor-widget-image\" data-id=\"f5512f6\" data-element_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<img fetchpriority=\"high\" decoding=\"async\" width=\"615\" height=\"631\" src=\"https:\/\/lesmrdtrucs.mataf35400.fr\/wp-content\/uploads\/2023\/09\/Image1.png\" class=\"attachment-full size-full wp-image-2292\" alt=\"\" srcset=\"https:\/\/lesmrdtrucs.mataf35400.fr\/wp-content\/uploads\/2023\/09\/Image1.png 615w, https:\/\/lesmrdtrucs.mataf35400.fr\/wp-content\/uploads\/2023\/09\/Image1-292x300.png 292w\" sizes=\"(max-width: 615px) 100vw, 615px\" \/>\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\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-4dc6304 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"4dc6304\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-4e501a8\" data-id=\"4e501a8\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-3f81d88 elementor-widget elementor-widget-heading\" data-id=\"3f81d88\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Attention:<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6d30cfb elementor-widget elementor-widget-text-editor\" data-id=\"6d30cfb\" data-element_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<p>Cette carte doit imp\u00e9rativement \u00eatre aliment\u00e9e en 3V3, sous peine d&rsquo;\u00eatre d\u00e9truite (pas forc\u00e9ment enti\u00e8rement).<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-99111ce elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"99111ce\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-e227c0b\" data-id=\"e227c0b\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-c2ff4b5 elementor-widget elementor-widget-heading\" data-id=\"c2ff4b5\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Mrd_Temp_Salon<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-52580c1 elementor-widget elementor-widget-text-editor\" data-id=\"52580c1\" data-element_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<p>Ce programme sert \u00e0 envoyer \u00e0 ThingSpeak les donn\u00e9es collect\u00e9es dans un DHT22<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7c34e80 elementor-widget elementor-widget-text-editor\" data-id=\"7c34e80\" data-element_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<p>Emplacement: <span style=\"color: #0000ff;\"><strong>C:\\Users\\MrdTosh\\Documents\\Arduino\\Mrd_Temp_Salon<\/strong><\/span><\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3bcf412 elementor-widget elementor-widget-heading\" data-id=\"3bcf412\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h5 class=\"elementor-heading-title elementor-size-default\">Le code (dans Arduino.ide)<\/h5>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-675e6ea elementor-widget elementor-widget-image\" data-id=\"675e6ea\" data-element_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<img decoding=\"async\" width=\"338\" height=\"75\" src=\"https:\/\/lesmrdtrucs.mataf35400.fr\/wp-content\/uploads\/2023\/09\/Image1-2.png\" class=\"attachment-full size-full wp-image-2301\" alt=\"\" srcset=\"https:\/\/lesmrdtrucs.mataf35400.fr\/wp-content\/uploads\/2023\/09\/Image1-2.png 338w, https:\/\/lesmrdtrucs.mataf35400.fr\/wp-content\/uploads\/2023\/09\/Image1-2-300x67.png 300w\" sizes=\"(max-width: 338px) 100vw, 338px\" \/>\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-ae311f6 elementor-widget elementor-widget-text-editor\" data-id=\"ae311f6\" data-element_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<div><div><span style=\"color: #008000;\"><em>\/\/#include &lt;WiFi.h&gt; \/\/ Librairie wifi du ESP32<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>#include &lt;ESP8266WiFi.h&gt;<span style=\"color: #008000;\"> \/\/ Librairie wifi du ESP8266<\/span><\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>#include \u00ab\u00a0ThingSpeak.h\u00a0\u00bb<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>#include &lt;Adafruit_Sensor.h&gt;<\/em><\/span><\/div><div><span style=\"color: #008000;\"><em>\/\/#include \u00ab\u00a0DHT.h\u00a0\u00bb \/\/DHT22 &amp; ESP32 NodeMCU (la grande carte)<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>#include \u00ab\u00a0DHTesp.h\u00a0\u00bb <span style=\"color: #008000;\">\/\/essai DHT22 &amp; ESP32 01S (la mini carte)<\/span><\/em><\/span><\/div><p>\u00a0<\/p><div><span style=\"color: #0000ff;\"><em>#define DHT_TYPE \u00a0 \u00a0DHT22 \u00a0 \u00a0 <span style=\"color: #008000;\">\/\/ DHT 22 (AM2302)<\/span><\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>const int DHT_PIN = 2;<\/em><\/span><\/div><p>\u00a0<\/p><div><span style=\"color: #0000ff;\"><em>\/\/const int LED_PIN = 13; <span style=\"color: #008000;\">\/\/ Led bleue du ESP32<\/span><\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>\/\/const int LED_PIN = 1; <span style=\"color: #008000;\">\/\/ Led bleue du ESP8266<\/span><\/em><\/span><\/div><p>\u00a0<\/p><div><span style=\"color: #0000ff;\"><em>const char* WIFI_NAME = \u00ab\u00a0FreeCat\u00a0\u00bb;<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>const char* WIFI_PASSWORD = \u00ab\u00a0bonjouratousdelapartdepatrick\u00a0\u00bb;<\/em><\/span><\/div><p>\u00a0<\/p><div><span style=\"color: #0000ff;\"><em>const int myChannelNumber = 2264941;<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>const char* myApiKey = \u00ab\u00a0C69IPHU8T6VCCW0J\u00a0\u00bb;<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>const char* server = \u00ab\u00a0api.thingspeak.com\u00a0\u00bb;<\/em><\/span><\/div><p>\u00a0<\/p><div><span style=\"color: #008000;\"><em>\/\/ DHT dht(DHT_PIN, DHT_TYPE); \/\/DHT22 &amp; ESP32 NodeMCU (la grande carte)<\/em><\/span><\/div><p>\u00a0<\/p><div><span style=\"color: #0000ff;\"><em>DHTesp dht;<\/em><\/span><\/div><p>\u00a0<\/p><div><span style=\"color: #0000ff;\"><em>WiFiClient client;<\/em><\/span><\/div><p>\u00a0<\/p><div><span style=\"color: #0000ff;\"><em>void setup() {<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>\u00a0 dht.setup(DHT_PIN, DHTesp::DHT22); \/\/essai DHT22 &amp; ESP32 01S (la mini carte)<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>\u00a0 Serial.begin(115200);<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>\u00a0 Serial.println(\u00ab\u00a0\u00a0\u00bb);<\/em><\/span><\/div><p>\u00a0<\/p><div><span style=\"color: #0000ff;\"><em>\u00a0 WiFi.begin(WIFI_NAME, WIFI_PASSWORD);<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>\u00a0 while (WiFi.status() != WL_CONNECTED){<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>\u00a0 \u00a0 Serial.println(\u00ab\u00a0Tentative de connexion au Wifi\u00a0\u00bb);<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>\u00a0 \u00a0 delay(2000);<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>\u00a0 }<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>\u00a0 Serial.println(\u00ab\u00a0Wifi connect\u00e9 !\u00a0\u00bb);<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>\u00a0 Serial.println(\u00ab\u00a0Adresse IP: \u00a0\u00bb + WiFi.localIP().toString());<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>\u00a0 WiFi.mode(WIFI_STA);<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>\u00a0 ThingSpeak.begin(client);<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>}<\/em><\/span><\/div><p>\u00a0<\/p><div><span style=\"color: #0000ff;\"><em>void loop() {<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>\u00a0 <span style=\"color: #008000;\">\/\/ float t = dht.readTemperature(); \/\/DHT22 &amp; ESP32 NodeMCU (la grande carte)<\/span><\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>\u00a0 float t = dht.getTemperature(); <span style=\"color: #008000;\">\/\/essai DHT22 &amp; ESP32 01S (la mini carte)<\/span><\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>\u00a0 ThingSpeak.setField(1,t);<\/em><\/span><\/div><p>\u00a0<\/p><div><span style=\"color: #0000ff;\"><em>\u00a0 int x = ThingSpeak.writeFields(myChannelNumber,myApiKey);<\/em><\/span><\/div><div>\u00a0<\/div><div><span style=\"color: #0000ff;\"><em>\u00a0 Serial.println(\u00ab\u00a0Temp: \u00a0\u00bb + String(t, 2) + \u00ab\u00a0\u00b0C\u00a0\u00bb);<\/em><\/span><\/div><div>\u00a0<\/div><div><span style=\"color: #0000ff;\"><em>\u00a0 if(x == 200){<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>\u00a0 \u00a0 Serial.println(\u00ab\u00a0Temp\u00e9rature envoy\u00e9e \u00e0 ThingSpeak\u00a0\u00bb);<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>\u00a0 \u00a0<span style=\"color: #008000;\"> \/\/ esp_sleep_enable_timer_wakeup(60* 1000000); \/\/Mise en sommeil pendant 60 secondes \u00a0<\/span><\/em><\/span><\/div><div><span style=\"color: #008000;\"><em>\u00a0 \u00a0 \/\/ int ret = esp_deep_sleep_start(); \u00a0<\/em><\/span><\/div><div><span style=\"color: #008000;\"><em>\u00a0 \u00a0 \/\/ ESP.deepSleep(60* 1000000);<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>\u00a0 }else{<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>\u00a0 \u00a0 Serial.println(\u00ab\u00a0Erreur d&rsquo;envoi \u00e0 ThingSpeak &#8211; \u00a0\u00bb + String(x));<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>\u00a0 }<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>\u00a0 Serial.println(\u00ab\u00a0&#8212;\u00ab\u00a0);<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>\u00a0 delay(60000);<\/em><\/span><\/div><div><span style=\"color: #0000ff;\"><em>}<\/em><\/span><\/div><\/div>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Attention: Cette carte doit imp\u00e9rativement \u00eatre aliment\u00e9e en 3V3, sous peine d&rsquo;\u00eatre d\u00e9truite (pas forc\u00e9ment enti\u00e8rement). Mrd_Temp_Salon Ce programme sert \u00e0 envoyer \u00e0 ThingSpeak les donn\u00e9es collect\u00e9es dans un DHT22 Emplacement: C:UsersMrdToshDocumentsArduinoMrd_Temp_Salon Le code (dans Arduino.ide) \/\/#include &lt;WiFi.h&gt; \/\/ Librairie wifi du ESP32#include &lt;ESP8266WiFi.h&gt; \/\/ Librairie wifi du ESP8266#include \u00ab\u00a0ThingSpeak.h\u00a0\u00bb#include &lt;Adafruit_Sensor.h&gt;\/\/#include \u00ab\u00a0DHT.h\u00a0\u00bb \/\/DHT22 &amp; ESP32 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"0","ocean_second_sidebar":"0","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":"0","ocean_custom_header_template":"0","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":"0","ocean_menu_typo_font_family":"0","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":"0","footnotes":""},"class_list":["post-2286","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"https:\/\/lesmrdtrucs.mataf35400.fr\/index.php\/wp-json\/wp\/v2\/pages\/2286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lesmrdtrucs.mataf35400.fr\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/lesmrdtrucs.mataf35400.fr\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/lesmrdtrucs.mataf35400.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lesmrdtrucs.mataf35400.fr\/index.php\/wp-json\/wp\/v2\/comments?post=2286"}],"version-history":[{"count":7,"href":"https:\/\/lesmrdtrucs.mataf35400.fr\/index.php\/wp-json\/wp\/v2\/pages\/2286\/revisions"}],"predecessor-version":[{"id":2304,"href":"https:\/\/lesmrdtrucs.mataf35400.fr\/index.php\/wp-json\/wp\/v2\/pages\/2286\/revisions\/2304"}],"wp:attachment":[{"href":"https:\/\/lesmrdtrucs.mataf35400.fr\/index.php\/wp-json\/wp\/v2\/media?parent=2286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}