SiliconLabs / SimplicityConnect-android

This is the source code for the EFR Connect application for Android.
Apache License 2.0
154 stars 76 forks source link

Crash when attempting OTA DFU on v2.0.3 #12

Closed rhssk closed 3 years ago

rhssk commented 4 years ago

Hello,

I'm having issues with the OTA DFU functionality of this app. Connection is successfully made to the development board but when choosing "OTA DFU" entry and selecting a .GBL file, the app crashes. Here's the crash log: https://gist.github.com/rhssk/d77da33499c1b40cf62cdbb4af6fd674

I'm using v2.0.3 from Google PlayStore on Android 8.1.0.

silabs-TiagoM commented 4 years ago

What device are you using? Have you tried on different devices?

rhssk commented 4 years ago

On MCU side I've tried BRD4182A with the Thermometer example and EFR32BG22C112F352GM32 with custom firmware. On the other side I've only tried Xiaomi Redmi Note 5 Pro and don't have any other Android device available for testing.

silabs-TiagoM commented 4 years ago

I will create an internal request to get this look at. In the meantime if you could test with other android phones that would help isolating this issue to the specific model you have.

At what point exactly does the app crash, can you be more specific on the sequence of events that leads to this? A video capture of the screen would help.

rhssk commented 4 years ago

At what point exactly does the app crash, can you be more specific on the sequence of events that leads to this?

-> Open app -> click "Browser" -> click "Connect" on "Thermometer Example" -> from top-right submenu click on "OTA DFU" -> click on "Select Application .gbl file" -> click on a .GBL file in file chooser. The app crashes immediately after issuing the click.

silabs-TiagoM commented 4 years ago

Can you share that gbl file? How are you generating it?

rhssk commented 4 years ago

I tried installing older versions available in the "build" folder of this repo. v2.0.2 has the same issue but v2.0.1 doesn't. After selecting the .GBL file the app doesn't crash - instead the "OTA Setup" popup is automatically closed and no other information is presented. There's also no additional entries in the app log menu.

Here's the relevant logcat output on v2.0.1: https://gist.github.com/rhssk/d4e1994aea469a3c957a7a08b5878a18

Can you share that gbl file? How are you generating it?

I'm building the "soc-thermometer" sample project in Simplicity Studio and then generating .gbl files with the provided "create_bl_files.sh" script. Here's the generated files: https://github.com/rhssk/EFRConnect-android/tree/issues-12/issues-12/soc-thermometer/output_gbl. Have tried both "application-crc.gbl" and "application.gbl".

silabs-TiagoM commented 4 years ago

I have tried that on Pixel2 (Android 10) and Samsung S8 (Android 9) and no issues. It's likely something specific to your device of the Android version which you are using.

The internal bug report has been created but I can't provide yet a timeline on when this could be fixed.

rhssk commented 4 years ago

The internal bug report has been created but I can't provide yet a timeline on when this could be fixed.

Okay, thanks.

Since my primary goal was to to test the speed of upgrade, could you please be so kind and share the the approximate time it took to complete OTA DFU with those 2 phones and the size of upgrade image?

silabs-TiagoM commented 4 years ago

On these phones that I have it's extremely quick, something like 2-3 seconds. They both support 2M PHY and use a short connection interval which allows fast data throughput.

rhssk commented 4 years ago

2-3 seconds

That's with using same "application.gbl" I provided (Thermometer sample project)?

silabs-TiagoM commented 4 years ago

Yes

rhssk commented 4 years ago

Okay, then that's quite fast indeed.

Thanks for the help, much appreciated!

razemla commented 4 years ago

Hello, I will try to resolve your problem. Unfortunately we don't have Xiaomi Redmi Note 5 Pro phone so we are unable to reproduce this bug. Could you provide some more details? 1) More detailed crashlog from v2.0.3 application (I mean show the logs since the moment when you click "Connect" button in the Browser), 2) Did you try to read/write some characteristic after connection to device? Did it work fine?

rhssk commented 4 years ago

Hello,

I've upgraded the firmware on this phone as well as the OS (from Android 8 to Android 10). The issue still persists, although now the app (v2.0.3) doesn't crash. Update simply fails (exact same behavior as I described previously for v2.0.1).

  1. Output from pidcat --current --clear. Here I press 'Connect', read a few characteristics and then attempt OTA update the same way as described in my previous comments.

  2. Reading/writing doesn't throw any errors but the values are not visible. This appears to be a whole different issue of the app though since the values are invisible on any device I connect to, not just the development kit.

razemla commented 4 years ago

I would like to ensure if you read characteristic's data in the proper way. If you want to read given characteristic you should click this "eye" image and "Read" label. It should animate after click. Did you do that and there was no result?

rhssk commented 4 years ago

After pressing 'Read', a small submenu appears with the characteristic's name but no data. In my screenshot you can see that under "Manufacturer Name String" is a "Manufacturer Name" submenu that's empty (besides the name). In my log three different 'Read' presses are indicated by

 Charac  D  00002a29-0000-1000-8000-00805f9b34fb 16
         D  00002a00-0000-1000-8000-00805f9b34fb 11
         D  00002a01-0000-1000-8000-00805f9b34fb 13
razemla commented 4 years ago

I applied some changes in the code. Could you download attached file, unzip it and install .apk to verify if it helped?

EFR_Connect_debug.zip

rhssk commented 4 years ago

Do you mind sharing the changes in your fork? Since's this is my private phone I'm reluctant to install custom APKs. I'd much rather compile my own APK from your changes.

razemla commented 4 years ago

Below are applied changes: https://github.com/razemla/EFRConnect-android/tree/fix/redmi_note_5_pro

rhssk commented 4 years ago

Same result

razemla commented 4 years ago

Could you verify one more time if my new changes helped? https://github.com/razemla/EFRConnect-android/tree/fix/redmi_note_5_pro

rhssk commented 4 years ago

Still getting an exception on .getUuid()

razemla commented 4 years ago

Did you try to install some other Bluetooth based applications? For example nRF Connect? If not please install it and let me know if reading/writing Bluetooth characteristics works fine in this application.

rhssk commented 4 years ago

Yes, with nRF Connect the characteristics can be read and displayed without any issues.

razemla commented 3 years ago

Hello again, New version of EFR Connect has been released. Please download it from Google Play store and let me know if you see any improvement.

rhssk commented 3 years ago

pidcat-v2.2.0

First trace is after opening file picker, second is after selecting firmware image in the picker. After selecting it, an error message "CONNECTION FAILED" is shown.

rhssk commented 3 years ago

For what it's worth, I've also tried the upgrade with Nexus 5 and some cheapo Prestigio model - both of them work just fine.

silabs-TiagoM commented 3 years ago

Starting from upcoming EFR Connect 2.3.0 we will set minimum Android version as Android 9. Let us know if you still observe this issue with Android 9 or above and open a new issue.