Skip to content

smartconfig bug #275

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

Closed
chenkaiyao opened this issue Mar 21, 2017 · 10 comments
Closed

smartconfig bug #275

chenkaiyao opened this issue Mar 21, 2017 · 10 comments

Comments

@chenkaiyao
Copy link
Contributor

I use the smartconfig example, but had a problem.
when I config a device to connect to Router1, it return:
Waiting for SmartConfig. .................... SmartConfig received. Waiting for WiFi .....WiFi Connected. IP Address: 192.168.3.207 ets Jun 8 2016 00:22:57

I change the Router2, it return:

Waiting for SmartConfig. ............................................................................................................................ SmartConfig received. Waiting for WiFi .....WiFi Connected. IP Address: 192.168.3.207

why IP Address is the same?

@chenkaiyao
Copy link
Contributor Author

the Router2 IP Address should be 192.168.1.***

@me-no-dev
Copy link
Member

hmm.. can you confirm that it connects actually to the other access point? If you use ArduinoIDE, please enable debug level "Verbose" or "Debug" so we see what events come from WiFi. When printing the IP, print SSID as well.

@chenkaiyao
Copy link
Contributor Author

ok! it connects to one access point, it printing:

[D][WiFiGeneric.cpp:174] _eventCallback(): Event: 2 - STA_START
[D][WiFiGeneric.cpp:174] _eventCallback(): Event: 12 - AP_START
[D][WiFiGeneric.cpp:174] _eventCallback(): Event: 13 - AP_STOP
Waiting for SmartConfig.
..............................................................................[D][WiFiSTA.cpp:564] _smartConfigCallback(): ssid = MOLMC_HUAWEI
[D][WiFiSTA.cpp:565] _smartConfigCallback(): password = 12345678
.
SmartConfig received.
Waiting for WiFi
....[D][WiFiGeneric.cpp:174] _eventCallback(): Event: 4 - STA_CONNECTED
[D][WiFiGeneric.cpp:174] _eventCallback(): Event: 7 - STA_GOT_IP
.WiFi Connected.
IP Address: 192.168.3.239
SSID: MOLMC_HUAWEI

connets the other access point, it pringting:

[D][WiFiGeneric.cpp:174] _eventCallback(): Event: 2 - STA_START
[D][WiFiGeneric.cpp:174] _eventCallback(): Event: 12 - AP_START
[D][WiFiGeneric.cpp:174] _eventCallback(): Event: 13 - AP_STOP
Waiting for SmartConfig.
................

iCh lock
.

.

...[D][WiFiSTA.cpp:564] _smartConfigCallback(): ssid = MOLMC-NETGRAR
[D][WiFiSTA.cpp:565] _smartConfigCallback(): password = 12345678
.
SmartConfig received.
Waiting for WiFi
....[D][WiFiGeneric.cpp:174] _eventCallback(): Event: 4 - STA_CONNECTED
[D][WiFiGeneric.cpp:174] _eventCallback(): Event: 7 - STA_GOT_IP
.WiFi Connected.
IP Address: 192.168.3.239
SSID: MOLMC_HUAWEI

I am printing the Received ssid and password, but connecting seems no work!

@copercini
Copy link
Contributor

copercini commented Mar 22, 2017

Both routers are on the same network? they have DHCP enabled?

@chenkaiyao
Copy link
Contributor Author

chenkaiyao commented Mar 24, 2017

not the same network , enable DHCP. using the example of smartconfig.
what should i do next?

@chenkaiyao
Copy link
Contributor Author

@me-no-dev smartconfig example is ok for you ?

@me-no-dev
Copy link
Member

Sorry guys, just forgot to reply, but I will advise you to file the issue at espressif/esp-idf, because the problem is somewhere in the system wifi libs. It looks like once you connect, the configuration is not overwritten and it connects to the last station configured.
Now we can hack this to clear the configuration when smart config is enabled, but that is a hack and not the proper way to do things :)

@me-no-dev
Copy link
Member

OK, let me try a few things and see if I can fix this without hackery.

@me-no-dev
Copy link
Member

Oh this is embarrassing :D check which interface is the new setting set on... https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/src/WiFiSTA.cpp#L564

@chenkaiyao
Copy link
Contributor Author

thanks!

blue-2357 pushed a commit to blue-2357/arduino-esp32 that referenced this issue Jul 17, 2024
dash0820 added a commit to dash0820/arduino-esp32-stripped that referenced this issue Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants