Microcontroller Tutorials

Arduino, Raspberry Pi, PIC, Beaglebone Resources

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.

10 thoughts on “Creating NodeMCU WiFi Access Point

    1. Hi Nox,

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

  1. 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!

  2. Is it just me or am I supposed to re-upload the webserver sketch every time I make change the AP sketch?
    It looks to me as though I do.
    I haven't been able to change the password and just upload the AP. If I make changes to the AP it gets stuck making periods [. . .], but if I
    1) upload the webserver sketch and then
    2) upload the modified AP sketch then
    3) everything goes along per plan.

  3. Great tutorial again! One mistake I made when tried the code is that the SSID was not changed from default if password is shorter then 8 characters.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.