WiFiFlutter icon indicating copy to clipboard operation
WiFiFlutter copied to clipboard

WiFiForIotPlugin.connect doesn't work (timeout), still returns true with useInternet: true

Open Tobi696 opened this issue 1 year ago • 1 comments

I have this code:

var x = await WiFiForIoTPlugin.disconnect();
      print(x);
      caberQUConnected.value = await WiFiForIoTPlugin.connect(
        'BLE caberQU update',
        password: firmwareUpdateProvider.deviceUid,
        security: NetworkSecurity.WPA,
        timeoutInSeconds: 120,
      );
      x = await WiFiForIoTPlugin.forceWifiUsage(true);
      print(x);
      if (!caberQUConnected.value) {
        Fluttertoast.showToast(msg: "Failed to connect to caberQU device.");
        currentStep.value--;
  }

Which runs into the 120 second timeout. When I set the parameter useInternet to true, the method returns true, but my device still stays connected to the old network. I am trying to connect to an IOT Device which has no internet access.

Tobi696 avatar Sep 08 '24 17:09 Tobi696

ensure you have the permission (location,local network for ios) connect method: joinOnce need to set false

szuwest avatar Feb 22 '25 08:02 szuwest