{"id":89227,"date":"2019-09-13T13:10:22","date_gmt":"2019-09-13T13:10:22","guid":{"rendered":"https:\/\/randomnerdtutorials.com\/?p=89227"},"modified":"2019-09-13T13:10:28","modified_gmt":"2019-09-13T13:10:28","slug":"esp8266-nodemcu-access-point-ap-web-server","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/esp8266-nodemcu-access-point-ap-web-server\/","title":{"rendered":"ESP8266 NodeMCU Access Point (AP) for Web Server"},"content":{"rendered":"\n<p>In this tutorial, you&#8217;ll learn how to set your ESP8266 NodeMCU as an Access Point (AP) using Arduino IDE. This allows you to connect directly to your ESP8266 via Wi-Fi without a wireless router.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/09\/Set-ESP8266-as-an-Access-Point.jpg?resize=1200%2C675&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP8266 NodeMCU Access Point AP for Web Server\" class=\"wp-image-89258\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/09\/Set-ESP8266-as-an-Access-Point.jpg?w=1280&amp;quality=100&amp;strip=all&amp;ssl=1 1280w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/09\/Set-ESP8266-as-an-Access-Point.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/09\/Set-ESP8266-as-an-Access-Point.jpg?resize=768%2C432&amp;quality=100&amp;strip=all&amp;ssl=1 768w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/09\/Set-ESP8266-as-an-Access-Point.jpg?resize=1024%2C576&amp;quality=100&amp;strip=all&amp;ssl=1 1024w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure><\/div>\n\n\n\n<p class=\"rntbox rntclblue\">To set the ESP8266 as an Access Point use <span class=\"rnthl rntliteral\">WiFi.softAP(ssid, password);<\/span> <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ESP8266 Station and Access Point<\/h2>\n\n\n\n<p>In most of our <a href=\"https:\/\/randomnerdtutorials.com\/esp8266-web-server\/\">ESP8266 NodeMCU web server projects<\/a>, we connect the ESP8266 to a wireless router. In this configuration, we can access the ESP8266 through the local network.<\/p>\n\n\n\n<p>In this scenario, the router acts as an access point and the ESP8266 is set as a station. So, you need to be connected to your router (local network) to control the ESP8266.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"750\" height=\"366\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/09\/esp8266-station.png?resize=750%2C366&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP866 NodeMCU set as a Wi-Fi Station\" class=\"wp-image-89255\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/09\/esp8266-station.png?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/09\/esp8266-station.png?resize=300%2C146&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n\n<p>In some cases, this might not be the best configuration (when you don&#8217;t have a router nearby). But if you set the ESP8266 as an access point (hotspot), you can be connected to the ESP8266 using any device with Wi-Fi capabilities without the need to connect to your router.<\/p>\n\n\n\n<p>In simple words, when you set the ESP8266 as an access point you create its own Wi\u2011Fi network and nearby Wi-Fi devices (stations) can connect to it (like your smartphone or your computer).<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"750\" height=\"418\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/09\/esp8266-access-point.png?resize=750%2C418&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP866 NodeMCU Set as an Access Point (AP) Mode\" class=\"wp-image-89256\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/09\/esp8266-access-point.png?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/09\/esp8266-access-point.png?resize=300%2C167&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n\n<p>In this tutorial, we\u2019ll show you how to set the ESP8266 as an access point in your web server projects. This way, you don\u2019t need to be connected to a router to control your ESP8266.<\/p>\n\n\n\n<p>Because the ESP8266 doesn\u2019t connect further to a wired network (like your router), it is called soft-AP (soft Access Point).<\/p>\n\n\n\n<p>This means that if you try to load libraries or use firmware from the internet, it will not work. It also doesn&#8217;t work if you try to make HTTP requests to services on the internet like publishing sensor readings to the cloud.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing the DHT Library for ESP8266<\/h2>\n\n\n\n<p>For this example, we&#8217;ll use a previous web server project that <a href=\"https:\/\/randomnerdtutorials.com\/esp8266-dht11dht22-temperature-and-humidity-web-server-with-arduino-ide\/\">displays sensor readings from a DHT sensor<\/a>. <\/p>\n\n\n\n<p><a href=\"https:\/\/randomnerdtutorials.com\/how-to-install-esp8266-board-arduino-ide\/\">Having the ESP8266 Board installed in Arduino IDE<\/a>, to read from the DHT sensor, we\u2019ll use the&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/adafruit\/DHT-sensor-library\" target=\"_blank\">DHT library from Adafruit<\/a>. To use this library you also need to install the&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/adafruit\/Adafruit_Sensor\" target=\"_blank\">Adafruit Unified Sensor library<\/a>. <\/p>\n\n\n\n<p>Follow the next steps to install those two libraries:<\/p>\n\n\n\n<p>1. Open your Arduino IDE and go to <strong>Sketch&nbsp;<\/strong>&gt;&nbsp;<strong>Include Library<\/strong>&nbsp;&gt;&nbsp;<strong>Manage Libraries<\/strong>. The Library Manager should open.<\/p>\n\n\n\n<p>2. Search for \u201c<strong>DHT<\/strong>\u201d on the Search box and install the DHT library from Adafruit.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"422\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/04\/adafruit_dht_library.png?resize=750%2C422&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Installing Adafruit DHT library\" class=\"wp-image-84293\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/04\/adafruit_dht_library.png?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/04\/adafruit_dht_library.png?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n\n<p>3. After installing the DHT library from Adafruit, type \u201c<strong>Adafruit Unified Sensor<\/strong>\u201d in the search box. Scroll all the way down to find the library and install it.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"422\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/04\/adafruit_unified_sensor_library.png?resize=750%2C422&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Installing Adafruit Unified Sensor driver library\" class=\"wp-image-84295\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/04\/adafruit_unified_sensor_library.png?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/04\/adafruit_unified_sensor_library.png?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n\n<p>After installing the libraries, restart your Arduino IDE.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ESP8266 NodeMCU Access Point (AP)<\/h2>\n\n\n\n<p>In this example, we\u2019ll modify the ESP8266 Web Server from a previous tutorial to add access point capabilities. Here&#8217;s the project example we&#8217;ll use: <a href=\"https:\/\/randomnerdtutorials.com\/esp8266-dht11dht22-temperature-and-humidity-web-server-with-arduino-ide\/\">ESP8266 DHT11\/DHT22 Temperature and Humidity Web Server with Arduino IDE<\/a>.<\/p>\n\n\n\n<p>What we\u2019ll show you here can be used with any ESP8266 web server example.<\/p>\n\n\n\n<p>Upload the sketch provided below to set the ESP8266 as an access point.<\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">\/*********\n  Rui Santos &amp; Sara Santos - Random Nerd Tutorials\n  Complete project details at https:\/\/randomnerdtutorials.com\/esp8266-nodemcu-access-point-ap-web-server\/\n  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files.\n  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n*********\/\n\n\/\/ Import required libraries\n#include &lt;Arduino.h&gt;\n#include &lt;ESP8266WiFi.h&gt;\n#include &lt;Hash.h&gt;\n#include &lt;ESPAsyncTCP.h&gt;\n#include &lt;ESPAsyncWebServer.h&gt;\n#include &lt;Adafruit_Sensor.h&gt;\n#include &lt;DHT.h&gt;\n\nconst char* ssid     = &quot;ESP8266-Access-Point&quot;;\nconst char* password = &quot;123456789&quot;;\n\n#define DHTPIN 5     \/\/ Digital pin connected to the DHT sensor\n\n\/\/ Uncomment the type of sensor in use:\n\/\/#define DHTTYPE    DHT11     \/\/ DHT 11\n#define DHTTYPE    DHT22     \/\/ DHT 22 (AM2302)\n\/\/#define DHTTYPE    DHT21     \/\/ DHT 21 (AM2301)\n\nDHT dht(DHTPIN, DHTTYPE);\n\n\/\/ current temperature &amp; humidity, updated in loop()\nfloat t = 0.0;\nfloat h = 0.0;\n\n\/\/ Create AsyncWebServer object on port 80\nAsyncWebServer server(80);\n\n\/\/ Generally, you should use &quot;unsigned long&quot; for variables that hold time\n\/\/ The value will quickly become too large for an int to store\nunsigned long previousMillis = 0;    \/\/ will store last time DHT was updated\n\n\/\/ Updates DHT readings every 10 seconds\nconst long interval = 10000;  \n\nconst char index_html[] PROGMEM = R&quot;rawliteral(\n&lt;!DOCTYPE HTML&gt;&lt;html&gt;\n&lt;head&gt;\n  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;\n  &lt;style&gt;\n    html {\n     font-family: Arial;\n     display: inline-block;\n     margin: 0px auto;\n     text-align: center;\n    }\n    h2 { font-size: 3.0rem; }\n    p { font-size: 3.0rem; }\n    .units { font-size: 1.2rem; }\n    .dht-labels{\n      font-size: 1.5rem;\n      vertical-align:middle;\n      padding-bottom: 15px;\n    }\n  &lt;\/style&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n  &lt;h2&gt;ESP8266 DHT Server&lt;\/h2&gt;\n  &lt;p&gt;\n    &lt;span class=&quot;dht-labels&quot;&gt;Temperature&lt;\/span&gt; \n    &lt;span id=&quot;temperature&quot;&gt;%TEMPERATURE%&lt;\/span&gt;\n    &lt;sup class=&quot;units&quot;&gt;&amp;deg;C&lt;\/sup&gt;\n  &lt;\/p&gt;\n  &lt;p&gt;\n    &lt;span class=&quot;dht-labels&quot;&gt;Humidity&lt;\/span&gt;\n    &lt;span id=&quot;humidity&quot;&gt;%HUMIDITY%&lt;\/span&gt;\n    &lt;sup class=&quot;units&quot;&gt;%&lt;\/sup&gt;\n  &lt;\/p&gt;\n&lt;\/body&gt;\n&lt;script&gt;\nsetInterval(function ( ) {\n  var xhttp = new XMLHttpRequest();\n  xhttp.onreadystatechange = function() {\n    if (this.readyState == 4 &amp;&amp; this.status == 200) {\n      document.getElementById(&quot;temperature&quot;).innerHTML = this.responseText;\n    }\n  };\n  xhttp.open(&quot;GET&quot;, &quot;\/temperature&quot;, true);\n  xhttp.send();\n}, 10000 ) ;\n\nsetInterval(function ( ) {\n  var xhttp = new XMLHttpRequest();\n  xhttp.onreadystatechange = function() {\n    if (this.readyState == 4 &amp;&amp; this.status == 200) {\n      document.getElementById(&quot;humidity&quot;).innerHTML = this.responseText;\n    }\n  };\n  xhttp.open(&quot;GET&quot;, &quot;\/humidity&quot;, true);\n  xhttp.send();\n}, 10000 ) ;\n&lt;\/script&gt;\n&lt;\/html&gt;)rawliteral&quot;;\n\n\/\/ Replaces placeholder with DHT values\nString processor(const String&amp; var){\n  \/\/Serial.println(var);\n  if(var == &quot;TEMPERATURE&quot;){\n    return String(t);\n  }\n  else if(var == &quot;HUMIDITY&quot;){\n    return String(h);\n  }\n  return String();\n}\n\nvoid setup(){\n  \/\/ Serial port for debugging purposes\n  Serial.begin(115200);\n  dht.begin();\n  \n  Serial.print(&quot;Setting AP (Access Point)\u2026&quot;);\n  \/\/ Remove the password parameter, if you want the AP (Access Point) to be open\n  WiFi.softAP(ssid, password);\n\n  IPAddress IP = WiFi.softAPIP();\n  Serial.print(&quot;AP IP address: &quot;);\n  Serial.println(IP);\n\n  \/\/ Print ESP8266 Local IP Address\n  Serial.println(WiFi.localIP());\n\n  \/\/ Route for root \/ web page\n  server.on(&quot;\/&quot;, HTTP_GET, [](AsyncWebServerRequest *request){\n    request-&gt;send(200, &quot;text\/html&quot;, index_html, processor);\n  });\n  server.on(&quot;\/temperature&quot;, HTTP_GET, [](AsyncWebServerRequest *request){\n    request-&gt;send(200, &quot;text\/plain&quot;, String(t).c_str());\n  });\n  server.on(&quot;\/humidity&quot;, HTTP_GET, [](AsyncWebServerRequest *request){\n    request-&gt;send(200, &quot;text\/plain&quot;, String(h).c_str());\n  });\n\n  \/\/ Start server\n  server.begin();\n}\n \nvoid loop(){  \n  unsigned long currentMillis = millis();\n  if (currentMillis - previousMillis &gt;= interval) {\n    \/\/ save the last time you updated the DHT values\n    previousMillis = currentMillis;\n    \/\/ Read temperature as Celsius (the default)\n    float newT = dht.readTemperature();\n    \/\/ Read temperature as Fahrenheit (isFahrenheit = true)\n    \/\/float newT = dht.readTemperature(true);\n    \/\/ if temperature read failed, don't change t value\n    if (isnan(newT)) {\n      Serial.println(&quot;Failed to read from DHT sensor!&quot;);\n    }\n    else {\n      t = newT;\n      Serial.println(t);\n    }\n    \/\/ Read Humidity\n    float newH = dht.readHumidity();\n    \/\/ if humidity read failed, don't change h value \n    if (isnan(newH)) {\n      Serial.println(&quot;Failed to read from DHT sensor!&quot;);\n    }\n    else {\n      h = newH;\n      Serial.println(h);\n    }\n  }\n}\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/Random-Nerd-Tutorials\/raw\/master\/Projects\/ESP8266\/ESP8266_Access_Point_AP.ino\" target=\"_blank\">View raw code<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Customize the SSID and Password<\/h3>\n\n\n\n<p>You need to define a SSID name and a password to access the ESP8266. In this example we\u2019re setting the ESP8266 SSID name to <span class=\"rnthl rntliteral\">ESP8266-Access-Point<\/span>, but you can modify the name to whatever you want. The password is <span class=\"rnthl rntliteral\">123456789<\/span>, but you can also modify it.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>const char* ssid     = \"ESP8266-Access-Point\";\nconst char* password = \"123456789\";<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Setting the ESP8266 as an Access Point (AP)<\/h3>\n\n\n\n<p>There\u2019s a section in the <span class=\"rnthl rntliteral\">setup()<\/span> to set the ESP8266 as an access point using the <span class=\"rnthl rntliteral\">softAP()<\/span> method:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>WiFi.softAP(ssid, password);<\/code><\/pre>\n\n\n\n<p>There are also other optional parameters you can pass to the <span class=\"rnthl rntliteral\">softAP()<\/span> method. Here\u2019s all the parameters:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>.softAP(const char* ssid, const char* password, int channel, int ssid_hidden, int max_connection)<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li><span class=\"rnthl rntliteral\">ssid<\/span> (defined earlier): maximum of 31 characters<\/li><li><span class=\"rnthl rntliteral\">password<\/span> (defined earlier): minimum of 8 characters. If not specified, the access point will be open (maximum 63 characters)<\/li><li><span class=\"rnthl rntliteral\">channel<\/span>: Wi-Fi channel number (1-13). Default is 1<\/li><li><span class=\"rnthl rntliteral\">ssid_hidden<\/span>: if set to true will hide SSID<\/li><li><span class=\"rnthl rntliteral\">max_connection<\/span>: max simultaneous connected stations, from 0 to 8<\/li><\/ul>\n\n\n\n<p>Next, get the access point IP address using the <span class=\"rnthl rntliteral\">softAPIP()<\/span> method and print it in the Serial Monitor.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>IPAddress IP = WiFi.softAPIP();\nSerial.print(\"AP IP address: \");\nSerial.println(IP);<\/code><\/pre>\n\n\n\n<p class=\"rntbox rntclblue\"><strong>Note: <\/strong> by default, the access point IP address is 192.168.4.1<\/p>\n\n\n\n<p>These are the snippets of code you need to include in your web server sketches to set the ESP8266 as a soft access point.<\/p>\n\n\n\n<p>To learn how the full web server code works, read: <a href=\"https:\/\/randomnerdtutorials.com\/esp8266-dht11dht22-temperature-and-humidity-web-server-with-arduino-ide\/\">ESP8266 NodeMCU DHT11\/DHT22 Temperature and Humidity Web Server with Arduino IDE<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Parts Required<\/h2>\n\n\n\n<p>To proceed with this tutorial, you need the following parts:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a rel=\"noreferrer noopener\" href=\"https:\/\/makeradvisor.com\/tools\/esp8266-esp-12e-nodemcu-wi-fi-development-board\/\" target=\"_blank\">ESP8266 development board<\/a>&nbsp;(read&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/makeradvisor.com\/best-esp8266-wi-fi-development-board\/\" target=\"_blank\">ESP8266 development boards comparison<\/a>)<\/li><li><a rel=\"noreferrer noopener\" href=\"https:\/\/makeradvisor.com\/tools\/dht22-temperature-humidity-sensor\/\" target=\"_blank\">DHT22<\/a>&nbsp;or&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/makeradvisor.com\/tools\/dht11-temperature-humidity-sensor\/\" target=\"_blank\">DHT11<\/a>&nbsp;Temperature and Humidity Sensor<\/li><li><a rel=\"noreferrer noopener\" href=\"https:\/\/makeradvisor.com\/tools\/resistors-kits\/\" target=\"_blank\">4.7k Ohm Resistor<\/a><\/li><li><a rel=\"noreferrer noopener\" href=\"https:\/\/makeradvisor.com\/tools\/mb-102-solderless-breadboard-830-points\/\" target=\"_blank\">Breadboard<\/a><\/li><li><a href=\"https:\/\/makeradvisor.com\/tools\/jumper-wires-kit-120-pieces\/\" target=\"_blank\" rel=\"noreferrer noopener\">Jumper wires<\/a><\/li><\/ul>\n\n\n<p>You can use the preceding links or go directly to <a href=\"https:\/\/makeradvisor.com\/tools\/?utm_source=rnt&utm_medium=post&utm_campaign=post\" target=\"_blank\">MakerAdvisor.com\/tools<\/a> to find all the parts for your projects at the best price!<\/p><p style=\"text-align:center;\"><a href=\"https:\/\/makeradvisor.com\/tools\/?utm_source=rnt&utm_medium=post&utm_campaign=post\" target=\"_blank\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/10\/header-200.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\"><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Schematic Diagram<\/h2>\n\n\n\n<p>Assemble all the parts by following the next schematic diagram:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"642\" height=\"826\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/06\/esp8266-dht.png?resize=642%2C826&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP8266 NodeMCU Access Point (AP) Web Server Circuit Schematic Diagram DHT sensor\" class=\"wp-image-86097\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/06\/esp8266-dht.png?w=642&amp;quality=100&amp;strip=all&amp;ssl=1 642w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/06\/esp8266-dht.png?resize=233%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 233w\" sizes=\"(max-width: 642px) 100vw, 642px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Connecting to the ESP8266 Access Point<\/h2>\n\n\n\n<p>Having the ESP8266 running the sketch, in your smartphone open your Wi-Fi settings and tap the&nbsp;<strong>ESP8266-Access-Point&nbsp;<\/strong>network:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"632\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/09\/connect-to-ESP8266-access-point.png?resize=300%2C632&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Connect to ESP8266 NodeMCU Access Point (AP Mode)\" class=\"wp-image-89229\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/09\/connect-to-ESP8266-access-point.png?w=300&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/09\/connect-to-ESP8266-access-point.png?resize=142%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 142w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/figure><\/div>\n\n\n\n<p>Enter the password you\u2019ve defined earlier.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"242\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/09\/ESP8266-access-point-enter-password.png?resize=300%2C242&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP8266 NodeMCU Access Point (AP) Enter Password\" class=\"wp-image-89230\"\/><\/figure><\/div>\n\n\n\n<p>Open your web browser and type the IP address <strong>http:\/\/192.168.4.1<\/strong>. The web server page should load:<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"632\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/09\/ESP8266-Web-Server-Access-Point.png?resize=300%2C632&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP8266 NodeMCU Access Point Web Server using Arduino IDE\" class=\"wp-image-89231\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/09\/ESP8266-Web-Server-Access-Point.png?w=300&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/09\/ESP8266-Web-Server-Access-Point.png?resize=142%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 142w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/figure><\/div>\n\n\n\n<p>The web server page is a bit different from the <a href=\"https:\/\/randomnerdtutorials.com\/esp8266-dht11dht22-temperature-and-humidity-web-server-with-arduino-ide\/\">original web server<\/a>. That web server displays two icons next to the temperature and humidity. Those icons are loaded from the Font Awesome website. However, because the ESP8266 acts a soft access point (it is not connected to the internet) we cannot load those icons.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Wrapping Up<\/h2>\n\n\n\n<p>In this tutorial you&#8217;ve learned how to set the ESP8266 as a soft access point. This allows you to connect to the ESP8266 web server directly via Wi-Fi without the need to connect to a router.<\/p>\n\n\n\n<p>However, note that the ESP8266 is not connected to the internet, so you can&#8217;t make HTTP requests to other services to publish sensor data or to get data from the internet (like loading the icons).<\/p>\n\n\n\n<p>You may also like reading:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/randomnerdtutorials.com\/esp8266-web-server\/\">ESP8266 Web Server Control Outputs<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/esp8266-web-server-spiffs-nodemcu\/\">ESP8266 Web Server using SPIFFS (SPI Flash File System) \u2013 NodeMCU<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/visualize-esp32-esp8266-sensor-readings-from-anywhere\/\">Visualize Your Sensor Readings from Anywhere in the World (ESP32\/ESP8266 + MySQL + PHP)<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/home-automation-using-esp8266\/\"><strong>Home Automation using ESP8266 (course)<\/strong><\/a><\/li><\/ul>\n\n\n\n<p>Thanks for reading.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you&#8217;ll learn how to set your ESP8266 NodeMCU as an Access Point (AP) using Arduino IDE. This allows you to connect directly to your ESP8266 via Wi-Fi &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"ESP8266 NodeMCU Access Point (AP) for Web Server\" class=\"read-more button\" href=\"https:\/\/randomnerdtutorials.com\/esp8266-nodemcu-access-point-ap-web-server\/#more-89227\" aria-label=\"Read more about ESP8266 NodeMCU Access Point (AP) for Web Server\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":5,"featured_media":89258,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[265,214,246,300,240,264],"tags":[],"class_list":["post-89227","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-esp8266-project","category-esp8266","category-esp8266-arduino-ide","category-0-esp8266","category-esp8266-projects","category-project"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/09\/Set-ESP8266-as-an-Access-Point.jpg?fit=1280%2C720&quality=100&strip=all&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/89227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/comments?post=89227"}],"version-history":[{"count":0,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/89227\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/89258"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=89227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=89227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=89227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}