Skip to content

GIGA R1 - WiFi.begin(), WiFi.beginAP, & WiFiUDP issues #1040

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
giorgiogallina opened this issue Mar 20, 2025 · 2 comments
Closed

GIGA R1 - WiFi.begin(), WiFi.beginAP, & WiFiUDP issues #1040

giorgiogallina opened this issue Mar 20, 2025 · 2 comments

Comments

@giorgiogallina
Copy link

giorgiogallina commented Mar 20, 2025

Hello,

Following issue #944, I am still struggling to make things work while alternating WiFi between STA and AP mode.
Everything was working quite nicely, until my smartphone's hotspot (an old OnePlus3T that is slowly dying) suddenly brought up the message <hotspot name> isn't secure - This Wi-Wi network uses an older security standard that is being phased out on my laptop running Windows 11 OS.

  1. From that point on, my Arduino cannot connect anymore to that hotspot, and after such failures (SSID & password correct, but WiFi.begin(SSID, password) Fails), the AP is created (to get from user new SSID and password) but WiFiUDP::endPacket() Fails (this is used for captive portal's DNS redirection).
    Then, since AP communication fails, STA mode is opened again to retry network connection (will we be luckier?), it fails, and AP is then opened again for a new attempt, but this time even WiFi.beginAP(...) Fails.

  2. If the hotspot is switched off at first step (WiFi.being() fails because it cannot find SSID), then AP communication succeeds (no UDP issues). Thus, network credentials are asked to the user and so retrieved. However, after we go back to STA mode and this fails again, AP cannot be opened at all anymore (beginAP() fails).

Every time I switch between STA and AP mode I do the following:

WiFi.end();
delay(20);    // might a delay help?
WiFi = WiFiClass(WiFiInterface::get_default_instance());   // TODO: is it safe? Is it necessary?
delay(35);    // might a delay help?

and, obviously, stop WiFiUDP etc.

@giorgiogallina giorgiogallina changed the title GIGA R1, WiFi.begin(), WiFi.beginAP, & WiFiUDP issues Arduino Mbed OS - WiFi.begin(), WiFi.beginAP, & WiFiUDP issues Mar 20, 2025
@giorgiogallina giorgiogallina changed the title Arduino Mbed OS - WiFi.begin(), WiFi.beginAP, & WiFiUDP issues GIGA R1 - WiFi.begin(), WiFi.beginAP, & WiFiUDP issues Mar 20, 2025
@giorgiogallina
Copy link
Author

Maybe, a Wi-Fi Class reset to its initial status would be helpful in place of the re-creation of the W-iFi object, if that was possible. Maybe a function WiFiClass::reset() or something similar. So that everything (sockets etc.) gets cleaned as if the sketch was just lunched

@giorgiogallina
Copy link
Author

After more debug, I'll open a new issue to substitute this one

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