- Notifications
You must be signed in to change notification settings - Fork 7.8k
Now SmartConfig works!#807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Conversation
Now SmartConfig works! Tested on ESP32
Now SmartConfig works! Tested on ESP32
bill-orange commented Nov 5, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
I added: sta_conf->bssid_set = 0; to the .cpp file and recompiled. It made no difference. If I reset the ESP32 is searches forever until I use the phone app. Is there any else I need to do to effect the change? Here's my connect function: void setupWiFi (){ /* Wait for SmartConfig packet from mobile */ /* Wait for WiFi to connect to AP */ Here's verbose debug: entry 0x40078a3c |
allex1978 commented Nov 5, 2017
Hi bill-orange, you used just a SmartConfig sample code. |
bill-orange commented Nov 5, 2017 via email
“Have to rebuild the logic”. Could you expand on that a bit. Also, not to be picky by shouldn’t this run on an Esp32 the same way it runs on an Esp8266 for code portability. …Sent from my iPhone On Nov 5, 2017, at 3:34 PM, allex1978 ***@***.***> wrote: Hi bill-orange, you used just a SmartConfig sample code. line WiFi.beginSmartConfig(); is always disconnect from old AP and start SmartConfig process. If you not want to start SmartConfig after reset you have to rebuild the logic. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread. |
beegee-tokyo commented Nov 6, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
@bill-orange that is what I do
|
| } elseif (status == SC_STATUS_LINK){ | ||
| wifi_sta_config_t *sta_conf = reinterpret_cast<wifi_sta_config_t *>(result); | ||
| log_d("SSID: %s", (char *)(sta_conf->ssid)); | ||
| sta_conf->bssid_set = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is rather strange to make any difference
bill-orange commented Nov 6, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
beegee-tokyo , Thank you for the code. It worked for me when I set the timeouts correctly. If I connect to a WiFi network and then move to another WiFi network will the first one fail and allow SmartConnect to look for the new one? Shouldn't ESP32 and ESP8266 code work the same for something like this? void setupWiFi (){ if (WiFi.reconnect()){ WiFi.beginSmartConfig(); /* Wait for SmartConfig packet from mobile */ /* Wait for WiFi to connect to AP */ } |
beegee-tokyo commented Nov 6, 2017
@bill-orange you are right, in my code is a mistake, should be WiFi.reconnect() instead of WiFi.begin(). But it worked for me before. Thanks for pointing out my mistake. |
No description provided.