Skip to content

Set and flashing default credentials #348

Answered by Hieromon
SmartVolt asked this question in How can I?
Discussion options

You must be logged in to vote

You can use the AutoConnect::onDetect function to see if the access point started because AutoConnect::begin with the default credentials failed.
More information for the onDetect API can be found in Captive portal start detection section of the documentation.

#include <Arduino.h>
#include <WiFi.h>       // For ESP8266, needs to change to ESP8266WiFi.h
#include <WebServer.h>  // For ESP8266, needs to change to ESP8266WebServer.h
#include <AutoConnect.h>

const char* initialSsid = "yourNetworkName";
const char* initialPassword =  "yourNetworkPass";

AutoConnect portal;

// Callback function at an AP start
bool startAP(IPAddress& ip) {
  Serial.println("Setting Access Point Mode because ini…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Hieromon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants