Open ValdikSS opened 1 year ago
There's also a difference in the interface when using openScale compared to the official application.
When I weight with bluetooth disabled in openScale, the top line is blinking upon completion, however it does not do that with official application.
During my tests just now, when the scale is first used with the official application and then connected to openScale, openScale does retrieve historical data. This is probably the protocol.
According to reverse-engineered protocol reference, openScale implements 1e protocol version, while my scale uses 1f.
Quote from the document:
Example command: 0d 05 13 00 16
Example response: 0d 1e 05 05 1e
However, my scale responds with 0d 1F 05 05 1F
@oliexdev, for the historical data to be retrieved, the "sync time" command must contain 0x14 in the 8th byte.
I want to make it 0x14 only if the protocol version is 1F, but it seems I can't receive any data inside onBluetoothNotify()
until the state machine processes steps. I tried to call setNotificationOn()
as the first step, but that did not help.
Please tell me how can I receive the notification data inside state machine.
The command writeBytes(WEIGHT_CMD_SERVICE, WEIGHT_CMD_CHARACTERISTIC, magic_bytes);
has to be send to retrieve something inside onBluetoothNotify()
Then you should retrieve your respond.
I've played with the code over several days in May, but I still could not make the scale to send historical data reliably. When something is not right with the configuration, the "progress bar" on the scale blinks after weight process, and either this data is not saved into internal memory or something other happens.
Don't know the reason yet. The only thing this is really different from the official application and openScale is that openScale uses modify-with-create opcode upon adding new person while the official almost always prefers add-new opcode. But this is also not reliable and openScale worked fine with my modifications over the course of several days, and then it stopped working again.
Overall, I updated the protocol version and fixed some things to resemble the official application.
Describe the bug openScale is unable to retrieve historical data from Yunmai M1501 scale, while the official Yunmai application supports this function (double-checked with the tests). Moreover, openScale has retrieved the historical data once, but now I'm unable to reproduce that.
To Reproduce Steps to reproduce the behavior:
Version v2.5.1 (63)
Expected behavior openScale retrieves historical data from the scale
Additional context I assume that the older protocol is implemented in openScale, made for YunmaiSE_Mini (according to the debug log). The debug log shows that the weight information transferred only upon completion, however official application shows the weight in real time. That's why it's probably an improved protocol.
Debug log (slightly edited) openScale_2023-05-26_17-54.zip