Skip to content

Performing DFU using freshly installed app fails because it doesn't trigger Android location permission screen. #184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wvanhed opened this issue Dec 15, 2022 · 1 comment
Labels

Comments

@wvanhed
Copy link

wvanhed commented Dec 15, 2022

Describe the bug
When the user installs the nrf Connect for Mobile App, and immediately performs a DFU to an already bonded device, the DFU update fails with unclear reason. The root cause is that the App doesn't have the correct Location permissions (so it can't scan for the DFU broadcasting peripheral), and the Android Permission pop-up screen is never triggered and shown.

To Reproduce

  1. Bond (via android bluetooth settings) to a target BLE peripheral that supports Nordic DFU firmware updates.
  2. If present, remove the nrf Connect app from the android device
  3. Install (do not open!) the nrf Connect app from the google play store
  4. Open the nrf Connect app.
  5. Go to the tab “Bonded” to see a list of devices
  6. Tap the device you are connected/bonded to. It will open in a new tab
  7. Tap the DFU (Device Firmware Update) icon (top-right)
  8. Choose “zip upgrade package” from the menu that follows
  9. Point the app to the desired image (e.g. on Google Drive or so)
  10. The update will start

Expected behavior
A new (DFU) device should appear in a separate tab, and App should - after some time - report that the application was successfully sent to the device.

Actual behavior
No new device tab appears. Application is not updated. In the log screen, the message "DFU Bootloader not found. Trying the same address..." appears, followed by a couple of "Error 133: Connection timeout" messages.

Screenshots
image

Versions (please complete the following information):

  • Android version: 11
  • Phone model Pixel4a
  • App Version 4.26

Additional context
The root cause of the issue was narrowed down to the App not having the required Android "Location" permissions. Normally, when an app needs these permissions, a window will pop-up when this is the case. For example, when you click the "Scan" button under the "Scanner" tab of the nrf Connect app, this Android pop-up will appear when using the app for the first time.
However, it seems that the DFU update also needs this permissions (to scan for the DFU bootloader peripheral, I assume), but it does not trigger the permission pop-up.

Workaround: either set the Location permission of the app manually, or first click "Scan" under "Scanner" tab, to trigger the permission pop-up.

Proposed fix: So, I think that clicking the "DFU" icon in the app, should check the app permissions and make sure the permission pop-up message is shown if needed.

@philips77
Copy link
Member

True... but it's enough to click SCAN on Scanner tab to grant this permission. Sorry, I didn't catch it!

@philips77 philips77 added the bug label Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants