espressif/esp-idf-provisioning-ios

Unable to connect ESP BLE(Descriptor.value = 0)

SudhanshuPahwa opened this issue · 5 comments

<CBDescriptor: 0x282683120, UUID = Client Characteristic Configuration, value = 0>
Descriptor.value = 0
utility.processDescriptor(descriptor: descriptor)and readCounter is 1
in below method

func peripheral(_: CBPeripheral, didUpdateValueFor descriptor: CBDescriptor, error _: Error?) {
ESPLog.log("Did update value for descriptor: (descriptor)")
utility.processDescriptor(descriptor: descriptor)
readCounter -= 1
if readCounter < 1 {
if utility.peripheralConfigured {
bleConnectTimer.invalidate()
bleStatusDelegate?.peripheralConnected()
}
}
}

Logs:-

12:44:05.407 | ESPDevice.connect(delegate:completionHandler:) (151) : Connecting ESPDevice...
12:44:05.407 | ESPDevice.connect(delegate:completionHandler:) (155) : Start connecting ble device.
12:44:05.408 | ESPBleTransport.connect(peripheral:withOptions:delegate:) (160) : Connecting peripheral device...
12:44:05.409 | ESPBleTransport.connect(peripheral:withOptions:delegate:) (170) : Initiating timeout for connection completion.
12:44:05.897 | ESPBleTransport.centralManager(:didConnect:) (286) : Connected to peripheral. Discover services.
12:44:06.403 | ESPBleTransport.peripheral(
:didDiscoverServices:) (305) : Peripheral did discover services.
12:44:06.522 | ESPBleTransport.peripheral(:didDiscoverCharacteristicsFor:error:) (316) : Peripheral did discover chatacteristics.
12:44:06.525 | ESPBleTransport.peripheral(
:didDiscoverDescriptorsFor:error:) (360) : Did sicover descriptor for characterisitic: <CBCharacteristic: 0x2830a4840, UUID = 2ADD, properties = 0x4, value = (null), notifying = NO>
Optional(0)
12:44:06.673 | ESPBleTransport.peripheral(:didDiscoverDescriptorsFor:error:) (360) : Did sicover descriptor for characterisitic: <CBCharacteristic: 0x2830a4900, UUID = 2ADE, properties = 0x10, value = (null), notifying = NO>
Optional(1)
12:44:06.733 | ESPBleTransport.peripheral(
:didUpdateValueFor:error:) (368) : Did update value for descriptor: <CBDescriptor: 0x281ad48a0, UUID = Client Characteristic Configuration, value = 0>
12:44:25.410 | ESPBleTransport.bleConnectionTimeout() (177) : Peripheral connection timeout occured.
12:44:25.411 | ESPBleTransport.disconnect() (187) : Cancelling peripheral connection.
12:44:25.412 | ESPDevice.peripheralFailedToConnect(peripheral:error:) (607) : Peripheral failed to connect.
failedToConnect(ESPProvision.ESPSessionError.bleFailedToConnect)
12:44:25.416 | ESPBleTransport.centralManager(_:didDisconnectPeripheral:error:) (296) : Disconnected with peripheral
12:44:25.416 | ESPDevice.peripheralDisconnected(peripheral:error:) (600) : Peripheral disconnected.

Hi @SudhanshuPahwa, Can you provide us the below detail of the issue you are facing:

  1. iOS Version
  2. ESP-IDF version
  3. ESPProvision SDK or Sample App version
  4. Screenshot of the error seen in the app.
  5. Check if BLE device is present in the list of BLE devices in iPhone->Settings->Bluetooth. If it is there you can forget the device and retry provisioning.

Hi @vikas-chandra-mnnit thanks for reverting, I am not sure why it is not connecting while using ESPProvision SDK,
1- 14.8.1
2- I am not sure which version is this but its a stable one and it is not even connecting with ESPRainmaker app available on app store.
3- ESPProvision (2.0.14)
4- I am using ESPProvision SDK in my demo application to connect ESP Ble mesh
5- No ESP BLE available in iPhone->Settings->Bluetooth. But available in peripheral discover device with local name "kCBAdvDataLocalName": ESP-BLE-MESH

@SudhanshuPahwa ESPProvision SDK does not support connecting with ESP BLE MESH. For that, you can use the ESP MESH app available on the app store or can check out the project from https://github.com/EspressifApp/EspMeshForiOS.

Thanks, closing this!