ESP8266 WiFi Bee: Connecting to an Access Point with AT commands

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


Introduction

The objective of this post is to explain how to connect to an access point using a WiFi Bee board and the pre-loaded firmware that supports AT commands. We will use the Arduino IDE serial monitor to interact with the module. You can check this previous post for an introduction to using the AT Commands.


Interaction with the module

After connecting the WiFi Bee and opening the serial monitor, we should have it ready to receive the commands. But, just to confirm, we will first send an AT command. As indicated in figure 1, the output should be OK.

WiFi Bee ready AT command

Figure 1 – Output of the AT command.

Next, we will list the available access points, to confirm that the one to which we want to connect is being detected by the WiFi Bee. To do so, send the AT+CWLAP command. You should get an output similar to figure 2, where the APs and some additional information (encryption type, MAC and channel) are shown.

WiFi Bee get available APs

Figure 2 – List of available Access Points and additional information.

So, if your WiFi network is listed, you should be able to connect to it. To connect to a WiFi network, use the following command, replacing the string between quotes with your network credentials:

AT+CWJAP=”yourNetworkName”,”yourNetworkPassword”

If everything works fine, you should get an OK answer, as indicated in figure 3.

WiFi Bee connect to AP command

Figure 3 – Connection to an Access Point, using AT commands.

To confirm that we are connected, we will now get the IP of the ESP8266 on the WiFi network. To do so, we just need to send the AT+CIFSR command. As indicated in figure 4, it returns not only the IP address of the device on the network, but also its MAC address.

WiFi Bee AT commands get IP

Figure 4 – Output of the command to get the IP of the ESP8266 on the network.

Finally, we will disconnect from the AP using the AT+CWQAP command. As indicated in figure 5, this command returns OK on success. Also, if we try to get the IP address again, the device will no longer have a valid one assigned.

WiFi Bee AT command quit AP

Figure 5 – Disconnecting from the WiFi network with an AT command.


Related content

Advertisements
This entry was posted in ESP8266 and tagged , , , , . Bookmark the permalink.

4 Responses to ESP8266 WiFi Bee: Connecting to an Access Point with AT commands

  1. dfrobots says:

    Reblogged this on DFRobot and commented:
    great esp8266 tutorials

    Liked by 1 person

  2. dfrobots says:

    helpful blog, it’s amazing, thank you

    Liked by 1 person

  3. Pingback: ESP8266 WiFi Bee: Setting an Access Point with AT commands | techtutorialsx

  4. Pingback: ESP8266 WiFi Bee: Connecting to an Access Point with AT commands – ToberWell

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s