Description
Where do you suspect the issue?
Issue in DFU library, e.g. upload stops in the middle
Version
2.8.0 (Latest)
Describe the issue
@philips77 Firstly sorry for tagging and pinging but we are on a time constraint and this issue is just unique.
Our BLE device is a custom device which transmits data in json for most of the commands and has a dedicated DFU mode. And it does not support bonding of any sort, When we try to bond we get a popup in phone but android system shows a toast that it cannot be proceeded without PIN or a passkey so we cannot bond the device. Here is the log when flashing the firmware
DfuBaseService I DFU service created. Version: 2.8.0
19:47:55.066 25469-25636 DfuBaseService W Foreground service disabled. Android Oreo or newer may kill a background service few moments after user closes the application.
Consider enabling foreground service using DfuServiceInitiator#setForeground(boolean)
19:47:55.108 25469-25636 DfuBaseService I Connecting to the device...
19:47:55.110 25469-25636 BluetoothGatt D connect() - device: C0:6B:DE:F6:DC:1E, auto: false
19:47:55.110 25469-25636 BluetoothGatt D registerApp()
19:47:55.111 25469-25636 BluetoothGatt D registerApp() - UUID=86be05aa-5910-4b8d-8fc4-11446034a1bc
19:47:55.113 25469-25485 BluetoothGatt D onClientRegistered() - status=0 clientIf=6
19:48:14.971 25469-25469 DFU D onPause: UNREGISTERING DFU progress listener
19:48:15.241 25469-25469 APP_CRITICAL W ! SYSTEM IS TRIMMING MEMORY !
19:48:25.118 25469-25675 BluetoothGatt D onClientConnectionState() - status=133 clientIf=6 device=C0:6B:DE:F6:DC:1E
19:48:25.120 25469-25675 DfuBaseService E Connection state change error: 133 newState: 0
19:48:25.120 25469-25636 DfuBaseService I Connection error after: 30014 ms
19:48:25.121 25469-25636 DfuBaseService E Device not reachable. Check if the device with address C0:6B:DE:F6:DC:1E is in range, is advertising and is connectable
19:48:25.121 25469-25636 DfuBaseService I Retrying... (attempt 2 / 3)
19:48:25.122 25469-25636 BluetoothGatt D refresh() - device: C0:6B:DE:F6:DC:1E
19:48:25.126 25469-25636 DfuBaseService I Refreshing result: true
19:48:25.126 25469-25636 DfuBaseService I Cleaning up...
19:48:25.127 25469-25636 BluetoothGatt D cancelOpen() - device: C0:6B:DE:F6:DC:1E
19:48:25.131 25469-25636 BluetoothGatt D close()
19:48:25.131 25469-25636 BluetoothGatt D unregisterApp() - mClientIf=6
19:48:25.135 25469-25636 DfuBaseService I Restarting the service
19:48:25.143 25469-25636 DfuBaseService W Foreground service disabled. Android Oreo or newer may kill a background service few moments after user closes the application.
Consider enabling foreground service using DfuServiceInitiator#setForeground(boolean)
19:48:25.144 25469-25636 DfuBaseService I Connecting to the device...
19:48:25.146 25469-25636 BluetoothGatt D connect() - device: C0:6B:DE:F6:DC:1E, auto: false
19:48:25.146 25469-25636 BluetoothGatt D registerApp()
19:48:25.147 25469-25636 BluetoothGatt D registerApp() - UUID=b9c0884c-0017-449a-9759-52846293b166
19:48:25.150 25469-25623 BluetoothGatt D onClientRegistered() - status=0 clientIf=6
!!!!!!!!!!!!!!!!!!!! I WENT TO NRF CONNECT AND CONNECTED MANUALLY WHILE MY APP FIRMWARE FRAGMENT WAS INITIATING DFU, AND THEN BELOW LOG APPEARED !!!!!!!!!!!!!!!
19:48:25.227 25469-25623 BluetoothGatt D onClientConnectionState() - status=0 clientIf=6 device=C0:6B:DE:F6:DC:1E
19:48:25.227 25469-25623 DfuBaseService I Connected to GATT server
19:48:25.231 25469-25623 BluetoothGatt D discoverServices() - device: C0:6B:DE:F6:DC:1E
19:48:25.233 25469-25623 DfuBaseService I Attempting to start service discovery... succeed
19:48:25.239 25469-25469 DfuBaseService I Action received: android.bluetooth.device.action.ACL_CONNECTED
19:48:26.070 25469-25623 BluetoothGatt D onPhyUpdate() - status=0 address=C0:6B:DE:F6:DC:1E txPhy=2 rxPhy=2
19:48:26.611 25469-25623 BluetoothGatt D onConnectionUpdated() - Device=C0:6B:DE:F6:DC:1E interval=12 latency=0 timeout=600 status=0
19:48:26.660 25469-25623 BluetoothGatt D onSearchComplete() = Device=C0:6B:DE:F6:DC:1E Status=0
19:48:26.660 25469-25623 DfuBaseService I Services discovered
19:48:26.663 25469-25636 DfuImpl W Secure DFU bootloader found
19:48:26.663 25469-25636 DfuImpl I Enabling notifications...
19:48:26.664 25469-25636 BluetoothGatt D setCharacteristicNotification() - uuid: 8ec90001-f315-4f60-9fb8-838830daea50 enable: true
19:48:26.729 25469-25636 DfuImpl I Requesting high connection priority
19:48:26.729 25469-25636 BluetoothGatt D requestConnectionPriority() - params: 1
19:48:26.732 25469-25636 DfuImpl I Setting object to Command (Op Code = 6, Type = 1)
19:48:26.791 25469-25623 BluetoothGatt D onConnectionUpdated() - Device=C0:6B:DE:F6:DC:1E interval=6 latency=0 timeout=500 status=0
19:48:26.793 25469-25636 DfuImpl I Command object info received (Max size = 512, Offset = 0, CRC = 00000000)
19:48:26.794 25469-25636 DfuImpl I Sending the number of packets before notifications (Op Code = 2, Value = 0)
19:48:26.813 25469-25636 DfuImpl I Creating Init packet object (Op Code = 1, Type = 1, Size = 141)
19:48:26.850 25469-25636 DfuImpl I Sending 141 bytes of init packet...
BUT strangely while in this process and if i Open the NRF Connect app and then try to manually connect the device which is named "DFU" in its dfu mode then what happens that nrf connect while connecting uses some location data as i can see the green location button usage in my notification bar (A13) and then i open my app from recents and firmware process starts.
I tried adding fine location and granting it but doesnt work, so what does NRF Connect app does with the location that too in above android 12.
My dfu config is this
val incrementedMacAddress = incrementMacAddress(deviceAddress ?: return)
Log.d(TAG, "startDFU: Incremented MAC :FROM: $deviceAddress :TO: $incrementedMacAddress")
dfuServiceInitiator = DfuServiceInitiator(incrementedMacAddress)
.setForeground(false)
.setDisableNotification(true)
.setDeviceName("DFU")
.setForceDfu(false)
.setRebootTime(30000L)
.setScanTimeout(10000L)
.setMtu(23)
.disableMtuRequest()
.setKeepBond(false)
//.setNumberOfRetries(1)
.setPrepareDataObjectDelay(300L)
.setPacketsReceiptNotificationsEnabled(true)
.setPacketsReceiptNotificationsValue(5)
.setForceScanningForNewAddressInLegacyDfu(true)
.setUnsafeExperimentalButtonlessServiceInSecureDfuEnabled(true)
.setZip(zip.absolutePath)
i have tried experimenting with reboot times, experimental unsafe, mtu, disable mtu, etc
Relevant log output
No response