Home / Tutorials / ESP8266 Tutorial / Creating NodeMCU WiFi Access Point
NodeMCU WiFi Access Point

Creating NodeMCU WiFi Access Point

You can use WiFi with the NodeMCU (ESP8266) even without a WiFi router. All you need to do is create a NodeMCU WiFi Access Point and the device will now act as a WiFi gateway.

NodeMCU WiFi Access Point Code

For this tutorial, we will modify the code shown on my NodeMCU web server article. The example code below also uses the same schematic (a LED on D7).

You'll see that we used WiFi.softAP() instead of WiFi.begin() (on line 22) --- this creates the NodeMCU WiFi access point. Then to print the NodeMCU's ip, which we need to view the server page, we use WiFi.softAPIP() (line 34).

Upload the code above to your NodeMCU. If successful, the device should be visible as a WiFi access point with the SSID and password you specified in the code above.

You can also use this method to send data between two NodeMCUs. Basically, one device acts as a client and one as a server and also as the access point. The data will only be between the two and so will be much more secure compared to having a WiFi gateway/router.

Check Also

nodemcu ajax dynamic sensor data

Log Data with NodeMCU and Google Sheets

Most of the time, the data from a sensor in an IoT application needs to …

5 comments

  1. I can access the webserver but LED is not reacting, not working!

    • Hi Nox,

      Did you use the same code and schematic in this tutorial? I would like to help you make it work

  2. I used the same code as you, but my serial monitor just gave me some questionmarks and nothing else.

  3. Great tutorial man! Thanks! It's working perfectly. I just had to set up my baudrate, so the serial monitor appears correctly.

    Keep up the good work!

Leave a Reply

Your email address will not be published. Required fields are marked *