Skip to content
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

Cannot get characteristics of battery service #41

Open
Firefox2005 opened this issue Jan 21, 2019 · 3 comments
Open

Cannot get characteristics of battery service #41

Firefox2005 opened this issue Jan 21, 2019 · 3 comments

Comments

@Firefox2005
Copy link

I'm struggling with reading the battery value of a peripheral.
The peripheral is based on a Nordic nrf52 and implements the battery service 0x180F and a read characteristic.

After connecting to the device I can find the battery service, but it does not contain any characteristics, although I can confirm that they exist with the 'nrfConnect' app.

Has anyone succeeded in reading the battery value of a peripheral or in discovering its battery characteristics?

@Snevzor
Copy link

Snevzor commented Jan 21, 2019

Have you previously connected to the peripheral using Bluez without the battery service implemented?
Bluez stores the resolved services for each peripheral and does not resolve again unless you specifically remove them.

@Firefox2005
Copy link
Author

Yes indeed! But unfortunately that did not do the trick. I deleted the cache and also checked with another device where it didn't work as well.

@weliem
Copy link

weliem commented Nov 24, 2019

The Battery Service and its characteristics are hidden by the battery plugin that is loaded at startup of bluetoothd.

You can simply tell bluetoothd to not load the battery plugin and you'll be able to access the Battery Service. To do so startup bluetoothd with '-P battery'. Edit the bluetooth.service file to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants