[GH-ISSUE #978] Most basic setup generates an AP whic i #832

Open
opened 2026-02-28 01:27:15 +03:00 by kerem · 0 comments
Owner

Originally created by @Ing-Med on GitHub (Dec 7, 2019).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/978

Basic Infos

The most basic setup provided by the example generates another SSID which i don't know where it comes from. I am able to connect, it gives away some IP on the 192.168.4.x subnet but, i cannot reach .1 of the subnet (ping works).
Data has been reset with wifiManager.resetSettings();, problem persists.

SSID Name is FaryLink_53D409 (only god knows where this name comes from, i searched everywhere).

WiFi.getmode() = 3, so it is WiFi_AP_STA
(which makes sense, but how can i change that?)

Hardware

WiFimanager Branch/Release:

  • Master
  • Development

Esp8266/Esp32:

  • ESP8266
  • ESP32

Hardware: ESP-12e, esp01, esp25

  • ESP01
  • ESP12 E/F/S (nodemcu, wemos, feather)
  • Other

ESP Core Version: 2.4.0, staging

  • 2.3.0
  • 2.4.0
  • staging (master/dev)
    ?

Description

see above

Settings in IDE

Module: Wemos D1
nothing more

Additional libraries:

Sketch

(reduced to relevant parts)


#include <Arduino.h>
#include <ezTime.h>
// #include <ESP8266WiFi.h>
#include <WiFiManager.h>
#include <String.h>
#include <Wire.h>  // Only needed for Arduino 1.6.5 and earlier
#include "SSD1306Wire.h" // legacy include: `#include "SSD1306.h"`
// #include "OLEDDisplayUi.h"
#include "images.h"
#include "secrets.h"
#include "JLInfoTicker.h"
#include <JsonStreamingParser.h>
#include "NewsApiClient.h"
#include <ESP8266TrueRandom.h>
#include <WS2812FX.h>
#include <Ticker.h>


void initWiFi()
{
  // WiFiManager wm;
  // wm.setDebugOutput(true);
  // wm.setHostname(DEVICE_HOSTNAME);
  // bool res;
  //   // res = wm.autoConnect(); // auto generated AP name from chipid
  //   // res = wm.autoConnect("AutoConnectAP"); // anonymous ap
  //   wm.setConfigPortalTimeout(120);
  //   wm.setConnectTimeout(20);
  //   res = wm.autoConnect("AutoConnectAP","password"); // password protected ap

  //   if(!res) {
  //       Serial.println("Failed to connect");
  //       ESP.restart();
  //   } 
  //   else {
  //       //if you get here you have connected to the WiFi    
  //       Serial.println("connected...yeey :)");
  //       WiFi.mode(WIFI_STA);
        
  //   }


  //WiFiManager
  //Local intialization. Once its business is done, there is no need to keep it around
  WiFiManager wifiManager;
  //reset settings - for testing
  // wifiManager.resetSettings();

  wifiManager.setDebugOutput(true);
  wifiManager.setHostname(DEVICE_HOSTNAME);

  //sets timeout until configuration portal gets turned off
  //useful to make it all retry or go to sleep
  //in seconds
  wifiManager.setTimeout(180);
  
  //fetches ssid and pass and tries to connect
  //if it does not connect it starts an access point with the specified name
  //here  "AutoConnectAP"
  //and goes into a blocking loop awaiting configuration
  if(!wifiManager.autoConnect("AutoConnectAP")) {
    Serial.println("failed to connect and hit timeout");
    delay(3000);
    //reset and try again, or maybe put it to deep sleep
    ESP.reset();
    delay(5000);
  } 

  //if you get here you have connected to the WiFi
  Serial.println("connected...yeey :)");




}



void initOLED()
{

  display.connect();
  display.init();
  display.clear();
    
}


void initSketch()
{
  Serial.begin(115200);
  Serial.println();
    debugSerial("InitLED");
    ws2812fx.init();
    ws2812fx.setBrightness(255);
    ws2812fx.setColor(0x30bdf0);
    ws2812fx.setSpeed(1000);
    ws2812fx.setMode(FX_MODE_STATIC);
    ws2812fx.start();
    ws2812fx.service();
  delay(3200);
  initOLED();    
  debugSerial("initOLED     DONE\n");
  display.drawXbm(34, 0, WiFi_Logo_width, WiFi_Logo_height, WiFi_Logo_bits);
  display.display();
  setInterval(180);
  initWiFi(); 
  
  debugSerial("initWIFI     DONE\t");
  Serial.print(WiFi.localIP());
  Serial.println("");
  getDecentNews();
  waitForSync();
  atTime.setLocation(F("de"));
  display.clear();
  display.setFont(Nimbus_Mono_L_Bold_14);
  display.setTextAlignment(TEXT_ALIGN_LEFT);
  display.drawString(0, 0, "WiFi:  ");
  display.drawString(0, 16, WiFi.SSID());
  display.display();
  
  display.display();
  delay(500);
  char buf[150];
  sprintf(buf, "initTime      DONE \t");
  debugSerial(buf);
  Serial.println( atTime.dateTime());
  display.clear();
}


void setup() {

  initSketch();
  lastUpdate = UTC.now();
  switchView = UTC.now();
  oldLED = 0;
  newLED = 0;
  
}

Debug Messages

||61ms|| InitLED
||3282ms|| initOLED     DONE    
[MEM] free: 43304 | max: 42576 | frag:   2%   
*WM: getCoreVersion():          2_5_2
[MEM] free: 43304 | max: 42576 | frag:   2%   
*WM: system_get_sdk_version():  2.2.1(cfd48f3)
[MEM] free: 43304 | max: 42576 | frag:   2%   
*WM: system_get_boot_version(): 6
[MEM] free: 43304 | max: 42576 | frag:   2% 
*WM: getFreeHeap():             43304       
[MEM] free: 43304 | max: 42576 | frag:   2% 
*WM: AutoConnect
[MEM] free: 43304 | max: 42576 | frag:   2% 
*WM: Setting hostname: DonkeyClock
[MEM] free: 42784 | max: 42576 | frag:   1%
*WM: reconnecting to set new hostname
[MEM] free: 42784 | max: 42576 | frag:   1% 
*WM: WIFI station disconnect
[MEM] free: 43664 | max: 42576 | frag:   3% 
*WM: Connecting as wifi client... 
[MEM] free: 43664 | max: 42576 | frag:   3%
*WM: STA static IP:
[MEM] free: 43664 | max: 42576 | frag:   3%
*WM: setSTAConfig static ip not set 
[MEM] free: 43664 | max: 42576 | frag:   3%
*WM: WIFI station disconnect
[MEM] free: 43664 | max: 42576 | frag:   3%
*WM: Connecting to SAVED AP: XXXXX
[MEM] free: 43664 | max: 42576 | frag:   3%
*WM: Using Password: xxxx
[MEM] free: 43664 | max: 42576 | frag:   3%
*WM: WiFi station enable
[MEM] free: 43664 | max: 42576 | frag:   3%
*WM: enableSTA PERSISTENT ON 
[MEM] free: 43432 | max: 42576 | frag:   2%
*WM: connectTimeout not set, ESP waitForConnectResult... 
[MEM] free: 43304 | max: 42576 | frag:   2% 
*WM: Connection result: WL_CONNECTED
[MEM] free: 43304 | max: 42576 | frag:   2% 
*WM: lastconxresult: WL_CONNECTED
[MEM] free: 43328 | max: 42576 | frag:   2%
*WM: AutoConnect: SUCCESS
[MEM] free: 43328 | max: 42576 | frag:   2%
*WM: STA IP Address: 10.10.10.106
[MEM] free: 43328 | max: 42576 | frag:   2% 
*WM: hostname: STA DonkeyClock
connected...yeey :)
[MEM] free: 43328 | max: 42576 | frag:   2% 
*WM: unloading

||8122ms|| initWIFI     DONE    10.10.10.106
Originally created by @Ing-Med on GitHub (Dec 7, 2019). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/978 #### Basic Infos The most basic setup provided by the example generates another SSID which i don't know where it comes from. I am able to connect, it gives away some IP on the 192.168.4.x subnet but, i cannot reach .1 of the subnet (ping works). Data has been reset with wifiManager.resetSettings();, problem persists. SSID Name is FaryLink_53D409 (only god knows where this name comes from, i searched everywhere). WiFi.getmode() = 3, so it is WiFi_AP_STA (which makes sense, but how can i change that?) #### Hardware **WiFimanager Branch/Release:** - [ ] Master - [x] Development **Esp8266/Esp32:** - [x] ESP8266 - [ ] ESP32 **Hardware: ESP-12e, esp01, esp25** - [ ] ESP01 - [x] ESP12 E/F/S (nodemcu, wemos, feather) - [ ] Other **ESP Core Version: 2.4.0, staging** - [ ] 2.3.0 - [ ] 2.4.0 - [ ] staging (master/dev) ? ### Description see above ### Settings in IDE Module: Wemos D1 nothing more Additional libraries: ### Sketch (reduced to relevant parts) ```cpp #include <Arduino.h> #include <ezTime.h> // #include <ESP8266WiFi.h> #include <WiFiManager.h> #include <String.h> #include <Wire.h> // Only needed for Arduino 1.6.5 and earlier #include "SSD1306Wire.h" // legacy include: `#include "SSD1306.h"` // #include "OLEDDisplayUi.h" #include "images.h" #include "secrets.h" #include "JLInfoTicker.h" #include <JsonStreamingParser.h> #include "NewsApiClient.h" #include <ESP8266TrueRandom.h> #include <WS2812FX.h> #include <Ticker.h> void initWiFi() { // WiFiManager wm; // wm.setDebugOutput(true); // wm.setHostname(DEVICE_HOSTNAME); // bool res; // // res = wm.autoConnect(); // auto generated AP name from chipid // // res = wm.autoConnect("AutoConnectAP"); // anonymous ap // wm.setConfigPortalTimeout(120); // wm.setConnectTimeout(20); // res = wm.autoConnect("AutoConnectAP","password"); // password protected ap // if(!res) { // Serial.println("Failed to connect"); // ESP.restart(); // } // else { // //if you get here you have connected to the WiFi // Serial.println("connected...yeey :)"); // WiFi.mode(WIFI_STA); // } //WiFiManager //Local intialization. Once its business is done, there is no need to keep it around WiFiManager wifiManager; //reset settings - for testing // wifiManager.resetSettings(); wifiManager.setDebugOutput(true); wifiManager.setHostname(DEVICE_HOSTNAME); //sets timeout until configuration portal gets turned off //useful to make it all retry or go to sleep //in seconds wifiManager.setTimeout(180); //fetches ssid and pass and tries to connect //if it does not connect it starts an access point with the specified name //here "AutoConnectAP" //and goes into a blocking loop awaiting configuration if(!wifiManager.autoConnect("AutoConnectAP")) { Serial.println("failed to connect and hit timeout"); delay(3000); //reset and try again, or maybe put it to deep sleep ESP.reset(); delay(5000); } //if you get here you have connected to the WiFi Serial.println("connected...yeey :)"); } void initOLED() { display.connect(); display.init(); display.clear(); } void initSketch() { Serial.begin(115200); Serial.println(); debugSerial("InitLED"); ws2812fx.init(); ws2812fx.setBrightness(255); ws2812fx.setColor(0x30bdf0); ws2812fx.setSpeed(1000); ws2812fx.setMode(FX_MODE_STATIC); ws2812fx.start(); ws2812fx.service(); delay(3200); initOLED(); debugSerial("initOLED DONE\n"); display.drawXbm(34, 0, WiFi_Logo_width, WiFi_Logo_height, WiFi_Logo_bits); display.display(); setInterval(180); initWiFi(); debugSerial("initWIFI DONE\t"); Serial.print(WiFi.localIP()); Serial.println(""); getDecentNews(); waitForSync(); atTime.setLocation(F("de")); display.clear(); display.setFont(Nimbus_Mono_L_Bold_14); display.setTextAlignment(TEXT_ALIGN_LEFT); display.drawString(0, 0, "WiFi: "); display.drawString(0, 16, WiFi.SSID()); display.display(); display.display(); delay(500); char buf[150]; sprintf(buf, "initTime DONE \t"); debugSerial(buf); Serial.println( atTime.dateTime()); display.clear(); } void setup() { initSketch(); lastUpdate = UTC.now(); switchView = UTC.now(); oldLED = 0; newLED = 0; } ``` ### Debug Messages ``` ||61ms|| InitLED ||3282ms|| initOLED DONE [MEM] free: 43304 | max: 42576 | frag: 2% *WM: getCoreVersion(): 2_5_2 [MEM] free: 43304 | max: 42576 | frag: 2% *WM: system_get_sdk_version(): 2.2.1(cfd48f3) [MEM] free: 43304 | max: 42576 | frag: 2% *WM: system_get_boot_version(): 6 [MEM] free: 43304 | max: 42576 | frag: 2% *WM: getFreeHeap(): 43304 [MEM] free: 43304 | max: 42576 | frag: 2% *WM: AutoConnect [MEM] free: 43304 | max: 42576 | frag: 2% *WM: Setting hostname: DonkeyClock [MEM] free: 42784 | max: 42576 | frag: 1% *WM: reconnecting to set new hostname [MEM] free: 42784 | max: 42576 | frag: 1% *WM: WIFI station disconnect [MEM] free: 43664 | max: 42576 | frag: 3% *WM: Connecting as wifi client... [MEM] free: 43664 | max: 42576 | frag: 3% *WM: STA static IP: [MEM] free: 43664 | max: 42576 | frag: 3% *WM: setSTAConfig static ip not set [MEM] free: 43664 | max: 42576 | frag: 3% *WM: WIFI station disconnect [MEM] free: 43664 | max: 42576 | frag: 3% *WM: Connecting to SAVED AP: XXXXX [MEM] free: 43664 | max: 42576 | frag: 3% *WM: Using Password: xxxx [MEM] free: 43664 | max: 42576 | frag: 3% *WM: WiFi station enable [MEM] free: 43664 | max: 42576 | frag: 3% *WM: enableSTA PERSISTENT ON [MEM] free: 43432 | max: 42576 | frag: 2% *WM: connectTimeout not set, ESP waitForConnectResult... [MEM] free: 43304 | max: 42576 | frag: 2% *WM: Connection result: WL_CONNECTED [MEM] free: 43304 | max: 42576 | frag: 2% *WM: lastconxresult: WL_CONNECTED [MEM] free: 43328 | max: 42576 | frag: 2% *WM: AutoConnect: SUCCESS [MEM] free: 43328 | max: 42576 | frag: 2% *WM: STA IP Address: 10.10.10.106 [MEM] free: 43328 | max: 42576 | frag: 2% *WM: hostname: STA DonkeyClock connected...yeey :) [MEM] free: 43328 | max: 42576 | frag: 2% *WM: unloading ||8122ms|| initWIFI DONE 10.10.10.106 ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#832
No description provided.