WiFiFlutter icon indicating copy to clipboard operation
WiFiFlutter copied to clipboard

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

Open enverkc opened this issue 1 year ago • 4 comments

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..."), ); } } `

enverkc avatar Aug 07 '24 09:08 enverkc

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

Vinpwey avatar Aug 07 '24 20:08 Vinpwey

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 avatar Aug 09 '24 10:08 E2-Veera

Found the solution check here https://github.com/flutternetwork/WiFiFlutter/issues/385#issuecomment-2288298006

E2-Veera avatar Aug 14 '24 09:08 E2-Veera

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.

enverkc avatar Aug 14 '24 17:08 enverkc