How to enable/disable AP without STA disturbance?

chrismerck
Posts: 73
Joined: Tue May 29, 2018 8:00 pm

How to enable/disable AP without STA disturbance?

Postby chrismerck » Tue Sep 28, 2021 12:21 pm

We develop an ESP32-based line of smart home products. They use AP+STA mode for setup purpose, but also in case the Home WiFi connection is disturbed, to become available for setup again. (Compare: Google Home's behavior when internet goes out.)

To toggle between AP+STA and STA-only modes, we use esp_wifi_set_mode. Unfortunately, when switching from AP+STA to STA-only mode, we notice that an MQTT connection on the STA interface is disturbed to the extent of causing a connection drop. This then triggers the AP to be required again, perpetuating a cycle of disconnection.

Does anyone know how to make this function not disconnect the STA?

We're experimenting with just setting the AP to hidden, but then that has the side-effect of the user's phone not disconnecting from the AP (it stays connected after the reconfiguration to hidden). Perhaps we could use Deauth frames to kick the phone off. Another hack may be to not only set the SSID to hidden, but also change the SSID. But that again seems very hacky.

(We're on ESP-IDF v3.3)

\0x00\0x00
Posts: 2
Joined: Tue Apr 19, 2022 2:51 pm

Re: How to enable/disable AP without STA disturbance?

Postby \0x00\0x00 » Tue Apr 19, 2022 2:52 pm

Did you find a solution to this? I'm experiencing the same problem.

Who is online

Users browsing this forum: Google [Bot], mikecarlos and 117 guests