{"id":67766,"date":"2018-08-09T09:08:27","date_gmt":"2018-08-09T09:08:27","guid":{"rendered":"http:\/\/randomnerdtutorials.com\/?p=67766"},"modified":"2019-04-23T09:12:43","modified_gmt":"2019-04-23T09:12:43","slug":"esp32-access-point-ap-web-server","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/esp32-access-point-ap-web-server\/","title":{"rendered":"How to Set an ESP32 Access Point (AP) for Web Server"},"content":{"rendered":"\n<p>The ESP32 can act as a Wi-Fi station, as an access point, or both. In this tutorial we&#8217;ll show you how to set the ESP32 as an access point using Arduino IDE.<\/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\/2018\/07\/ESP32-access-point-1.jpg?resize=1200%2C675&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-67860\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/ESP32-access-point-1.jpg?w=1280&amp;quality=100&amp;strip=all&amp;ssl=1 1280w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/ESP32-access-point-1.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/ESP32-access-point-1.jpg?resize=768%2C432&amp;quality=100&amp;strip=all&amp;ssl=1 768w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/ESP32-access-point-1.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>In most projects with the ESP32, we connect the ESP32 to a wireless router (see our <a href=\"https:\/\/randomnerdtutorials.com\/esp32-web-server-arduino-ide\/\">ESP32 web server tutorial<\/a>). This way we can access the ESP32 through the local network. <\/p>\n\n\n\n<p>In this situation the router acts as an access point and the ESP32 is set as a station. In this scenario, you need to be connected to your router (local network) to control the ESP32.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"900\" height=\"452\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/esp32-station.png?resize=900%2C452&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-67836\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/esp32-station.png?w=900&amp;quality=100&amp;strip=all&amp;ssl=1 900w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/esp32-station.png?resize=300%2C151&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/esp32-station.png?resize=768%2C386&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/figure><\/div>\n\n\n\n<p>But if you set the ESP32 as an access point (hotspot), you can be connected to the ESP32 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 ESP32 as an access point you create its own Wi-Fi 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=\"800\" height=\"470\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/access-point.png?resize=800%2C470&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-67835\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/access-point.png?w=800&amp;quality=100&amp;strip=all&amp;ssl=1 800w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/access-point.png?resize=300%2C176&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/access-point.png?resize=768%2C451&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure><\/div>\n\n\n\n<p>Here we&#8217;ll show you how to set the ESP32 as an access point in your web server projects. This way, you don&#8217;t need to be connected to a router to control your ESP32. Because the ESP32 doesn&#8217;t connect further to a wired network (like your router), it is called soft-AP (soft Access Point).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing the ESP32 board in Arduino IDE<\/h2>\n\n\n\n<p>There\u2019s an add-on for the Arduino IDE that allows you to program the ESP32 using the Arduino IDE and its programming language. Follow one of the following tutorials to prepare your Arduino IDE:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/randomnerdtutorials.com\/installing-the-esp32-board-in-arduino-ide-windows-instructions\/\"><strong>Windows instructions<\/strong> &#8211; Installing the ESP32 Board in Arduino IDE<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/installing-the-esp32-board-in-arduino-ide-mac-and-linux-instructions\/\"><strong>Mac and Linux instructions<\/strong> &#8211;&nbsp;Installing the ESP32 Board in Arduino IDE<\/a><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">ESP32 Access Point<\/h2>\n\n\n\n<p>In this example, we&#8217;ll modify an <a href=\"https:\/\/randomnerdtutorials.com\/esp32-web-server-arduino-ide\/\">ESP32 Web Server<\/a> from a previous tutorial to add access point capabilities. What we&#8217;ll show you here can be used with any ESP32 web server example.<\/p>\n\n\n\n<p>Upload the sketch provided below to set the ESP32 as an access point.<\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">\/*********\n  Rui Santos\n  Complete project details at https:\/\/randomnerdtutorials.com  \n*********\/\n\n\/\/ Load Wi-Fi library\n#include &lt;WiFi.h&gt;\n\n\/\/ Replace with your network credentials\nconst char* ssid     = &quot;ESP32-Access-Point&quot;;\nconst char* password = &quot;123456789&quot;;\n\n\/\/ Set web server port number to 80\nWiFiServer server(80);\n\n\/\/ Variable to store the HTTP request\nString header;\n\n\/\/ Auxiliar variables to store the current output state\nString output26State = &quot;off&quot;;\nString output27State = &quot;off&quot;;\n\n\/\/ Assign output variables to GPIO pins\nconst int output26 = 26;\nconst int output27 = 27;\n\nvoid setup() {\n  Serial.begin(115200);\n  \/\/ Initialize the output variables as outputs\n  pinMode(output26, OUTPUT);\n  pinMode(output27, OUTPUT);\n  \/\/ Set outputs to LOW\n  digitalWrite(output26, LOW);\n  digitalWrite(output27, LOW);\n\n  \/\/ Connect to Wi-Fi network with SSID and password\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  server.begin();\n}\n\nvoid loop(){\n  WiFiClient client = server.available();   \/\/ Listen for incoming clients\n\n  if (client) {                             \/\/ If a new client connects,\n    Serial.println(&quot;New Client.&quot;);          \/\/ print a message out in the serial port\n    String currentLine = &quot;&quot;;                \/\/ make a String to hold incoming data from the client\n    while (client.connected()) {            \/\/ loop while the client's connected\n      if (client.available()) {             \/\/ if there's bytes to read from the client,\n        char c = client.read();             \/\/ read a byte, then\n        Serial.write(c);                    \/\/ print it out the serial monitor\n        header += c;\n        if (c == '\\n') {                    \/\/ if the byte is a newline character\n          \/\/ if the current line is blank, you got two newline characters in a row.\n          \/\/ that's the end of the client HTTP request, so send a response:\n          if (currentLine.length() == 0) {\n            \/\/ HTTP headers always start with a response code (e.g. HTTP\/1.1 200 OK)\n            \/\/ and a content-type so the client knows what's coming, then a blank line:\n            client.println(&quot;HTTP\/1.1 200 OK&quot;);\n            client.println(&quot;Content-type:text\/html&quot;);\n            client.println(&quot;Connection: close&quot;);\n            client.println();\n            \n            \/\/ turns the GPIOs on and off\n            if (header.indexOf(&quot;GET \/26\/on&quot;) &gt;= 0) {\n              Serial.println(&quot;GPIO 26 on&quot;);\n              output26State = &quot;on&quot;;\n              digitalWrite(output26, HIGH);\n            } else if (header.indexOf(&quot;GET \/26\/off&quot;) &gt;= 0) {\n              Serial.println(&quot;GPIO 26 off&quot;);\n              output26State = &quot;off&quot;;\n              digitalWrite(output26, LOW);\n            } else if (header.indexOf(&quot;GET \/27\/on&quot;) &gt;= 0) {\n              Serial.println(&quot;GPIO 27 on&quot;);\n              output27State = &quot;on&quot;;\n              digitalWrite(output27, HIGH);\n            } else if (header.indexOf(&quot;GET \/27\/off&quot;) &gt;= 0) {\n              Serial.println(&quot;GPIO 27 off&quot;);\n              output27State = &quot;off&quot;;\n              digitalWrite(output27, LOW);\n            }\n            \n            \/\/ Display the HTML web page\n            client.println(&quot;&lt;!DOCTYPE html&gt;&lt;html&gt;&quot;);\n            client.println(&quot;&lt;head&gt;&lt;meta name=\\&quot;viewport\\&quot; content=\\&quot;width=device-width, initial-scale=1\\&quot;&gt;&quot;);\n            client.println(&quot;&lt;link rel=\\&quot;icon\\&quot; href=\\&quot;data:,\\&quot;&gt;&quot;);\n            \/\/ CSS to style the on\/off buttons \n            \/\/ Feel free to change the background-color and font-size attributes to fit your preferences\n            client.println(&quot;&lt;style&gt;html { font-family: Helvetica; display: inline-block; margin: 0px auto; text-align: center;}&quot;);\n            client.println(&quot;.button { background-color: #4CAF50; border: none; color: white; padding: 16px 40px;&quot;);\n            client.println(&quot;text-decoration: none; font-size: 30px; margin: 2px; cursor: pointer;}&quot;);\n            client.println(&quot;.button2 {background-color: #555555;}&lt;\/style&gt;&lt;\/head&gt;&quot;);\n            \n            \/\/ Web Page Heading\n            client.println(&quot;&lt;body&gt;&lt;h1&gt;ESP32 Web Server&lt;\/h1&gt;&quot;);\n            \n            \/\/ Display current state, and ON\/OFF buttons for GPIO 26  \n            client.println(&quot;&lt;p&gt;GPIO 26 - State &quot; + output26State + &quot;&lt;\/p&gt;&quot;);\n            \/\/ If the output26State is off, it displays the ON button       \n            if (output26State==&quot;off&quot;) {\n              client.println(&quot;&lt;p&gt;&lt;a href=\\&quot;\/26\/on\\&quot;&gt;&lt;button class=\\&quot;button\\&quot;&gt;ON&lt;\/button&gt;&lt;\/a&gt;&lt;\/p&gt;&quot;);\n            } else {\n              client.println(&quot;&lt;p&gt;&lt;a href=\\&quot;\/26\/off\\&quot;&gt;&lt;button class=\\&quot;button button2\\&quot;&gt;OFF&lt;\/button&gt;&lt;\/a&gt;&lt;\/p&gt;&quot;);\n            } \n               \n            \/\/ Display current state, and ON\/OFF buttons for GPIO 27  \n            client.println(&quot;&lt;p&gt;GPIO 27 - State &quot; + output27State + &quot;&lt;\/p&gt;&quot;);\n            \/\/ If the output27State is off, it displays the ON button       \n            if (output27State==&quot;off&quot;) {\n              client.println(&quot;&lt;p&gt;&lt;a href=\\&quot;\/27\/on\\&quot;&gt;&lt;button class=\\&quot;button\\&quot;&gt;ON&lt;\/button&gt;&lt;\/a&gt;&lt;\/p&gt;&quot;);\n            } else {\n              client.println(&quot;&lt;p&gt;&lt;a href=\\&quot;\/27\/off\\&quot;&gt;&lt;button class=\\&quot;button button2\\&quot;&gt;OFF&lt;\/button&gt;&lt;\/a&gt;&lt;\/p&gt;&quot;);\n            }\n            client.println(&quot;&lt;\/body&gt;&lt;\/html&gt;&quot;);\n            \n            \/\/ The HTTP response ends with another blank line\n            client.println();\n            \/\/ Break out of the while loop\n            break;\n          } else { \/\/ if you got a newline, then clear currentLine\n            currentLine = &quot;&quot;;\n          }\n        } else if (c != '\\r') {  \/\/ if you got anything else but a carriage return character,\n          currentLine += c;      \/\/ add it to the end of the currentLine\n        }\n      }\n    }\n    \/\/ Clear the header variable\n    header = &quot;&quot;;\n    \/\/ Close the connection\n    client.stop();\n    Serial.println(&quot;Client disconnected.&quot;);\n    Serial.println(&quot;&quot;);\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\/ESP32\/ESP32_Web_Server_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 ESP32. In this example we&#8217;re setting the ESP32 SSID name to <span class=\"rnthl rntliteral\">ESP32-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>\/\/ You can customize the SSID name and change the password\nconst char* ssid = \"ESP32-Access-Point\";\nconst char* password = \"123456789\";<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Setting the ESP32 as an Access Point<\/h3>\n\n\n\n<p>There\u2019s a section in the <span class=\"rnthl rntliteral\">setup()<\/span> to set the ESP32 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&#8217;s 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 63 characters;<\/li><li><span class=\"rnthl rntliteral\">password<\/span>(defined earlier): minimum of 8 characters; set to NULL if you want the access point to be open<\/li><li><span class=\"rnthl rntliteral\">channel<\/span>: Wi-Fi channel number (1-13)<\/li><li><span class=\"rnthl rntliteral\">ssid_hidden<\/span>: (0 = broadcast SSID, 1 = hide SSID)<\/li><li><span class=\"rnthl rntliteral\">max_connection<\/span>: maximum simultaneous connected clients (1-4)<\/li><\/ul>\n\n\n\n<p>Next, we need to 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>These are the snippets of code you need to include in your web server sketches to set the ESP32 as an access point. To learn how the full web server code works, take a look at the <a href=\"https:\/\/randomnerdtutorials.com\/esp32-web-server-arduino-ide\/\">ESP32 Web Server tutorial<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Parts Required<\/h2>\n\n\n\n<p>For this tutorial you&#8217;ll need the following parts:<\/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=\"500\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/esp32-web-server-arduino-ide-parts-required.jpg?resize=750%2C500&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-67768\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/esp32-web-server-arduino-ide-parts-required.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/esp32-web-server-arduino-ide-parts-required.jpg?resize=300%2C200&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/makeradvisor.com\/tools\/esp32-dev-board-wi-fi-bluetooth\/\" target=\"_blank\" rel=\"noreferrer noopener\">ESP32 development board<\/a>&nbsp;&#8211;&nbsp;&nbsp;<a href=\"https:\/\/makeradvisor.com\/esp32-development-boards-review-comparison\/\" target=\"_blank\" rel=\"noreferrer noopener\">read ESP32 Development Boards Review and Comparison<\/a><\/li><li><a href=\"https:\/\/makeradvisor.com\/tools\/3mm-5mm-leds-kit-storage-box\/\" target=\"_blank\" rel=\"noreferrer noopener\">2x 5mm LED<\/a><\/li><li><a href=\"https:\/\/makeradvisor.com\/tools\/resistors-kits\/\" target=\"_blank\" rel=\"noreferrer noopener\">2x 330 Ohm resistor<\/a><\/li><li><a href=\"https:\/\/makeradvisor.com\/tools\/mb-102-solderless-breadboard-830-points\/\" target=\"_blank\" rel=\"noreferrer noopener\">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<\/h2>\n\n\n\n<p>Start by building the circuit. Connect two LEDs to the ESP32 as shown in the following schematic diagram \u2013 one LED connected to <span class=\"rnthl rntcblue\">GPIO 26<\/span>, and the other to <span class=\"rnthl rntcblue\">GPIO 27<\/span>.<\/p>\n\n\n\n<p><strong>Note<\/strong>: We&#8217;re using the ESP32 DEVKIT DOIT board with 36 pins. Before assembling the circuit, make sure you check the pinout for the board you&#8217;re using.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"984\" height=\"700\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/esp32_web_server_schematic.png?resize=984%2C700&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-67732\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/esp32_web_server_schematic.png?w=984&amp;quality=100&amp;strip=all&amp;ssl=1 984w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/esp32_web_server_schematic.png?resize=300%2C213&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/esp32_web_server_schematic.png?resize=768%2C546&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 984px) 100vw, 984px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">ESP32 IP Address<\/h2>\n\n\n\n<p>Upload the code to your ESP32 (make sure you have the right board and COM port selected). Open the Serial Monitor at a baud rate of 115200. Press the ESP32 &#8220;Enable&#8221; button.<\/p>\n\n\n\n<p>The IP address you need to access the ESP32 point will be printed. In this case, it is <strong>192.168.4.1<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"739\" height=\"445\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/ip-address-ap.png?resize=739%2C445&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-67819\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/ip-address-ap.png?w=739&amp;quality=100&amp;strip=all&amp;ssl=1 739w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/ip-address-ap.png?resize=300%2C181&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 739px) 100vw, 739px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Connecting to the ESP32 Access Point<\/h2>\n\n\n\n<p>Having the ESP32 running the new sketch, in your smartphone open your Wi-Fi settings and tap the&nbsp;<strong>ESP32-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=\"600\" height=\"667\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/ESP32-access-point.jpg?resize=600%2C667&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-67822\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/ESP32-access-point.jpg?w=600&amp;quality=100&amp;strip=all&amp;ssl=1 600w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/ESP32-access-point.jpg?resize=270%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 270w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/figure><\/div>\n\n\n\n<p>Enter the password you&#8217;ve defined earlier in the code.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"288\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/access-point-password.jpg?resize=400%2C288&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-67823\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/access-point-password.jpg?w=400&amp;quality=100&amp;strip=all&amp;ssl=1 400w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/access-point-password.jpg?resize=300%2C216&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 400px) 100vw, 400px\" \/><\/figure><\/div>\n\n\n\n<p>Open your web browser and type the IP address 192.168.4.1. 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=\"399\" height=\"411\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/esp32-web-server-apoint.jpg?resize=399%2C411&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-67825\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/esp32-web-server-apoint.jpg?w=399&amp;quality=100&amp;strip=all&amp;ssl=1 399w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/esp32-web-server-apoint.jpg?resize=291%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 291w\" sizes=\"(max-width: 399px) 100vw, 399px\" \/><\/figure><\/div>\n\n\n\n<p>To connect to the access point on your computer, go to the Network and Internet Settings and select the &#8220;<strong>ESP32-Access-Point<\/strong>&#8220;.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"360\" height=\"623\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/esp32-access-point-pc.png?resize=360%2C623&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-67826\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/esp32-access-point-pc.png?w=360&amp;quality=100&amp;strip=all&amp;ssl=1 360w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/esp32-access-point-pc.png?resize=173%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 173w\" sizes=\"(max-width: 360px) 100vw, 360px\" \/><\/figure><\/div>\n\n\n\n<p>Insert the password you&#8217;ve 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=\"359\" height=\"620\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/connect-access-point-pc.png?resize=359%2C620&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-67827\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/connect-access-point-pc.png?w=359&amp;quality=100&amp;strip=all&amp;ssl=1 359w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/connect-access-point-pc.png?resize=174%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 174w\" sizes=\"(max-width: 359px) 100vw, 359px\" \/><\/figure><\/div>\n\n\n\n<p>And it&#8217;s done! Now, to access the ESP32 web server page, you just need to type the ESP32 IP address on your browser.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Wrapping Up<\/h2>\n\n\n\n<p>This simple tutorial showed you how to set the ESP32 as an access point on your web server sketches. When the ESP32 is set as an access point, devices with Wi-Fi capabilities can connect directly to the ESP32 without the need to connect to a router.<\/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\/learn-esp32-with-arduino-ide\/\"><strong>Learn ESP32 with Arduino IDE (course)<\/strong><\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-web-server-arduino-ide\/\">ESP32 Web Server<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-data-logging-temperature-to-microsd-card\/\">ESP32 Data Logging Temperature to MicroSD Card<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-dc-motor-l298n-motor-driver-control-speed-direction\/\">ESP32 with DC Motor and L298N Motor Driver \u2013 Control Speed and Direction<\/a><\/li><\/ul>\n\n\n\n<p>We hope you\u2019ve found this tutorial useful.&nbsp;If you like ESP32 and you want to learn more, we recommend enrolling in&nbsp;<a href=\"https:\/\/randomnerdtutorials.com\/learn-esp32-with-arduino-ide\/\"><strong>Learn ESP32 with Arduino IDE<\/strong>&nbsp;course<\/a>.<\/p>\n\n\n\n<p>Thanks for reading.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The ESP32 can act as a Wi-Fi station, as an access point, or both. In this tutorial we&#8217;ll show you how to set the ESP32 as an access point using &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to Set an ESP32 Access Point (AP) for Web Server\" class=\"read-more button\" href=\"https:\/\/randomnerdtutorials.com\/esp32-access-point-ap-web-server\/#more-67766\" aria-label=\"Read more about How to Set an ESP32 Access Point (AP) for Web Server\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":5,"featured_media":67860,"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":[276,281,277,299,264],"tags":[],"class_list":["post-67766","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-esp32","category-esp32-project","category-esp32-arduino-ide","category-0-esp32","category-project"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2018\/07\/ESP32-access-point-1.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\/67766","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=67766"}],"version-history":[{"count":0,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/67766\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/67860"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=67766"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=67766"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=67766"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}