-
Notifications
You must be signed in to change notification settings - Fork 42
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
Add Battery status as payload? #24
Comments
Hello @epe ,
Actually this repo has a simple and generic implementation of the "Firmware for custom ESP32-based trackers" so I think add it to the repo will be a little bit strange and will add complexity to the code. I don't have how to test it now but i think you can add it just filling the Hashed flags inside the adv_data_raw GoogleFindMyTools/ESP32Firmware/main/main.c Lines 60 to 71 in e2e0e43
For add info on Hashed flags you can see this example GoogleFindMyTools/ESP32Firmware/main/main.c Lines 72 to 76 in e2e0e43
Remenber to respect the hashed flags field patern. I hope it help :) |
Oh, wow thanks for the insight. Even a "feedback" of 4 states could probably even be helpful in some applications! Further up in the document there is another chapter about battery notification: https://developers.google.com/nearby/fast-pair/specifications/extensions/batterynotification?hl=de |
Just a note: Reading out the battery status is only possible when the tracker is nearby, it is not sent with network reports. |
No this service is part of fast pair and basically a sibling to the FMDN functionality implemented in this repository. |
Sorry for this dumb question but how to calculate the hashed flags on the ESP32 ? |
Yes, the EIK is needed for this, as well as key rotation. Both are not implemented, therefore you cannot implement the battery status as proposed by Google, but you could implement a custom, more simpler battery status advertisement. |
Could the EIK also exposed by main.py so this can be used on the ESP32 side? I'm working on an Arduino based library (https://github.com/sivar2311/FMD-Arduino). |
Yes, the EIK could be exposed, but you would still need to implement the key rotation. I'm currently quite busy, and cannot work on this. |
I'm not so much into the technical Details. What is EIK/EID? It would be great if we could get this going .. there is plenty of usecases to send sensor data through this new kind of network :-) |
As mentioned above, the battery status is not sent over the network. Therefore, repurposing this to send sensor data is not possible. |
More info here not sure about bit order in 'Hashed flags' bit7..0 or bit0..7 |
@mrx23dot Check the Google FMDN Hashed flags docs. The problem is you have to hash the flag byte. |
EID? EIK? |
Yes you are right
it mislead me is that this byte is constant zero in this repo. So in order to use these fields some extra math is needed. i.e. to use battery indicator, and enable 'unwanted tracking protection mode' The engineering way is to precalculate the hashed values during key generation for each of 3 battery states, instead of having SHA256 on MCU. What does Status:1 Status:3 mean in main.py reports? |
I'm still unsure what you are trying to achieve with the battery status. Encrypting the battery status like Google does it provides no additional value, since it is not sent over the network. It's just for local communication, meaning it would be much, much simpler to just not encrypt it if you want to read out the Battery status of the ESP. Regarding the meaning of the status: |
Hi!
Thanks for your great work. would it be possible to publish the battery level as a payload.
IIRC for Find my Devices you can not only see the location, but also its battery level.
If i have a Powerbank, add an ESP32 that measures its capacity, can I add this value 0-100% somehow to this code to publish that ?
The text was updated successfully, but these errors were encountered: