{"id":3504,"date":"2025-03-26T15:00:53","date_gmt":"2025-03-26T15:00:53","guid":{"rendered":"https:\/\/iotthinghub.com\/?p=3504"},"modified":"2025-03-26T15:49:04","modified_gmt":"2025-03-26T15:49:04","slug":"esp8266-as-station-mode-connected-to-internet","status":"publish","type":"post","link":"https:\/\/iotthinghub.com\/?p=3504","title":{"rendered":"ESP8266 as Station Mode: Connected to Internet"},"content":{"rendered":"\n<p class=\"has-text-color has-link-color wp-elements-c634f55ceeeb66b31f925d90936da47f wp-block-paragraph\" style=\"color:#5c5c5c\">In our previous article we discuss about Access Point Network, in this article we discuss about ESP8266 station mode. For connecting with your 2.4GHz router &amp; basic command please see my <a href=\"https:\/\/iotthinghub.com\/?p=3399\">WiFi Load Control<\/a> article. Setting the ESP8266 to Station Mode (STA) allows it to connect to an existing Wi-Fi network. This enables it to communicate with other devices, send data to the cloud, or host a web server.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"480\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/Station-Mode-1024x480.jpg\" alt=\"\" class=\"wp-image-3506\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/Station-Mode-1024x480.jpg 1024w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/Station-Mode-300x140.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/Station-Mode-768x360.jpg 768w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/Station-Mode.jpg 1215w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-78f161d1ba4001da1b3403f3cc618fa5 wp-block-paragraph\" style=\"color:#5c5c5c\">Before starting please go through my previous articles for some basic knowledge of ESP8266 module. Before starting let\u2019s see some command mode that we need in this article.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"264\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/command-station-1024x264.jpg\" alt=\"\" class=\"wp-image-3510\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/command-station-1024x264.jpg 1024w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/command-station-300x77.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/command-station-768x198.jpg 768w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/command-station.jpg 1365w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-4de5b876db8cf095940b053f6a2d2ad3 wp-block-paragraph\" style=\"color:#5c5c5c\">Let\u2019s see the command parameters &amp; there uses. Simple AT command return OK string with carriage return &amp; new line. If we send ATE0 it will stop echo otherwise echo comes. Command AT+CWMODE define the mode of operations. In this article we use ESP8266 as a Station. The AT+CWLAP command will show the available networks for esp8266 access point. If it doesn\u2019t show your router name, please enable the 2.4GHz frequency bandwidth. Connect your router with AT+JAP command. Let\u2019s look at the program for setup-<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; auto-links: false; title: ; quick-code: false; notranslate\" title=\"\">\nchar WIFI_NAME&#x5B;] = &quot;SSID&quot;;       \/\/ WiFi Name\nchar WIFI_PASS&#x5B;]  = &quot;Password&quot;;  \/\/ WiFi Password\nchar display&#x5B;1023],wifi_send&#x5B;200],RX_ST&#x5B;1023],TX_ID&#x5B;20];\nuint8_t rx_char;\nuint16_t count;\nextern UART_HandleTypeDef huart1;\n\/\/-------------- Rx Callback Function -----\nvoid HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)\n{\n  if(huart-&gt;Instance== USART1)\n  {\n    display&#x5B;count++]=rx_char;\n    HAL_UART_Receive_IT(&amp;huart1,&amp;rx_char,1);\n  }\n}\nvoid ESP8266_Setup(void)\n{\n\tESP8266_TX(&quot;AT\\r\\n&quot;,&quot;OK&quot;,4000);                \/\/ Device Checking\n\tESP8266_TX(&quot;ATE0\\r\\n&quot;,&quot;OK&quot;,4000);              \/\/ ECHO OFF\n\tESP8266_TX(&quot;AT+CWMODE=1\\r\\n&quot;,&quot;OK&quot;,4000);       \/\/ Station Mode\n\tsprintf(wifi_send,&quot;AT+CWJAP=\\&quot;%s\\&quot;,\\&quot;%s\\&quot;\\r\\n&quot;,WIFI_NAME,WIFI_PASS);\n\tESP8266_TX(wifi_send,&quot;GOT IP&quot;,8000);           \/\/ Connected to Internet\n\tmemset (display, &#039;\\0&#039;,1023);                   \/\/ clear the buffer\n\tcount=0;\n}\nvoid ESP8266_TX(char *b_send,char *return_string,uint16_t delay_time)\n{\n\tchar ESP8266_TX&#x5B;10];\n\tsprintf(ESP8266_TX,&quot;%s&quot;,return_string);\n            sprintf(wifi_send,&quot;%s&quot;,b_send);\n\tHAL_UART_Transmit(&amp;huart1,(uint8_t*)wifi_send,strlen(wifi_send),1000);\n\twhile(1)\n\t{\n\t\tsprintf(RX_ST,&quot;%s&quot;,display);\n\t\tif(strstr(RX_ST,ESP8266_TX)) break;\n\t}\n\tHAL_Delay(delay_time);\n\tmemset (display, &#039;\\0&#039;,1023);   \/\/ clear the buffer\n\tmemset (wifi_send,&#039;\\0&#039;,200);   \/\/ clear the buffer\n\tmemset (RX_ST, &#039;\\0&#039;,1023);     \/\/ clear the buffer\n\tcount=0;\n}\n<\/pre><\/div>\n\n\n<p class=\"has-text-color has-link-color wp-elements-3b4778f98a398e2e03cbff44bc707d66 wp-block-paragraph\" style=\"color:#5c5c5c\">After setup the next step is to collect data from webpage &amp; display it on screen. Here I use UART1 for ESP8266 &amp; I2C2 for display purpose. In this article we get the data from following 2 website-<\/p>\n\n\n\n<ul style=\"color:#252525\" class=\"wp-block-list has-text-color has-link-color wp-elements-84ad22261a0599c538f5fbdbfe2dd1f3\">\n<li><a href=\"https:\/\/api.openweathermap.org\">https:\/\/api.openweathermap.org<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/timezonedb.com\/api\">https:\/\/timezonedb.com\/api<\/a><\/li>\n<\/ul>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-ffd4d29976cee14a3d857bb553eb96e5 wp-block-paragraph\" style=\"color:#5c5c5c\">By default at AT+CIPMUX=0 or Single connection mode, Establish TCP connection, UDP transmission or SSL connection\u2013<\/p>\n\n\n\n<p class=\"has-text-align-center has-text-color has-link-color has-medium-font-size wp-elements-6dd915e8e798387449db3db1cea89a9c wp-block-paragraph\" style=\"color:#252525\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 cmd>           AT+CIPSTART=&lt;type>, &lt;remote IP>, &lt;remote port> <\/p>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-42d7ae1b287ff8eee306bcc924b2b051 wp-block-paragraph\" style=\"color:#5c5c5c\">Here type is either TCP or UDP or SSL. Let\u2019s look at the basic different-<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img decoding=\"async\" width=\"1024\" height=\"351\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/table-4-1024x351.jpg\" alt=\"\" class=\"wp-image-3523\" style=\"width:788px;height:auto\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/table-4-1024x351.jpg 1024w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/table-4-300x103.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/table-4-768x263.jpg 768w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/table-4.jpg 1450w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-6135b23f841a7326d3be06194252eb9e wp-block-paragraph\" style=\"color:#5c5c5c\">&lt;remote IP> is either the name of the domain or IP address of the website. Example 142.251.40.142 is IP of <a href=\"http:\/\/www.google.com\">www.google.com<\/a>. In networking, port numbers are used to distinguish different types of services. Here\u2019s a breakdown of TCP and SSL\/TLS ports commonly used for different applications:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"333\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/tabile-5-1024x333.jpg\" alt=\"\" class=\"wp-image-3527\" style=\"width:787px;height:auto\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/tabile-5-1024x333.jpg 1024w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/tabile-5-300x98.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/tabile-5-768x250.jpg 768w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/tabile-5.jpg 1467w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-23a6d5ddc9080d2422559f3f39b4412e wp-block-paragraph\" style=\"color:#5c5c5c\">For example connected to the server with HTTP TCP protocol with port number 80-<\/p>\n\n\n\n<ul style=\"color:#252525\" class=\"wp-block-list has-text-color has-link-color has-medium-font-size wp-elements-42f2d62102214f226ce9a39df9cedc9d\">\n<li>AT+CIPSTART=&#8221;TCP&#8221;,&#8221;api.openweathermap.org&#8221;,80\\r\\n<\/li>\n\n\n\n<li>AT+CIPSTART=&#8221;TCP&#8221;,&#8221;api.timezonedb.com&#8221;,80\\r\\n<\/li>\n<\/ul>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-1e0166baca1aabf7cf629459dc5241bb wp-block-paragraph\" style=\"color:#5c5c5c\">Next command is AT+CIPSEND to transmit string to the server. Connecting with a server typically involves making HTTP requests using various methods, each serving a specific purpose. Below are the main HTTP methods, along with details on how they are used:<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"242\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/tabile-6-1024x242.jpg\" alt=\"\" class=\"wp-image-3532\" style=\"width:787px;height:auto\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/tabile-6-1024x242.jpg 1024w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/tabile-6-300x71.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/tabile-6-768x181.jpg 768w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/tabile-6.jpg 1371w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-d3f61000396828d01516e5a52585dc9c wp-block-paragraph\" style=\"color:#5c5c5c\">For example the current weather data to make an API call-<\/p>\n\n\n\n<p class=\"has-text-color has-link-color has-medium-font-size wp-elements-c9e59da2e724c7d1a568cdae0cac6270 wp-block-paragraph\" style=\"color:#252525\">https:\/\/api.openweathermap.org\/data\/2.5\/weather?lat={lat}&amp;lon={lon}&amp;appid={API key}<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"299\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/tabile-7-1024x299.jpg\" alt=\"\" class=\"wp-image-3535\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/tabile-7-1024x299.jpg 1024w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/tabile-7-300x88.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/tabile-7-768x224.jpg 768w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/tabile-7.jpg 1430w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-404bf2b4c2a967eeb31326cd10de0ecd wp-block-paragraph\" style=\"color:#5c5c5c\">The response will be the current weather update. By default the temperature is show in standard mode which is Kelvin. You can change it to Celsius value by using matric mode. Example-<\/p>\n\n\n\n<p class=\"has-text-align-center has-text-color has-link-color wp-elements-0329d710f38694d76d9602e2162c4ce2 wp-block-paragraph\" style=\"color:#252525\">https:\/\/api.openweathermap.org\/data\/2.5\/weather?lat={lat}&amp;lon={lon}&amp;appid={API key} &amp;units=metric<\/p>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-e1c1e816f1ec38d5f491dd643c553af6 wp-block-paragraph\" style=\"color:#5c5c5c\">Most of our browser we only apply GET method &amp; for other method we need APP, most popular is the <a href=\"https:\/\/www.postman.com\/downloads\/\">Postman<\/a>. Here we use GET method-<\/p>\n\n\n\n<p class=\"has-text-align-center has-text-color has-link-color wp-elements-6740e93eb83e8c2d3d3e7d09652ed3ad wp-block-paragraph\" style=\"color:#252525\">GET https:\/\/api.openweathermap.org\/data\/2.5\/weather?lat={lat}&amp;lon={lon}&amp;appid={API key} &amp;units=metric\\r\\n\\r\\n\\r\\n<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; auto-links: false; title: ; quick-code: false; notranslate\" title=\"\">\nchar latitude&#x5B;]          = &quot;Your Latitude&quot;;\nchar longitude&#x5B;]         = &quot;Your Longitude &quot;;\nchar API_Key_weather&#x5B;]   = &quot;Your unique API key&quot;;\nsprintf(wifi_send,&quot;AT+CIPSTART=\\&quot;TCP\\&quot;,\\&quot;api.openweathermap.org\\&quot;,80\\r\\n&quot;);\nESP8266_TX(wifi_send,&quot;CONNECT&quot;,200);\nsprintf(wifi_send,&quot;GET https:\/\/api.openweathermap.org\/data\/2.5\/weather?lat=%s&amp;lon=%s&amp;appid=%s&amp;units=metric\\r\\n\\r\\n\\r\\n&quot;,latitude,longitude,API_Key_weather);\nsprintf(TX_ID,&quot;AT+CIPSEND=%d\\r\\n&quot;,strlen(wifi_send));\nESP8266_TX(TX_ID,&quot;&gt;&quot;,100);                    \/\/ Creating LINK\nsprintf(wifi_send,&quot;GET https:\/\/api.openweathermap.org\/data\/2.5\/weather?lat=%s&amp;lon=%s&amp;appid=%s&amp;units=metric\\r\\n\\r\\n\\r\\n&quot;,latitude,longitude,API_Key_weather);\nHAL_UART_Transmit(&amp;huart1,(uint8_t*)wifi_send,strlen(wifi_send),1000);\n<\/pre><\/div>\n\n\n<p class=\"has-text-color has-link-color wp-elements-cfd12a989ca4351459aba2b94396131c wp-block-paragraph\" style=\"color:#5c5c5c\">The program will return all the parameter in JSON format, filter your desire data. Let\u2019s use another format of reserving data form <a href=\"https:\/\/timezonedb.com\">https:\/\/timezonedb.com<\/a>. Get current local time at Statue of Liberty using latitude &amp; longitude-<\/p>\n\n\n\n<p class=\"has-text-align-center has-text-color has-link-color wp-elements-15212765d2d2d0360edf249d64598f45 wp-block-paragraph\" style=\"color:#252525\">http:\/\/api.timezonedb.com\/v2.1\/get-time-zone?key={API key} &amp;by=position&amp;lat={lat}&amp;lng={lon}<\/p>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-b29cbf703a4d15afb9be7cd83ecae5e9 wp-block-paragraph\" style=\"color:#5c5c5c\">The default format is XML, you can change it to JSON (JavaScript Object Notation) format. Here we use GET method-<\/p>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-1878ba466da071a21cad4fda638c0ae8 wp-block-paragraph\" style=\"color:#252525\">GET \/v2.1\/get-time-zone?key={API key} &amp;format=json&amp;by=position&amp;lat={lat}&amp;lng={lon} HTTP\/1.0\\r\\nHost: api.timezonedb.com\\r\\n\\r\\n\\r\\n<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; auto-links: false; title: ; quick-code: false; notranslate\" title=\"\">\nchar API_Key_time&#x5B;]      = &quot;Your unique API key &quot;;\nsprintf(wifi_send,&quot;AT+CIPSTART=\\&quot;TCP\\&quot;,\\&quot;api.timezonedb.com\\&quot;,80\\r\\n&quot;);\nESP8266_TX(wifi_send,&quot;CONNECT&quot;,200);\nsprintf(wifi_send,&quot;GET \/v2.1\/get-time-zone?key=%s&amp;format=json&amp;by=position&amp;lat=%s&amp;lng=%s HTTP\/1.1\\r\\nHost: api.timezonedb.com\\r\\n\\r\\n\\r\\n&quot;,API_Key_time,latitude,longitude);\nsprintf(TX_ID,&quot;AT+CIPSEND=%d\\r\\n&quot;,strlen(wifi_send));\nESP8266_TX(TX_ID,&quot;&gt;&quot;,100);                    \/\/ Creating LINK \nsprintf(wifi_send,&quot;GET \/v2.1\/get-time-zone?key=%s&amp;format=json&amp;by=position&amp;lat=%s&amp;lng=%s HTTP\/1.1\\r\\nHost: api.timezonedb.com\\r\\n\\r\\n\\r\\n&quot;,API_Key_time,latitude,longitude);\nHAL_UART_Transmit(&amp;huart1,(uint8_t*)wifi_send,strlen(wifi_send),1000);\n<\/pre><\/div>\n\n\n<p class=\"has-text-color has-link-color wp-elements-3783dcb71ac3da567d4c05ac16a8f558 wp-block-paragraph\" style=\"color:#5c5c5c\">HTTP\/1.0 and HTTP\/1.1 are different versions of the HyperText Transfer Protocol (HTTP), with HTTP\/1.1 introducing significant improvements over HTTP\/1.0. Below are the key differences:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"112\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/tabile-8-1024x112.jpg\" alt=\"\" class=\"wp-image-3548\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/tabile-8-1024x112.jpg 1024w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/tabile-8-300x33.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/tabile-8-768x84.jpg 768w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2025\/03\/tabile-8.jpg 1411w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-11df96cf2aa9e4c6619a9898dbf120b1 wp-block-paragraph\" style=\"color:#5c5c5c\">The received data string contents all the time information, filter your desire section. Let\u2019s use a timer for schedule calling the remote website. We will use TIM17 general purpose time to create interrupt at every 1s. Let\u2019s use system clock as 48MHz f<sub>sys<\/sub> = 48MHz and prescaler value 4799, so the new clock frequency for TIM17 is-<\/p>\n\n\n\n<p class=\"has-text-align-center has-text-color has-link-color wp-elements-84752a7a2b27c667440ef01c6827a9e3 wp-block-paragraph\" style=\"color:#252525\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f<sub>TIM17 <\/sub>= f<sub>sys <\/sub>\/ (prescaler +1) = 48MHz\/(4799+1) = 10kHz &amp; t<sub>TIM17<\/sub> = .01ms<\/p>\n\n\n\n<p class=\"has-text-color has-link-color wp-elements-8ec858d42f86df74cd11866571e8c684 wp-block-paragraph\" style=\"color:#5c5c5c\">So the TIM17 new frequency f<sub>TIM17<\/sub> = 10kHz.The Couter Period has a maximum value of 2<sup>16<\/sup>-1 or 65535. If Couter Period ARR = 9999, the delay for every interrupt will be 1s.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; auto-links: false; title: ; quick-code: false; notranslate\" title=\"\">\nuint8_t min,second;\nuint16_t timer_count;\nvoid HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)\n{\n\tif(htim-&gt;Instance== TIM17)\n\t{\n\t\tsecond++;\n\t\tif(second&gt;60)\n\t\t\t{\n\t\t\t\t\ttimer_count++;\n\t\t\t\t\tmin++;second=0;\n\t\t\t}\n\t}\n}\n<\/pre><\/div>\n\n\n<p class=\"has-text-color has-link-color wp-elements-22587fea952aa226c1e4e95126d16f4c wp-block-paragraph\" style=\"color:#5c5c5c\">Here I describe the basic structure &amp; full steps one by one. It is not best practice to use STM32 as core &amp; ESP8266 as slave, because the ESP8266 can properly handle all the command &amp; a development board for lots of more function. We will do all the staff with only a single ESP8266 module in some other article. For device setting &amp; how it works please see my YouTube video, keep learning.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"MCU STM32 \u25b6Online Weather &amp; Time \ud83d\udcf6\ud83c\udf10ESP8266 as Station Mode\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/_YG3dpfiHtY?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>In our previous article we discuss about Access Point Network, in this article we discuss about ESP8266 station mode. For connecting with your 2.4GHz router &amp; basic command please see my WiFi Load Control article. Setting the ESP8266 to Station Mode (STA) allows it to connect to an existing Wi-Fi network. This enables it to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[],"class_list":["post-3504","post","type-post","status-publish","format-standard","hentry","category-wireless-iot"],"_links":{"self":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/3504","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3504"}],"version-history":[{"count":27,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/3504\/revisions"}],"predecessor-version":[{"id":3554,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/3504\/revisions\/3554"}],"wp:attachment":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3504"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3504"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3504"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}