espressif/esp-idf-provisioning-ios

ESP device is disconnected after successful provision

tolikvasylyk opened this issue · 3 comments

ESP device is disconnected after successful provision (BLE)
In my case after the provisioning, I have to send some data to the ESP device using ESPDevice's method
public func sendData(path:String, data:Data, completionHandler: @escaping (Data?, ESPSessionError?) -> Swift.Void)

But right after provisioning the method of ESPBleTransport
func centralManager(_: CBCentralManager, didDisconnectPeripheral peripheral: CBPeripheral, error: Error?) {
ESPLog.log("Disconnected with peripheral")
delegate?.peripheralDisconnected(peripheral: peripheral, error: error)
}
is called and I cannot find the caller of this method anywhere in the library. Do you have any assumptions on why the connection is cut right after provision? Is it possible to change this behavior and leave the device connected for future manual disconnection by using ESPDevice device.disconnect()?

Thanks

@tolikvasylyk , the wifi_prov_mgr_disable_auto_stop() API may be useful for your use case. Please also check out some related documentation here.

Closing this issue since appropriate solution has been provided. Please fell free to reopen/file new issues if required.