I want to turn my ESP8266 into an access point so that I can connect directly to it.
I use the following sketch, but when I select
GENERIC module ESP8266 from menu, the libraries ESP8266WiFi.h and ESP8266WebServer.h become available but I was unable to upload the sketch.
Also when I select board as Arduino Uno (Which i have really) and then what to upload then the above two files becomes unavailable and says fatal error no such file... no idea what to do next.
#include <ESP8266wifi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include<WiFi.h>
#include<SoftwareSerial.h>
SoftwareSerial esp(2,3);
IPAddress local_IP(192,168,4,22);
IPAddress gateway(192,168,4,9);
IPAddress subnet(255,255,255,0);
String ssid="Wisal";
String pass="12345678";
ESP8266WebServer server(80);
boolean isAccessPointCreated=false;
void setup(){
esp.begin(115200);
Serial.begin(115200);
WiFi.mode(WIFI_AP);
Serial.print("Setting soft-AP configuration ... ");
Serial.println(WiFi.softAPConfig(local_IP, gateway, subnet) ? "Ready" : "Failed!");
Serial.print("Setting soft-AP ... ");
Serial.println(WiFi.softAP("ESPsoftAP_01") ? "Ready" : "Failed!");
Serial.print("Soft-AP IP address = ");
Serial.println(WiFi.softAPIP());
}
void loop(){
while(esp.available()>0){
char a = esp.read();
if(a == '\0')
continue;
if(a != '\r' && a != '\n' && (a < 32))
continue;
Serial.print(a);
}
}