FORUMS
Remove All Ads from XDA

Xiaomi Mi Band data extraction, analytics and Google Fit sync tools

119 posts
Thanks Meter: 167
 
By xmxm, Senior Member on 1st February 2015, 09:21 PM
Post Reply Email Thread
3rd February 2015, 08:19 PM |#11  
Senior Member
Flag Łódź
Thanks Meter: 61
 
More
Quote:
Originally Posted by xmxm

This might be caused by adb process still running in memory and locking log file. I've modified script not to redirect output from adb commands into log file and also added few commands to kill previous adb service once extraction is complete. Could you please download v5.33 and see if it works?

works perfectly
Thanx!!
4th February 2015, 12:31 AM |#12  
Junior Member
Thanks Meter: 3
 
More
Thumbs up
Thanks, very useful!!
FYI, I needed to make some modifications to make it work in my case:
- In 'run.sh', I had to modify the SDPath variable to the correct path (in my version of Cyanogenmod):
SDPath=/storage/sdcard0
- run.sh log indicated a "permission denied" error. It was caused because adb did not have root privileges in my android. To correct it:
In Android: Settings > Administrative access > Select "Applications and ADB"
- sqlite3 in OSX is an old version, so run.sh complains with:
Error: unknown command or invalid arguments: "once". Enter ".help" for help
Error: unknown command or invalid arguments: "print". Enter ".help" for help
To solve it, install a new version of sqlite3. For example using brew:
> brew install sqlite3
and replace sqlite3 in run.sh for the brew version: /usr/local/Cellar/sqlite/3.8.6/bin/sqlite3
- Files from: miband_analytics need to be in the same folder than miband_extract

With these modifications it is working properly in my mac.
Keep up the good work!
The Following 2 Users Say Thank You to SynerG For This Useful Post: [ View ] Gift SynerG Ad-Free
4th February 2015, 12:55 AM |#13  
Senior Member
Thanks Meter: 25
 
More
Hi.
I'm extracting data with Bonoboo Mi Band Export Stats, which exports to sd card the files:
app_locale.js; config.js; extract.js; locale.js; Mi_Band_Table.csv; Mi_Band_Table.html and Mi_Band_Graphs.html.

In order to used that exported data with your analytics tools, which files should i move to your folder which contains multiple files like mi_data_byDoW.html and mi_data.html ?

Thanks
4th February 2015, 05:59 AM |#14  
OP Senior Member
Thanks Meter: 167
 
More
Quote:
Originally Posted by herpez

Hi.
I'm extracting data with Bonoboo Mi Band Export Stats, which exports to sd card the files:
app_locale.js; config.js; extract.js; locale.js; Mi_Band_Table.csv; Mi_Band_Table.html and Mi_Band_Graphs.html.

In order to used that exported data with your analytics tools, which files should i move to your folder which contains multiple files like mi_data_byDoW.html and mi_data.html ?

Thanks

You'll just need at app_locale.js and extract.js. The folder with analytic tools already has config.js and locale.js and CSV file is not required for analytic tools, you only need it if you want to see your data in Excel.
The Following User Says Thank You to xmxm For This Useful Post: [ View ] Gift xmxm Ad-Free
4th February 2015, 06:13 AM |#15  
OP Senior Member
Thanks Meter: 167
 
More
Quote:
Originally Posted by SynerG

Thanks, very useful!!
FYI, I needed to make some modifications to make it work in my case:
- In 'run.sh', I had to modify the SDPath variable to the correct path (in my version of Cyanogenmod):
SDPath=/storage/sdcard0
- run.sh log indicated a "permission denied" error. It was caused because adb did not have root privileges in my android. To correct it:
In Android: Settings > Administrative access > Select "Applications and ADB"
- sqlite3 in OSX is an old version, so run.sh complains with:
Error: unknown command or invalid arguments: "once". Enter ".help" for help
Error: unknown command or invalid arguments: "print". Enter ".help" for help
To solve it, install a new version of sqlite3. For example using brew:
> brew install sqlite3
and replace sqlite3 in run.sh for the brew version: /usr/local/Cellar/sqlite/3.8.6/bin/sqlite3
- Files from: miband_analytics need to be in the same folder than miband_extract

With these modifications it is working properly in my mac.
Keep up the good work!

Thank you for your feedback.

Regarding SDPath, I'll put a a more clear explanation that SDPath may need to be changed depending on device.
For ADB privileges, the way you had to enable it might be specific to your Android version (I've granted permissions in a different way on my phone), but generally speaking the application should work through Backup logic even when adb has no root permissions.
For sqlite3 issue, could you please tell me which version of sqlite3 OSX has by default, so can add a note in instructions about version compatibility?
Regarding same folder location, I think there is already a mention about the need to have both packages exptracted to the same folder.
4th February 2015, 09:25 AM |#16  
Junior Member
Thanks Meter: 3
 
More
Quote:
Originally Posted by xmxm

Thank you for your feedback.
For ADB privileges, the way you had to enable it might be specific to your Android version (I've granted permissions in a different way on my phone), but generally speaking the application should work through Backup logic even when adb has no root permissions.

I got a message in my Android asking for permission to do the backup, but at the same time I saw the "permission denied" message in the console. Maybe I got both because the script tries to get data from two different mechanisms. Even if I clicked yes to do the backup, the script was not able to get the data until adb was granted permissions.

Quote:

For sqlite3 issue, could you please tell me which version of sqlite3 OSX has by default, so can add a note in instructions about version compatibility?

My Mac with OSX 10.9 (Mavericks) had installed sqlite3 version 3.7.13. I think that the required commands were added in 3.7.15, but I could be wrong. Brew has installed 3.8.6 and is working properly.
The Following User Says Thank You to SynerG For This Useful Post: [ View ] Gift SynerG Ad-Free
4th February 2015, 04:37 PM |#17  
OP Senior Member
Thanks Meter: 167
 
More
Quote:
Originally Posted by SynerG

I got a message in my Android asking for permission to do the backup, but at the same time I saw the "permission denied" message in the console. Maybe I got both because the script tries to get data from two different mechanisms. Even if I clicked yes to do the backup, the script was not able to get the data until adb was granted permissions.

Windows version supports ForceBackupMode=Y setting to skip root-specific method and go straight for backup method, but I guess that run.sh is outdated by now - I'll need to find a way to copy newest logic changes to unix script. I still think hope that giving ADB root is not mandatory for extract to work.

Quote:

My Mac with OSX 10.9 (Mavericks) had installed sqlite3 version 3.7.13. I think that the required commands were added in 3.7.15, but I could be wrong. Brew has installed 3.8.6 and is working properly.

Thank you for this information - I'll put version numbers in the header.
4th February 2015, 10:42 PM |#18  
Junior Member
Thanks Meter: 7
 
More
Quote:
Originally Posted by xmxm

Windows version supports ForceBackupMode=Y setting to skip root-specific method and go straight for backup method, but I guess that run.sh is outdated by now - I'll need to find a way to copy newest logic changes to unix script.

You will find attached a zip with a new version of run.sh.
run.sh now support ForceBackupMode and internalization.
Thats why I add 2 folders (po and i18n).

If you want to add support for a new langage, let's say spanish for example, you will first have to create a new po file

Code:
bash --dump-po-strings run.sh > po/es.po
Then edit the file newly created with any text editor and translate the "msgid" with the "msgstr"

Once done, you have to create a new directory for the compiled langage file (.mo)

Code:
mkdir mkdir -p i18n/es/LC_MESSAGES/
Then compile the file with

Code:
msgfmt -o i18n/es/LC_MESSAGES/mibandextract.mo po/es.po
For another langage replace "es" with the one you want.
If you do not want to use the i18n folder and want the langage file to be system wide, you just have to comment (adding a #) the line "export TEXTDOMAINDIR=./i18n/" in the script.
Then you will have to move your po file to /usr/share/locale/XX/LC_MESSAGES/ (where XX is your langage).
Attached Files
File Type: zip miband_extract_v535_i18n.zip - [Click for QR Code] (1.56 MB, 104 views)
The Following 2 Users Say Thank You to jlaunay For This Useful Post: [ View ] Gift jlaunay Ad-Free
6th February 2015, 06:05 AM |#19  
OP Senior Member
Thanks Meter: 167
 
More
Version updated to 5.5 with better support for FitnessSyncer and some chart updates
The Following 3 Users Say Thank You to xmxm For This Useful Post: [ View ] Gift xmxm Ad-Free
6th February 2015, 06:22 PM |#20  
Junior Member
Thanks Meter: 1
 
More
Thumbs up Good Work
Quote:
Originally Posted by xmxm

Version updated to 5.5 with better support for FitnessSyncer and some chart updates

Thanks for your work!!!
8th February 2015, 04:54 PM |#21  
kratos69's Avatar
Senior Member
Flag Spain
Thanks Meter: 17
 
More
Awesome tool,
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes