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

Autoconnection issue (does not switch from temporary connection to permanent connection.) #396

Open
enverkc opened this issue Aug 7, 2024 · 4 comments

Comments

@enverkc
Copy link

enverkc commented Aug 7, 2024

Hello , I am trying to connect a specific SSID when I open my app. But it stuck at temporary connection. So I cannot transfer data over it.
When I open my app it ask the following question.
image_2024-08-07_114103691
I accept this and and it says connected. But when I look to WiFi settings from my phone, it look like the following pic.
image
When I click to actual one, It connect to actual one and temporary WiFi disaperar.
Has anyone experienced such a problem? Or can anyone help?

I tried many variantions of code but at the end , still same error.
I am testing with Android 14

Thanks everyone.

My code like this:

`
void _connectToWiFi() async {
await WiFiForIoTPlugin.disconnect();
bool isConnected = await WiFiForIoTPlugin.connect(
ssid,
password: password,
joinOnce: true,
withInternet: false,
security: NetworkSecurity.WPA,
);
final res = await WiFiForIoTPlugin.forceWifiUsage(true);

if (isConnected) {
  print("Connected to $ssid");
} else {
  print("Failed to connect to $ssid");
}

}

@OverRide
Widget build(BuildContext context) {
return Center(
child: Text("Connecting to WiFi..."),
);
}
}
`

@Vinpwey
Copy link

Vinpwey commented Aug 7, 2024

I have the same problem as you I also tried "WiFiForIoTPlugin.findAndConnect" but it didn't change anything

@E2-Veera
Copy link

E2-Veera commented Aug 9, 2024

I'm also having similar issue. Initially I'll connect to my IOT device within the app. After few minutes my WiFiIOT device will stop emiting wifi connection. In that time my device not automatically switching to previous saved connection

I'm using flutter 3.22.3 dart 3.4.4

Note: this issue not working on the following devices

Redmi Note 11 - Android 11
Mi A2 - Android 10
OnePlus 11R - Android 13 (OxygenOS 13.1)
OnePlus Nord2 - Android 13 (OxygenOS 13.0)

Working on These devices

Moto g04 - Android 14
Samsung F03 - Android 14
Samsung F23 - Android 14
Redmi Note 13 - Android 14
iQOO Z7s - Android 13
OPPO A31 - Android 9
iQOO Z3 - Android 13
OnePlus 9 - Android 14 (OxygenOS 14.0)

I don't know why this inconsistent behaviour occurring Any help on this ?

@E2-Veera
Copy link

Found the solution check here #385 (comment)

@enverkc
Copy link
Author

enverkc commented Aug 14, 2024

Found the solution check here #385 (comment)

If I understand correctly, you already connect automatically (when you open the app, not from settings) . Unfortunately, the connection is not completed in our case. There is only a temporary connection. In this case, I cannot transfer data.

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