AED 26.25
Low stock
1
Description
The ESP8266 ESP-01 is a Wi-Fi module that allows microcontrollers access to a Wi-Fi network. This module is a self-contained SOC (System On a chip) that doesn’t necessarily need a microcontroller to manipulate inputs and outputs as you would normally do with an Arduino, for example, because the ESP-01 acts as a small computer. Depending on the version of the ESP8266, it is possible to have up to 9 GPIOs (General Purpose Input Output). Then, we can give a microcontroller internet access like the Wi-Fi shield does to the Arduino, or we can simply program the ESP8266 to not only have access to a Wi-Fi network, but to act as a microcontroller as well. This makes the ESP8266 very versatile, and it can save you some money and space in your projects.
Photo:
Sample Code
# define to connect_ag_name "Wifi Address"
# define to connect_ag_ password "Wifi Password"
int led = 2 ;
void setup ()
{
Serial . begin ( 115200 ); // If the baudRate of the ESP module is 115200, this line is
//Serial.begin(9600); // If the baudRate of the ESP module is 9600, we use this line
Serial . printlin ( "AT" ); // check whether there is a connection to the ESP module.
pinMode ( 2 , OUTPUT );
delay ( 5000 ); // Wait 5 seconds for communication with the ESP module.
if ( Serial . find ( "OK" )) // If the connection to the ESP module is established, the AT reader returns us as OK
{
Serial . println ( "AT + in CWMO = 1" ); // We switch the ESP Module to Wifi Mode STA mode. This mode allows us to connect to other networks.
delay ( 2000 );
String ConnectionConnect = String ( "AT + CWJAP = \" " ) + connect_name + " \ ", \" " + connect_name_ " + "\" " ; // Sending network name and password to ESP module
Serial . println ;
delay ( 5000 );
}
Serial . print ( "AT + CIPMUX = 1 \ r \ n" ); // We switch the ESP Module to multi-link mode
delay ( 200 );
Serial . print ( "AT + CIPSERVER = 1.80 \ r \ n" ); // We use ESP in server mode and open port 80
delay ( 1000 );
}
void loop () {
if ( Serial . available ()> 0 ) {
if ( Serial . find (