mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-05-01 11:05:58 +03:00
[GH-ISSUE #283] exit status WiFiManager::autoConnect(String, String)' #235
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#235
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SkazochnikZlodey on GitHub (Jan 7, 2017).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/283
Hello.
I`m trying to use ESP ID as WIFI name and custom password but getting error:
exit status WiFiManager::autoConnect(String, String)
Here is a part of code:
#define AP_SSID "ESP8266-"
#define AP_PASSWORD_PREFIX "SECRET" // + mac XXXX
#define AP_PASSWORD_SUFFIX "PASS"
String AP_Name = "";
String AP_Pass = "";
// skip
Serial.println(AP_Name);
Serial.println(AP_Pass);
if(!wifiManager.autoConnect( AP_Name,AP_Pass)) {
Serial.println("failed to connect and hit timeout");
//reset and try again, or maybe put it to deep sleep
ESP.reset();
delay(1000);
}
// skip
// ----------------------------------- createAPNameandPass -----------------------------------
void createAPNameandPass() {
//Serial.println();
uint8_t mac[WL_MAC_ADDR_LENGTH];
WiFi.softAPmacAddress(mac) ;
String APmacStr;
APmacStr = String(mac[WL_MAC_ADDR_LENGTH - 6], HEX) + ":" +
String(mac[WL_MAC_ADDR_LENGTH - 5], HEX) + ":" +
String(mac[WL_MAC_ADDR_LENGTH - 4], HEX) + ":" +
String(mac[WL_MAC_ADDR_LENGTH - 3], HEX) + ":" +
String(mac[WL_MAC_ADDR_LENGTH - 2], HEX) + ":" +
String(mac[WL_MAC_ADDR_LENGTH - 1], HEX);
String APmacID = "";
if (mac[WL_MAC_ADDR_LENGTH - 2] < 0x10) APmacID = APmacID + "0";
APmacID = APmacID + String(mac[WL_MAC_ADDR_LENGTH - 2], HEX);
if (mac[WL_MAC_ADDR_LENGTH - 1] < 0x10) APmacID = APmacID + "0";
APmacID = APmacID + String(mac[WL_MAC_ADDR_LENGTH - 1], HEX);
APmacStr.toUpperCase();
APmacID.toUpperCase();
AP_Name = AP_SSID + APmacID;
AP_Pass = AP_PASSWORD_PREFIX + APmacID + AP_PASSWORD_SUFFIX;
Serial.println ("");
Serial.print("AP SSID: "); Serial.println(AP_Name);
Serial.print("AP pass: "); Serial.println(AP_Pass);
Serial.print("AP MAC address: ");
Serial.println(APmacStr);
}
Where is my mistake ?