mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #238] set SSID in autoConnect() with name+MAC #197
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#197
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 @mickeypop on GitHub (Oct 14, 2016).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/238
I am trying to get my Wemos D1 mini to set the AP name to Stand + the MAC address minus the semicolons, like Stand5CCF7F238734.
The GetMyMacAddress() function i wrote is clearly working, the serial out shows that.
Every time I try to pass a String or char variable to wifiManager.autoConnect() I get compiler errors. Even though the header file identifies String type the C file say const char.
if i pass macStr or
*macStr (char type)invalid conversion from 'char' to 'const char' [-fpermissive]*
if i pass ap2 (String type) i get:
no matching function for call to 'WiFiManager::autoConnect(String&)'
My code;
Serial out Returns: when connected
connected...yeey :)
ap2 Stand5CCF7F238734 String
macStr Stand5CCF7F238734 Char
How can i pass the ap2 or macStr to set the AP SSID name?
@kentaylor commented on GitHub (Oct 16, 2016):
This line and the following creates a string variable and calls autoconnect successfully so you could copy that construct. It is odd that the value of a const is changed but it is possible.
I'd recommend against using autoconnect for these reasons. If you are happy with using the ChipID rather than the MAC address as your variable in the AP name then this library already does that without modification.
@tzapu commented on GitHub (Oct 17, 2016):
Hi, try with
wifiManager.autoConnect( ap2.c_str() );Does that work?
Cheers
@mickeypop commented on GitHub (Oct 17, 2016):
wifiManager.autoConnect( ap2.c_str() ); got it working.
i was not aware of the .c_str() operator is has been a while since i needed and string minipulation.
Time to bone up i guess.