-
-
Notifications
You must be signed in to change notification settings - Fork 367
Beurer BF 500 support #1262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Beurer BF 500 support #1262
Conversation
|
Thanks for your PR. I have fixed the conversation to % before publishing there was already a function But the only really BF500 different what you have made (which i can see) is that you UDS_CP_LIST_ALL_USERS -> {
logD("UDS LIST_ALL_USERS response: ${value.toHex()} (result=$result)")
if (result == UDS_CP_RESP_VALUE_SUCCESS) {
if (value.size >= 4) {
val count = value[3].toInt() and 0xFF
logD("LIST_ALL_USERS: user count=$count")
if (count > 0 && value.size >= 4 + count) {
val indices = mutableListOf<Int>()
for (i in 0 until count) {
indices += (value[4 + i].toInt() and 0xFF)
}
logD("Available user slots: $indices")
presentChooseFromIndices(indices)
} else {
logD("LIST_ALL_USERS success but no users found, defaulting to 'Create new'")
findKnownScaleIndexForAppUser(currentAppUser().id)?.let { idx ->
saveUserIdForScaleIndex(idx, -1)
logD("Cleared previous mapping for currentAppUserId at scaleIndex=$idx")
}
presentCreateOnlyChoice()
}
} else {
logW("LIST_ALL_USERS payload too short, using fallback")
presentCreateOnlyChoice()
}
} else {
logW("LIST_ALL_USERS not supported or failed, switching to read-only mode")
userInfo(R.string.bt_info_read_only_mode_no_consent)
userInfo(R.string.bt_info_suggest_create_new_user)
presentCreateOnlyChoice()
}
}so the question is what is BF500 reporting back after they receive the following writing private fun requestUdsListAllUsers() {
val payload = byteArrayOf(UDS_CP_LIST_ALL_USERS.toByte())
logD("→ UCP LIST_ALL_USERS")
writeTo(SVC_USER_DATA, CHR_USER_CONTROL_POINT, payload)
}Could you provide the debug log with the latest dev version? |
|
Good news, your changes to the GATT handling in the latest commits definitely fixed the user association, from an earlier log on 2026-01-02: Now we've got at least the user set up working, the scale auto associates. Yes, the problem is the consent (from the latest log): This happened before, too - sorry for not being clear on this. I've created a zip with 3 files:
I've cut the packet logs to the relevant portions, it is filtered for the MAC of the Scale. If you need more data, feel free to ping, I'll try to answer as soon as I can. Thanks for your efforts and patience. openscale_bf500_417aa74d4dda006a4cb2dac178bf94f643745f7f.zip |
|
According to the Bluetooth User Data Service (UDS) specification, result code 0x04 means Operation Not Permitted. Logically, the consent therefore succeeds, but the response is currently logged as unhandled instead of being treated as OK. That said, it is also possible that the scale interprets this result differently. Further investigation on the device-specific behavior would be required to determine the exact issue why you don't get any measurement. |
|
I will close this PR for now if you find out how the BF500 handles user responses please open a new PR. Thanks. |
Summary
Fixes Beurer BF500 scale support by:
Closes #1034
BF 500: What works
Initial pairing requires:
onBondingFailedcallback to make this more obviousMeasurement flow:
Issues Fixed
Body Composition Values Incorrect
Problem:
Root Cause:
Transformations happened during parsing, before packets were merged. Weight arrived in a separate packet, so conversions failed.
Solution:
Separated transformMeasurement from parseWeightToMeasurement, so one has in transformMeasurement always the weight present for calculations.
Issues left
Problem:
Log evidence:
Disclaimer for transparency: I used AI (Claude) to aid in generating the descriptions, for debugging and for the code.
I refactored and reviewed the code, tested it and tested with the scale to the best of my knowledge.