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

org.bluez.Battery1 support #5

Open
tincore opened this issue Jul 6, 2018 · 7 comments
Open

org.bluez.Battery1 support #5

tincore opened this issue Jul 6, 2018 · 7 comments

Comments

@tincore
Copy link

tincore commented Jul 6, 2018

Thanks for the great work!

I'm using your dbus implementation and it is working :)

I was wondering if you are planning to add org.bluez.Battery1 interface anytime soon or maybe your are too busy. I'm afraid that, with the current API, it will need to be handled in a exceptional way because it is not visible as a normal service/characteristic.

@xrucka
Copy link
Owner

xrucka commented Jul 6, 2018

Hi, I've thought about it before, however did not put effort in it so far (didn't think it would come this soon :-). Given the nature of the binding, one would need to provide "virtual" characteristic, mimicking the original one. Might have look into that in next week(s), however cannot guarantee.

As I see it, following would have to be done: Interface extending bluetooth manager characteristic interface, providing method "isVirtual", implemented in current BluezCharacteristic and new VirtualCharacteristic. This one would then provide it's own implementation of reads and writes and following.

If you want to, you can implement it and query a pull request.

@vkolotov
Copy link
Contributor

Hi guys, yeah. Sadly, Bluez 5.48+ no longer provides battery characteristic anymore. Furthermore I found that 5.47 is the most stable version so far. Bluez 5.48 and 5.49 has introduced some issues which sometimes prevent establishing connection with bt devices.

So as per the current issue, there are a few way to get it working:

  1. Rollback bluez to 5.47 (as per this).
  2. Extend BluetoothManager to add a new interface as like as Bluez guys added the Battery1. Let all transport to implement it.
  3. Extend TinyB and DBus transports to "fake" battery characteristic like @xrucka mentioned above.

I personally like the idea to fake battery characteristic. This would allow us not to change the blugiga transport and just put a bandage on dbus transport...

What do you think?

@xrucka
Copy link
Owner

xrucka commented Jul 16, 2018

Hi, I wrote rudimentary support for Battery1 over the weekend, available for some testing (required some changes in internals) - see branch battery ; it does not support battery notifications -- there is no dbus signal explicitly associated with this interface.

Will probably need some changes in device. I, however, do not expect battery drain too fast, nor constantly connected devices - so I believe that manual updates of the battery level should be viable.

@tincore
Copy link
Author

tincore commented Jul 17, 2018

Thanks. Sorry that I could not collaborate. I'm very busy at the moment with work. :/

@xrucka
Copy link
Owner

xrucka commented Jul 17, 2018

@tincore Very well understood, very well :-D

@xrucka
Copy link
Owner

xrucka commented Sep 21, 2018

@tincore Hi, did you have time to check it up?

@xrucka
Copy link
Owner

xrucka commented Dec 4, 2018

@tincore xrucka/eclipse-smarthome-bluetooth-binding-dbus-transport branch rewrite_all + branch rewrite_all here should improve it a lot.

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