orbital-systems / react-native-esp-idf-provisioning

ESP IDF provisioning and custom data library for react-native
MIT License
26 stars 6 forks source link

device.provision() never returns a result #42

Closed grasmash closed 9 months ago

grasmash commented 10 months ago

const espResponse = await device.provision(ssid, password); never resolves, whether there is an error or success. It does send the credentials.

mateogianolio commented 10 months ago

Hmm do you mean it gets stuck? Could you try the Espressif sample app? Because our code for provisioning:

self.espDevices[deviceName]!.provision(ssid: ssid, passPhrase: passphrase, completionHandler: { status in
    // Prevent multiple callback invokation error
    guard !invoked else { return }

    switch status {
    case .success:
        resolve([
            "status": "success"
        ])
        invoked = true
    case .failure(let error):
        reject("error", error.description, nil)
        invoked = true
    case .configApplied:
        break
    }
})

Is pretty similar to the code called in the ESP sample app for iOS:

https://github.com/espressif/esp-idf-provisioning-ios/blob/master/Example/ESPProvisionSample/ESPProvisionSample/Provision/StatusViewController.swift#L69-L93

grasmash commented 10 months ago

Yes, the call gets stuck, although I can see by monitoring the ESP that the credentials are sent as expected. However, the call just hangs and doesn’t proceed to the next line.

I can try out the sample app and see if I encounter the same behavior.

grasmash commented 10 months ago

Tried the sample app. It hangs at "Confirming Wi-Fi connection" for 10+ minutes with this output:

image

Opened and upstream issue: https://github.com/espressif/esp-idf-provisioning-ios/issues/77

grasmash commented 9 months ago

Closing as this is an upstream issue.