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

Failed to connect #391

Open
appbucket0408 opened this issue Jun 4, 2024 · 2 comments
Open

Failed to connect #391

appbucket0408 opened this issue Jun 4, 2024 · 2 comments

Comments

@appbucket0408
Copy link

this is my code: Future connectToWifi(String ssid) async {
try {
var details = await WiFiForIoTPlugin.connect(ssid,
security: NetworkSecurity.NONE, joinOnce: true);
print('details are $details');
if (details) {
print('connected sucessfuly');
} else {
print('failed to connect');
}
} catch (e) {
print('fialed to connect $e');
}
}these are messages in debug console:D/ConnectivityManager(11147): NetworkCallback was already unregistered
I/flutter (11147): details are false
I/flutter (11147): failed to connect

@spartakos87
Copy link

Same problem here

@Mark-Toten
Copy link

We encounter the exact same issue. The very first time it always fails to connect. Retrying after that always succeeds. Haven't look into the source, but is 100% reproducable, so shouldn't be hard to fix (but currently don't have the time to look into it). By the way, this is the connect with "withInternet" set to false and "joinOnce" set to true, using WPA and specifying a bssid.

final bool connected = await WiFiForIoTPlugin.connect(
  accessPoint.ssid,
  bssid: accessPoint.bssid,
  security: NetworkSecurity.WPA,
  password: accessPointPassword,
  // withInternet: false,
  // joinOnce: true,
); 

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

3 participants