Easy Access Point Configuration on ESP8266

One of the biggest advantages of using the ESP8266 in your projects is how easy it is to get WiFi up and running. Just plug in the WiFi library, put the SSID and encryption key in your source code, and away you go. It authenticates with your network in seconds and you can get on with building your project. But things get a little trickier if you want to take your project someplace else, or distribute your source code to others. Quickly we learn the downside of using static variables for authentication.

While there are already a few solutions to this problem out there, [Martin Raynsford] wasn’t too thrilled with them. Usually they put the ESP8266 in Access Point mode, allow the user to connect, and then ask which network they should authenticate with. But he didn’t want his projects to require an existing network, and figured he could do just as well making a field-configurable AP.

Using it is simple. Once the ESP8266 starts up it will create a new network in the form of “APConfig XXXXXX”, which should be easy enough to find from your client side device. Once connected, you can go to a simple administration page which allows you to configure a new AP name and encryption key. You even have the option to create an open AP by leaving the “Password” field blank. Once rebooted, the ESP8266 will create a new network with the defined parameters.

[Martin] has also included a “backdoor” to let anyone with physical access to the ESP8266 board create a new open AP that can be used to reconfigure the network settings. During boot up there is a brief period, indicated with specific blinks of the LED, wherein you can hit the reset button and trigger the open AP. This keeps you from getting locked out of your own project if you forget what key you gave it.

If you’re not one to go the austere route, take a look at some of the more robust solutions we’ve seen for easier end-user setup of the ESP8266.

18 thoughts on “Easy Access Point Configuration on ESP8266

    1. As he sasy in the article, he is aware of other solutions but they dont fit his requirements for simplicity so he did his own.

      Personally I typically hard code my creds in code and then keep records against the MAC.
      Sometimes I sent out such info on serial at boot, knowing it’s secure enough since if you are reading the serial port you either own or pwn the device anyway.

    1. OK so I have found myself wanting something a bit nicer than WiFi manager, but tbh it does the job. The NodeMCU boards I use have a flash button that is not used by anything. I set my projects up so that pressing the button puts it back into wifi config mode.

      1. For me, I am mainly interested in setting up a virgin device for the first time. I would completely disable smart config once setup or until I force a factory reset through MQTT/protected webpage/physical button. I don’t feel this would be too dissimilar to the setup of devices such as a Chromecast.

  1. This is the same approach I’ve seen on a number of WiFi routers: in order to avoid having to develop a user interface, they just serve Javascript pages, to be configured from another computer.

  2. OK, so I was confused as well initially. This is solely for an ESP8266 that you want to configure in AP mode always- not one that starts in AP mode, then gets reconfigured into STA mode.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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