Skip to content
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

Fallback mode sets AP+STA rather than AP #19

Open
ChrisBrinton opened this issue Mar 5, 2020 · 0 comments
Open

Fallback mode sets AP+STA rather than AP #19

ChrisBrinton opened this issue Mar 5, 2020 · 0 comments

Comments

@ChrisBrinton
Copy link

If there are no networks defined, the WiFiMode will be set to WIFI_AP. If there are any networks defined, but none of the known networks are found in the scan the state machine moves into STATE_FALLBACK, and the WiFiMode gets set to WIFI_AP_STA.

Is this intentional or a bug?

In my situation, WIFI_AP_STA prevents clients from connecting to the AP, while WIFI_AP allows connection of the same clients.

I can get the behavior I want by changing the fallback state code to

        case STATE_FALLBACK:
            WiFi.enableSTA(false);
            if (!_ap_connected & _ap_fallback_enabled) _doAP();
            _timeout = millis();
            _state = STATE_IDLE;
            break;

This results in WiFiMode=WIFI_AP after a fallback (the same as with no networks defined) until the timeout is reached, whereupon it rescans and looks for known networks again. WiFi.enableSTA(true) gets called during scanning, so I dont think there is lasting harm.

If there is a way to set the jw configuration to get this behavior, I cant seem to find it.

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

1 participant