Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By szpapas
#26108 Change a little bit on WifiManager.cpp :)

void WiFiManager::startWebConfig() {
DEBUG_PRINT("");
DEBUG_PRINT("WiFi connected");
DEBUG_PRINT(WiFi.localIP());
DEBUG_PRINT(WiFi.softAPIP());


/* <---- comment this block out
if (!mdns.begin(_apName, WiFi.localIP())) {
DEBUG_PRINT("Error setting up MDNS responder!");
while (1) {
delay(1000);
}
}
DEBUG_PRINT("mDNS responder started");
*/

// Start the server
server.begin();


===
int WiFiManager::serverLoop()
{
// Check for any mDNS queries and send responses
// mdns.update(); <--- comment this out

// Check if a client has connected
WiFiClient client = server.available();


Then upload again should be OK.
User avatar
By schufti
#26254 Hi,
just a little sidenote on the storage part:

it is not necessary to store the WiFi credentials. If you do a "WiFi.begin(ssid, pass)" with valid credentials and get connected, the esp fw stores them internal. The next time you can use "WiFi.begin("","")" and the esp fw will use the "last known good" credentials. If several attempts to (re)connect fail (or e.g. button is pressed at startup), it is time to fire up the config again.

Not a lot to spare but even simpler....
User avatar
By espman
#26976 Hi all!

I'm faceing a problem that i can't solve, i run into Error setting up MDNS responder!


I run into this problem with both great work (chriscook8's esp-arduino-apboot and also Alextu's WiFiManager)



This is the serial:


AutoConnect
Reading EEPROM SSID
SSID:
Reading EEPROM Password
Password:
Waiting for Wifi to connect
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

Could not connect to WiFi
Started Soft Access Point

WiFi connected
0.0.0.0
192.168.4.1
Error setting up MDNS responder!
User avatar
By notbot
#29587 Hi, maybe any of you guys can help me out - I can't get the library to compile. Error Message is:


Code: Select allWiFiManager.cpp: In member function 'boolean WiFiManager::captivePortal()':
WiFiManager.cpp:575:20: error: 'class ESP8266WebServer' has no member named 'hostHeader'
   if (!isIp(server.hostHeader()) ) {
                    ^
WiFiManager.cpp:577:82: error: 'class WiFiClient' has no member named 'localIP'
     server.sendHeader("Location", String("http://") + toStringIp(server.client().localIP()), true);


Did not read anything like that so far, so: Any ideas?