Comments (2)
Does the mean that you want to reconnect automatically to the most recently connected access point?
AutoConnect will run WiFi.disconnect just before launching SoftAP. And it clears the last established SSID and password in the ESP8266 SDK, not in the Arduino core. Therefore, the last SSID and password that could be connected will be lost.
If you want to connect to the most recently established SSID, it is necessary to be either of following ways.
-
Change to ignore WiFi.disconnect() in AutoConnect.cpp.
However, this way is not recommended much. ESP8266 will switch the mode to AP_STA while leaving the last recorded SSID and start connecting to another AP. Even if the SSID is the same, it may conflict with a connection to an AP with different BSSID. -
Use AutoConnectCredential class
The most reliable way is to use the EEPROM entry recorded by AutoConnect. With the AutoConnectCredential class you can read the SSID and password stored in the EEPROM.
#include <ESP8266WiFi.h>
#include <AutoConnect.h>
#include <AutoConnectCredential.h>
AutoConnectCredential credential;
AutoConnect portal;
void setup() {
const char *ssid = nullptr;
const char *password = nullptr;
struct station_config entry;
uint8_t i = credential.entries();
if (i > 0) {
credential.load(i - 1, &entry);
ssid = (const char*)entry.ssid;
password = (const char*)entry.password;
}
portal.begin(ssid, password);
}
from autoconnect.
Thanks Ill give it a go.
from autoconnect.
Related Issues (20)
- AutoConnect to offer captive portal for 5min even if ESP32 is WiFi-Connected HOT 1
- AutoConnect on WiFi connection error shows too many redirects. HOT 2
- AutoConnectCore Not Working HOT 1
- Failing to store network HOT 2
- AutoConnect not longer runningh on ESP8266 HOT 2
- Use Autoconnect library with ESP now HOT 1
- Issue after updating libraries in my PIO project: enableCors() HOT 2
- Strange Issue
- WiFiClientSecure is not working with AutoConnect HOT 1
- how to use esp8266 with WiFiClientSecure
- AutoConnectPageImpl.hpp:1001:20: error: there are no arguments to 'spi_flash_get_chip_size' that depend on a template parameter, so a declaration of 'spi_flash_get_chip_size' must be available [-fpermissive] HOT 2
- Save data from Custom Page to flash HOT 2
- esp32: frozen loop() and kicked out of the WiFi connection at Configure new AP
- WPA2 Enterprise support
- Captive portal cause watchdog triggering
- Possibility to change pass for SoftAP from webui.
- Fresh Install and even the simplest of code will not compile HOT 2
- Unable to select file in fw update page using ios device, android and desktop works.
- Wifi credencials
- Need update to SpiRamAllocatorST for ArduinoJson version 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autoconnect.