ESP8266: Configure as an Access Point

Wire & configure ESP8266 ESP07 Wi-Fi Module

The ESP8266 Wi-Fi module can function as an Access Point allowing other Stations / Clients to connect to it like they would to any router. Prior to setting up the module for use wire & configure ESP8266 module. Besides configuring the module as an Access Point it is possible to configure ESP8266 module as a Client / Station or both modes simultaneously.

 

Setup ESP8266 as an Access Point

Set SSID, password, channel and encryption.

AT+CWSAP="ESP8266","123",3,0

SSID is the network name that will appear when connecting to the wireless network. The password will be required except when encryption mode is set to OPEN. The channel is the network channel that will be used by the module. Security mode is set with the encryption parameter and can be one of four modes. To allow connections without a password set encryption parameter to 0 which is OPEN mode. To allow only users with a valid password, set encryption to 1, 23 or 4. These encryption modes correspond to WEPWPA-PSKWPA2-PSK and WPA/WPA2-PSK with WPA2-PSK being the most secure and common for general use.

 

Verify that the AP settings have been set correctly.

AT+CWSAP?

 

Set ESP8266 Access Point IP Address

Get the IP address of the Access Point.

AT+CIPAP?

 

Set the IP address of the Access Point.

AT+CIPAP="192.168.0.101"

 

Set ESP8266 Access Point MAC Address

Get the MAC address of the Access Point.

AT+CIPAP?

 

Set the MAC address of the Access Point.

AT+CIPAPMAC="1a:fe:34:a4:35:42"

 

Toggle ESP8266 DHCP Mode

Enable DHCP for AP mode.

AT+CWDHCP=0,0

DHCP can be set for different modes by setting the first parameter. Apply DHCP setting to AP mode only with 0, Station mode only with 1 or both modes with 2. The second parameter can be set to 0 to enable or 1 to disable DHCP for selected modes.

 

Find Stations / Clients connected to ESP8266

Get IP addresses of all stations / clients that are connected to the AP.

AT+CWLIF

 

Once the module has been configured in AP or STA mode it can be used to send & receive data.

dom