This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

DFU Scanner Failed on Android O with SR3 v1.1

Hi,

We are working on Android O with SR3  v1.1.

There is an issue that our Android STB can't find any BLE device using your library.

(https://github.com/NordicSemiconductor/Android-Scanner-Compat-Library)

Here is our code and error log


ScanSettings scanSettings = new ScanSettings.Builder()
               .setCallbackType(ScanSettings.CALLBACK_TYPE_ALL_MATCHES)
               .setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
               .setUseHardwareBatchingIfSupported(true)
               .build();
bleScanner.startScan(null, scanSettings, mScanCallback);


 I/zygote: Late-enabling -Xcheck:jni
 W/GraphicsEnvironment: driver package 'gfxdriver-bcmstb' not installed
 E/VC5: DRM: Trying to find: /dev/dri/card0
 D/libEGL: loaded /vendor/lib/egl/libGLES_nexus.so
           
           [ 08-22 11:13:47.206  9298: 9318 E/         ]
           init_expose_fences v3d EGL_ANDROID_native_fence_sync extension enabled
 D/OpenGLRenderer: HWUI GL Pipeline
 E/VC5: DRM: Trying to open: /dev/dri/card0
 E/VC5: DRM: brcmv3d Version 2.0.0 20180313, Broadcom V3D GEM provider
 E/VC5: DRM: No Nexus secure graphics heap available
 I/OpenGLRenderer: Initialized EGL, version 1.4
 D/OpenGLRenderer: Swap behavior 1
 W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
 D/OpenGLRenderer: Swap behavior 0
 V/VC5: ==========================================================================
 V/VC5: NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS = 1
 V/VC5: ==========================================================================
 V/VC5: ==========================================================================
 V/VC5: NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS = 1
 V/VC5: ==========================================================================
 D/BluetoothGatt: connect() - device: E9:74:F1:2A:15:D5, auto: false
 D/BluetoothGatt: registerApp()
 D/BluetoothGatt: registerApp() - UUID=2cf0ce0e-fce1-41ec-9b00-e6e32acab188
 D/BluetoothGatt: onClientRegistered() - status=0 clientIf=6
 D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=6 device=E9:74:F1:2A:15:D5
 V/BluetoothLeService: onConnectionStateChange 2
 D/BluetoothGatt: discoverServices() - device: E9:74:F1:2A:15:D5
 D/BluetoothGatt: onSearchComplete() = Device=E9:74:F1:2A:15:D5 Status=0
 I/zygote: Do partial code cache collection, code=26KB, data=30KB
 I/zygote: After code cache collection, code=26KB, data=30KB
 I/zygote: Increasing code cache capacity to 128KB
 D/BluetoothGatt: onClientConnectionState() - status=8 clientIf=6 device=E9:74:F1:2A:15:D5
 V/BluetoothLeService: onConnectionStateChange 0
 D/BluetoothGatt: discoverServices() - device: E9:74:F1:2A:15:D5
 D/BluetoothGatt: close()
 D/BluetoothGatt: unregisterApp() - mClientIf=6
 V/VC5: ==========================================================================
 V/VC5: NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS = 1
 V/VC5: ==========================================================================
 D/BluetoothGatt: connect() - device: E9:74:F1:2A:15:D5, auto: false
 D/BluetoothGatt: registerApp()
 D/BluetoothGatt: registerApp() - UUID=438ca611-8a23-4350-a40e-1dc9394ab84f
 D/BluetoothGatt: onClientRegistered() - status=0 clientIf=6
 D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=6 device=E9:74:F1:2A:15:D5
 V/BluetoothLeService: onConnectionStateChange 2
 D/BluetoothGatt: discoverServices() - device: E9:74:F1:2A:15:D5
 D/BluetoothGatt: onSearchComplete() = Device=E9:74:F1:2A:15:D5 Status=0
 I/zygote: Do partial code cache collection, code=43KB, data=58KB
 I/zygote: After code cache collection, code=43KB, data=58KB
 I/zygote: Increasing code cache capacity to 256KB
 I/zygote: Compiler allocated 4MB to compile void android.widget.TextView.<init>(android.content.Context, android.util.AttributeSet, int, int)
 I/zygote: Do full code cache collection, code=126KB, data=88KB
 I/zygote: After code cache collection, code=84KB, data=41KB
 D/BluetoothGatt: close()
 D/BluetoothGatt: unregisterApp() - mClientIf=6
 V/UploadingFragment: scanLeDevice
 D/BluetoothAdapter: isLeEnabled(): ON
 D/BluetoothLeScanner: onScannerRegistered() - status=0 scannerId=6 mScannerId=0
 I/zygote: Do partial code cache collection, code=99KB, data=57KB
 I/zygote: After code cache collection, code=99KB, data=56KB
 I/zygote: Increasing code cache capacity to 512KB
 I/zygote: Method exceeds compiler instruction limit: 25337 in void org.ccil.cowan.tagsoup.HTMLSchema.<init>()
 W/UploadingFragment: force stop scan
 D/BluetoothAdapter: isLeEnabled(): ON
 V/VC5: ==========================================================================
 V/VC5: NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS = 1
 V/VC5: ==========================================================================
 D/BluetoothGatt: connect() - device: E9:74:F1:2A:15:D5, auto: false
 D/BluetoothGatt: registerApp()
 D/BluetoothGatt: registerApp() - UUID=5c4971d7-1118-40cc-9e45-62b4861ffa01
 D/BluetoothGatt: onClientRegistered() - status=0 clientIf=6
 D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=6 device=E9:74:F1:2A:15:D5
 V/BluetoothLeService: onConnectionStateChange 2
 D/BluetoothGatt: discoverServices() - device: E9:74:F1:2A:15:D5
 D/BluetoothGatt: onSearchComplete() = Device=E9:74:F1:2A:15:D5 Status=0
 D/BluetoothGatt: close()
 D/BluetoothGatt: unregisterApp() - mClientIf=6
 
 /*
 * Using https://github.com/NordicSemiconductor/Android-Scanner-Compat-Library/releases
 *
 * ScanSettings scanSettings = new ScanSettings.Builder()
 *				.setCallbackType(ScanSettings.CALLBACK_TYPE_ALL_MATCHES)
 *				.setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
 *				.setUseHardwareCallbackTypesIfSupported(true)
 *				.build();
 * bleScanner.startScan(null, scanSettings, mScanCallback);				
 */
 
 V/UploadingFragment: scanLeDevice
 D/BluetoothAdapter: isLeEnabled(): ON
 D/BluetoothLeScanner: onScannerRegistered() - status=0 scannerId=6 mScannerId=0
 W/UploadingFragment: force stop scan
 D/BluetoothAdapter: isLeEnabled(): ON





However We worked fine on Android N with SR3 v1.1.


Thanks,

Ralph
  • Hi Ralph,

    Could you ensure if you have enabled location permission and location services on the Device running Android O? This could be one of the reasons you may not see the scan results. Also you may try setting setUseHardwareBatchingIfSupported(false). Hope this helps!

  • Hi Roshan,

    I sure that I have enable location permission on the device.

    <uses-permission android:name="android.permission.BLUETOOTH"/>
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

    After setting setUseHardwareBatchingIfSupported(false), it still doesn't work.

  • Hi Ralph, this is permission set in the manifest file. If you go in to your Android settings >> apps >> your application and check for permissions listed there. Also go to settings and security & location to see if location services is enabled. Please check if these two are enabled.

  • Hi Roshan,

    Thanks your help. I can find the DFU device now, but it gets another issue when DFU is running.

    E/DfuImpl: Executing object failed (error 10)

    D/BluetoothGatt: onSearchComplete() = Device=C7:76:13:BC:5D:F2 Status=0
    W/Notification: Use of stream types is deprecated for operations other than volume control
    W/Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
    D/BluetoothGatt: onConnectionUpdated() - Device=C7:76:13:BC:5D:F2 interval=13 latency=0 timeout=400 status=0
    D/BluetoothGatt: onConnectionUpdated() - Device=C7:76:13:BC:5D:F2 interval=13 latency=0 timeout=400 status=0
    D/BluetoothGatt: setCharacteristicNotification() - uuid: 8ec90001-f315-4f60-9fb8-838830daea50 enable: true
    E/DfuImpl: Executing object failed (error 10)
    W/Notification: Use of stream types is deprecated for operations other than volume control
    W/Notification: See the documentation of setSound() for what to use instead with android.media.AudioAttributes to qualify your playback use case
    D/BluetoothGatt: cancelOpen() - device: C7:76:13:BC:5D:F2
    D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=7 device=C7:76:13:BC:5D:F2
    D/BluetoothGatt: refresh() - device: C7:76:13:BC:5D:F2
    D/BluetoothGatt: close()
    D/BluetoothGatt: unregisterApp() - mClientIf=7
    E/UploadingFragment: Upload failed: UNKNOWN (8202)

  • Great that it helped. Could you please open a new issue for this? Opening a new issue would also help other users who might have faced the same issue! Thanks

Related