Failed to connect
this is my code: Future
Same problem here
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,
);