You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What I receive is something different then what I did send.
Steps to reproduce.
Implement a Generic Battery Server on device A
Implement a Generic Battery Client on device A
Provision both devices (I did use the nRF Mesh app from Nordic)
Setup publication on the Generic Battery Server model to publish to group X
Setup subscription on the Generic Battery Client model to subscribe to group X
Observe what gets send by the server and what gets received by the client - e.g. by logging the values
Also use the nRF Mesh Sniffer app to sniff the traffic between the two nodes
Debug Logs.
More Information.
The following screenshot shows how the message looks like when sniffed and how it is (correctly I think) interpreted. Please focus on Time to Discharge and Time to Charge and ignore Battery Flags (there seems to be an issue on the Nordic side).
On the receiver side we log the following for the same mesh message.
I (1304601) Client -- Received Generic Battery Status
I (1304601) Client -- Battery Level: 100
I (1304601) Client -- Time to Discharge: 1576960
I (1304611) Client -- Time to Charge: 8656384
I (1304611) Client -- Flags: 0x00
Note that Battery Level is fine but Time to Discharge and Time to Charge is wrong.
Please see the following screenshot that shows the expected and the actual value. Please note how similar the bit pattern is. I think there is an error in the above code that leads to some bits being shifted wrongly.
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
Bluetooth mesh: Generic Battery Client parser does not correctly parse Generic Battery Status Messages
Bluetooth mesh: Generic Battery Client parser does not correctly parse Generic Battery Status Messages (IDFGH-14593)
Feb 6, 2025
Answers checklist.
IDF version.
v5.4 and git master
Espressif SoC revision.
ESP32-C3
Operating System used.
Linux
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
None
Development Kit.
Seeed Studio XIAO ESP32C3
Power Supply used.
USB
What is the expected behavior?
I'm sending
Generic Battery Status
messages from aGeneric Battery Server
model to aGeneric Battery Client
model.I would expect the parameters for
time_to_discharge
andtime_to_charge
to be the same on the receiver side then they have been on the sender side. See: https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/bluetooth/esp-ble-mesh.html#_CPPv436esp_ble_mesh_gen_battery_status_cb_tWhat is the actual behavior?
What I receive is something different then what I did send.
Steps to reproduce.
Generic Battery Server
on device AGeneric Battery Client
on device AnRF Mesh
app from Nordic)Generic Battery Server
model to publish to groupX
Generic Battery Client
model to subscribe to groupX
nRF Mesh Sniffer
app to sniff the traffic between the two nodesDebug Logs.
More Information.
The following screenshot shows how the message looks like when sniffed and how it is (correctly I think) interpreted. Please focus on
![Image](https://private-user-images.githubusercontent.com/1310280/410656906-489d04b7-ba7d-4957-b628-349d0989756c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NDAxOTgsIm5iZiI6MTczODkzOTg5OCwicGF0aCI6Ii8xMzEwMjgwLzQxMDY1NjkwNi00ODlkMDRiNy1iYTdkLTQ5NTctYjYyOC0zNDlkMDk4OTc1NmMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMTQ1MTM4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZGI3NDY4NjJlNzE3NmNhZGQyYzE2ZmUxNDgyN2RhZTI3YWQzNWI5Zjg3NzJjNWVhY2U4Y2ExNGE2ZWIyM2RiMiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.PVJtRJ1JI3Ng0Hh9b_HYTBNl7FJkzn6zroWCePbctgA)
Time to Discharge
andTime to Charge
and ignoreBattery Flags
(there seems to be an issue on the Nordic side).On the receiver side we log the following for the same mesh message.
Note that
Battery Level
is fine butTime to Discharge
andTime to Charge
is wrong.I think the issue can be found here:
esp-idf/components/bt/esp_ble_mesh/models/client/generic_client.c
Lines 306 to 312 in c586527
Please see the following screenshot that shows the expected and the actual value. Please note how similar the bit pattern is. I think there is an error in the above code that leads to some bits being shifted wrongly.
![Image](https://private-user-images.githubusercontent.com/1310280/410658788-0549c184-bdd4-4cab-853c-2ee6acaf559a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5NDAxOTgsIm5iZiI6MTczODkzOTg5OCwicGF0aCI6Ii8xMzEwMjgwLzQxMDY1ODc4OC0wNTQ5YzE4NC1iZGQ0LTRjYWItODUzYy0yZWU2YWNhZjU1OWEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMTQ1MTM4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MTdlMDNjNTUxZjE5NWJmN2I4ZTEwMjA5MjFhNzA3NmNiYTg1MzA0YjY0YzM1NWYyODMxNTMwNmMzMjA2MGRmMCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.A0DJzLBNzEMlNSVNkeAKNhyaB2StMOOm9017uTooN68)
The text was updated successfully, but these errors were encountered: