espressif / esp-idf-provisioning-ios

Apache License 2.0
134 stars 64 forks source link

ESP device is disconnected after successful provision #22

Closed tolikvasylyk closed 3 years ago

tolikvasylyk commented 3 years ago

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

shahpiyushv commented 3 years ago

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

tolikvasylyk commented 3 years ago

@shahpiyushv Thank you!

shahpiyushv commented 3 years ago

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