ArduinoCore-renesas icon indicating copy to clipboard operation
ArduinoCore-renesas copied to clipboard

WiFiS3 library: allow selection of WIFI_MODE_APSTA mode

Open cotestatnt opened this issue 9 months ago • 4 comments

I am developing a WebServer library that includes a WiFi manager. In the case of DHCP connections, it is essential to provide the user with the IP address assigned by the router.

In this situation (and in other scenarios), it is necessary to have the ability to operate in both WiFi Access Point mode and Station mode, simultaneously, after successfully connecting to the SSID.

cotestatnt avatar Mar 21 '25 12:03 cotestatnt

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Mar 21 '25 12:03 CLAassistant

but which IP does then WiFi.localIP() return ?

and connecting STA to AP usually restarts SoftAP because it must match the channel used for STA. I guess that is a problem for your WiFi Manager as it disconnects clients

JAndrassy avatar Mar 21 '25 12:03 JAndrassy

In my pull request, the localIP() method, in case of WIFI_MODE_APSTA, returns the address assigned by the router, but in fact it would be more correct to provide a second method that explicitly returns the IP address of the AP as happens with the ESP32 core for Arduino calling the IPAddress softAPIP() method, while I think localIP() should always return the STA address.

cotestatnt avatar Mar 21 '25 12:03 cotestatnt

@JAndrassy regarding your doubt about the WiFi channel, I don't think it's a problem and in fact as you can see from this screenshot the WiFi manager works as expected.

image

cotestatnt avatar Mar 21 '25 12:03 cotestatnt