ESP8266 standalone AP mode web server

Hello,

the idea is to add the AP + Web server in ESP8266 standalone example.
as using the Original library https://github.com/vshymanskyy/ITEADLIB_Arduino_WeeESP8266
i can do this with small changes to the code but the original library not working with blynk.

the object is to be able to have portable projects.

the current scenario Blynk V3.1

i have Smart power strip with working ESP8266 + Relay
if i take my device to my friends house it will not work as the SSID and Password is hardcoded in the ESP sketch.

how it should be.

  • the ESP8266 will try to connect to the SSID that was hard-coded on
    the chip in the skitch.
  • if it failed because the SSID not available or any other reason , automatically it will change the ESP to AP mode and enable a web interface that will allow the user to connect to it and enter the new SSID and password.
  • the ESP8266 will restart and repeat the loop .

@vshymanskyy is this Idea deserve the effort or no?
please take a look.

Hi. I think even now it is possible, just use the .config() instead of .begin()
it will allow you to manage WiFi connection yourself.

In general, This configuration is very Unstable (ESP+Arduino).
This is really not problem of Blynk itself.

The scenario you describe is rather tricky to get working, and it will probably leave you with tiny or no space for “the logics of device operation”. If you use ESP standalone, it should be OK.

as i can see in the blynk-library/BlynkSimpleEsp8266.h

void config(const char* auth,
            const char* domain = BLYNK_DEFAULT_DOMAIN,
            uint16_t    port   = BLYNK_DEFAULT_PORT)
{
    Base::begin(auth);
    this->conn.begin(domain, port);
}

void config(const char* auth,
        	IPAddress   ip,
            uint16_t    port = BLYNK_DEFAULT_PORT)
{
    Base::begin(auth);
    this->conn.begin(ip, port);
}

Below is the example from lib v3.1 after change it

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";

void setup()
{
  Serial.begin(9600);
  //Blynk.begin(auth, "ssid", "pass");

     Blynk.config(192.168.4.1,80);

}

void loop()
{
  Blynk.run();
}

is this enough to make the example work with ability to manage the SSID and password or it need more codding as in the original library example.

No, now you just need to manage wifi connection and be sure to call Blynk.run(); only when connected…

I posted code a few days ago that will accomplish this: External ESP8266 Configuration

thanks i will take a look