Table of Contents


Diaoul's ESP8266 library

Diaoul's ESP8266 library is an actively maintained project providing a simple API to the ESP8266.

Example

Setup an access-point with SSID “ESP8266”:

#include <SoftwareSerial.h>
#include "ESP8266.h"
 
SoftwareSerial esp8266Serial = SoftwareSerial(10, 11);
ESP8266 wifi = ESP8266(esp8266Serial);
 
void setup() {
    Serial.begin(9600);
 
    esp8266Serial.begin(9600);
    wifi.begin();
    wifi.setTimeout(1000);
 
    if(wifi.setMode(ESP8266_WIFI_ACCESSPOINT) != ESP8266_COMMAND_OK) {
        Serial.println("Could not init AP.");
    }
 
    if(wifi.setAPConfiguration("ESP8266", "awesomelib", 10, ESP8266_ENCRYPTION_WPA_WPA2_PSK) != ESP8266_COMMAND_OK) {
        Serial.println("Could not configure AP.");
    }
    wifi.restart();
}
 
void loop() {
    for(;;) {
    }
}

Resources