-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Added ble Battery level to measurements #445
Conversation
Goes along with issue #443 I'll work on stability testing and it looks like we should add some changes to the html for displaying this data as well. Thanks! |
@Flo100 - Looking good! I could have saved you some work - I thought that characteristic required a subscription, hence adding it into postConnect(). Since it only needs to be read, I just moved it into a function in the SpinBLEClient class and am only calling it from there. If this works for you, please let me know and then we can continue integrating this so we can access it via the webserver. |
No problem. A subscription is also possible. But since it indeed isn't time critical I decided to use polling every 5 minutes.
I'll let you know. I now use it to show it on my Nextion display, along with power, cadence and some other parameters. I had no dropouts or other issues with it so far. |
I think it would be awesome if we added a '#define NEXTION' in settings.h and '#ifdef NEXTION' '#endif' around any Nextion code with the main body of Nextion code in its own .h & .cpp . It might be a great foundation of down the road supporting displays in the main app. We could always switch to multiple software channels or to a userConfig parameter if you think it would be popular. |
Also, I would LOVE to see a picture of your setup! Sounds amazing! |
I get the batterylevel upon connection and it gets updated every 5 minutes. |
Weird that the resets to 0 that were in "onDisconnect" weren't getting called. I placed the same spinBLEClient.handleBattInfo(pClient); function in that callback now. Both of those characteristics should return nullptr on the disconnect so it should read 0. Will see if it fixes it. |
Sorry, I see now that I wasn't clear in my reaction and made a typo. |
Okay - I'll take a look at it. |
Because handleBattInfo is now a function the last_battery_update counter gets set when a pm OR hrm gets connected the first time. |
No description provided.