Can I search for a network in WIFI_MODE_APSTA while keeping my AP alive?

jackjansen
Posts: 2
Joined: Wed May 13, 2020 10:20 pm

Can I search for a network in WIFI_MODE_APSTA while keeping my AP alive?

Postby jackjansen » Sun Apr 04, 2021 12:07 am

My program normally operates in STA mode, but before the ssid/password have been initialised (through a web interface) or if there is a problem connecting to the ssid if will create a a soft AP to allow the user to set/change the ssid to connect to.

This works fine initially: the program doesn't have an ssid yet, so operates only is STA mode, the user connects and sets the ssid, the device connects to the ssid and everything is fine.

But it doesn't work later, if for some reason the ssid cannot be connected to (for example because I've moved the device to a different location, with a different wifi network). After the device cannot connect to the ssid it will go to WIFI_MODE_APSTA and continue trying to connect to the ssid, with the intention that the user can also connect to the SoftAP and change the ssid to search for.

But this doesn't work: while trying to connect to an ssid in STA mode the SoftAP becomes inactive. From older posts here I understand that the issue is that there's only one radio, and while it is scanning all the frequencies to try and find the ssid it needs to connect to it cannot maintain the AP mode, because it needs a stable frequency for this, and APSTA mode works normally (when connected to an ssid in STA mode) because it just uses the same frequency for its AP mode that it uses for the STA mode.

But I'm wondering: would it be possible to do some workaround, where I look for the ssid only "once in a while", and somehow keep these periods so short (and so far apart) that the STA mode isn't affected?

Who is online

Users browsing this forum: No registered users and 80 guests