lswiderski/mi-scale-exporter

Can't export data from Mi Body Composition Scale 2 / Android 12 issue

maver1ck opened this issue · 12 comments

Hi,
I tried to use app to export data from Mi Body Composition Scale 2.
I copied bluetooth address from Mi Fit.
After using "Get values from mi scale" app is exiting without error code.
What can I do ?

Hi,
Which version of Android did you use?
Please check app permissions if Location (Bluetooth) is allowed.
So far, I have only tested on the Mi Body Composition Scale 1 version
I will try to add an additional log soon.

The very same behavior with my Pixel 4a - Android 12. Do you like to provide you with logcat?

@lswiderski Hi, after update the app won't to start entirely. Just closing after start. Unfortunately there is no MiScaleExporter folder in international storage 😔

@maver1ck I released v1.2 I extended the logs and now can be found under "Internal Storage/MiScaleExporter/". Also, popup with details should show on exception. Probably it will not fix all your issues because I tested this app on Mi Scale version 1 not on version 2, but I hope additional logs (with ex: received byte array from scale) can help and address the problem.

@Neo2SHYAlien Sorry for that. I made quick fix. File permisions changed in Android 12 . App tried to create the folder but didn't have access to storage. Xamarin Essentials didn't support this permission yet and can't ask user for it. So please give access to it manually in app settings.

Hi thank you for the fast fix. Now the app start but when I press the scan the app crash. Unfortunately still doesn't exist the log folder. I give this permission
https://user-images.githubusercontent.com/1681317/162588882-08b76160-f048-4529-8b2a-566d614595a7.png

Update: The crash occur if the Bluetooth is enabled, currently my MiScale is not active. If the Bluetooth is disabled I got error for object referring

@Neo2SHYAlien Can you allow "Nearby devices" permissions? Unfortunately I'm stuck on Android 11. On that Bluetooth and Location are connected under "Location" name. On Android 12, Google separated it.

@lswiderski with everything allowed, the app still crash. Unfortunately, didn't produce any log files for the crash. Logging works I tried to scan with disabled Bluetooth and I logged an error for unreferenced object.

Redmi Note 8T
MIUI 12.5.2
Android 11

Mi Body Composition Scale 2

Version 1.3 working Ok

I allowed everything.
Still app is crashing on Scan when BT is enabled.
I was able to connect this device to Garmin with:
https://github.com/RobertWojtowicz/miscale2garmin

image

Definitely something with permissions is not ok. Checkout the attached logcat
@lswiderski I suppose you have to add android.permission.BLUETOOTH_CONNECT to manifest file

crash.txt

update - I de compile the APK and add the needed permission. After that the app works and read my measurements from my MiScale2
update 2 - todo I have to verify the readed data against the openscale readings
update 3 - I did PR #2

Thanks to @Neo2SHYAlien and his fix #2 I released v1.3. I'm waiting for feedback from you guys, because I still doesn't have Android 12 yet.

@lswiderski for me everything works as I expect. The values match the openscale measured data so for me all is fine. Thank you for the update!