$USD
  • EUR€
  • £GBP
  • $USD
TUTORIALS ESP8266

ESP8266 WiFi Bee: Setting an Access Point with AT commands

DFRobot May 23 2017 855

The objective of this post is to explain how to set an access point using a ESP8266 WiFi Bee board from DFRobot and the pre-loaded firmware that supports AT commands.

Introduction

The objective of this post is to explain how to set an access point using a ESP8266 WiFi Bee board from DFRobot and the pre-loaded firmware that supports AT commands. We will use the Arduino IDE serial monitor to send the commands to the board.


Interacting with the module

As usual, after opening the serial monitor and receiving the ready message, we will send the AT command, just to confirm that we can talk to the WiFi Bee and we get an answer.
After that, we will set the WiFi mode, so the device operates both as station and access point. To do so, we just send the following command:
AT+CWMODE=3
We should get an OK message, as indicated in figure 1. Please note that more WiFi modes are supported. The various options are documented in the AT command firmware manual.


Figure 1 – Output of the AT command to set the WiFi mode.
Then, we will configure the access point we are setting with the AT+CWSAP command. This command receives as parameters the name of the network we are setting, the password, the channel and the encryption mode. Note that this last parameter is passed as a number, with the options available listed bellow:
0 – Open
2 – WPA_PSK
3 – WPA2_PSK
4 – WPA_WPA2_PSK
We are going to call our network “ESP”, set a password equal to “password”, define channel 1 and encryption type equal to WPA_WPA2_PSK. Check the command we need to send to the device bellow:
AT+CWSAP=”ESP”,”password”,1,4
The result of the command is shown in figure 2. As can be seen, an OK message should be returned if everything is correctly configured.

Figure 2 – Setting the AP configurations.
Our new network should be accessible from other devices. As can be seen in figure 3, it shows on Windows 8 available networks. Connect to it from a device using the previously defined password.

Figure 3 – Created WiFi network showing on the list of available networks in Windows 8.
To finish this tutorial, we will check the IP of devices that have joined the network. To do so, we just sent the AT+CWLIF command. As can be seen in the figure bellow, both the IP assigned to the device and its MAC are shown.

Figure 4 – IP and MAC addresses of the device previously connected to the ESP8266 access point.

Related content

ESP8266 WiFi Bee at DFRobot store
WiFi Bee ESP8266 Wiki


NOTE: This article is written by Nuno Santos who is an kindly Electrotecnics and Computers Engineer. live in Lisbon, Portugal. you could check the original article here.
He had written many useful tutorials and projects about ESP32, ESP8266, If you are interested, you could check his blog to know more.

REVIEW