after my plan of acquiring a Pebble Time 2 and use it with Gadgetbridge was sadly destroyed by FitBit, I finally settled with the Amazfit Pace as my first ever smartwatch.
Like most people around here, I would like to keep my personal data as private as possible. Therefore I hope that the watch can be used with Gadgetbridge sometime, and I hope to be able to contribute to that.
The Amazfit Pace is a Smartwatch with a focus on sports / activity tracking, mainly running, with build in GPS and heart rate monitor. It is manufactures by a sub-brand of Xiaomi, the makers of the Mi Bands that are already supported by Gadgetbridge. Because of that last fact, I hope that maybe the communication between watch and app might be, at least partly, already implemented in GadgetBridge (one can dream, right?).
I realize that the developers here are already very busy, and I have nothing but respect for the dedication and the time they invest. I do embedded programming for a living and have worked with different buses and protocols in the automobile sector. Therefore, the Bluetooth logs I acquired in the last two days look somewhat familiar to me. I was surprised how well Androids Bluetooth Logs and Wireshark work together. However, I don’t have any experience with Java, Bluetooth or Android development. So, while I would really love to actively contribute here, I will definitely need some help.
The watch arrived on this past Sunday, 01.01.17, and here is what I did and found out so far:
- Before pairing the watch with the official app, I tried to search for it with Gadgetbridge, plain Android settings as well as a Linux laptop (hcitool scan, hcitool lescan). None of the three managed to find it.
- This seems to be the first stepping stone: there is no option in the watches menu to make it visible or detectable. When selecting the Bluetooth option in the watches menu, it displays the caption “Searching...", no option to make it visible. It supports bluetooth headphones, hence the search I guess.
- To pair the watch with the official app, a QR code is displayed on the watch that is then scanned by the app, then the pairing takes place. For me this is consistent with the assumption that the watch is not detectable like most Bluetooth devices, but has to be addressed directly. I have a btsnoop-Log of the procedure, but have not had the time to analyze it properly.
- I tried several times to find the device with Gadgetbridge and the Android Bluetooth menu, while paired to the official app and while unpaired, but to no avail.
- The last ting I tried was talking to the device directly by using the Bluetooth MAC address that can be found in its menu, and that finally worked with the linux laptop: by issuing hcitool info MAC-Address I was able to extract the attached information: amazfit_pace_info.txt. This does not mean a whole lot to me right now, but I guess it helps.
I will set up android-studio on my machine and will check out and try to understand some code as soon as I find the time (3 kids, I know, everyone has excuses...). In the Polar M400 request issue #455 a certain diff was mentioned that shows the work done to support a new device, I will have a look at that too.
Furthermore, I will try to analyze the communication between official app and watch some more. So far there is a lot of plain ASCII that I found, but also many parts I do not understand yet. I have attached a small log that shows the reception of an e-mail with k-9 mail: btsnoop_hci_mail_received.txt
I was not allowed to attach the binary .log-file here, so I had to rename it to .txt,I hope that is ok.
If somebody finds the time to have a look at this and finds something familiar, that would be awesome.
However after that, I am unsure how to proceed. Without knowing much more, my plan was to add the possibility of manually entering a MAC-address to the Gadgetbridge code (I guess the Debug section would be a good place for that) and then see if I can get some basic responses from the watch.
- Does this seem like a viable plan to you or am I getting ahead of myself?
- Should I focus on analyzing the communication first, to check if an implementation into Gadgetbridge is even possible?
- Is there anything else that you would do before touching the code, any additional information that I should extract first?
I really do hope to find the time to contribute here, until then, thank you very much in advance and have a nice day.