50ButtonsEach / fliclib-linux-hci

Flic SDK for Linux
305 stars 55 forks source link

Batterystatus always return -1 #84

Open osos opened 5 years ago

osos commented 5 years ago

I have implemented the new batterystatus, however, the batterystatus event always returns -1.

I am running the flicd linux 64-bit version on a raspberry pi 3.

Could it be that my flic buttons does not support batterystatus? If so can they be firmware updated?

Please advise.

osos commented 5 years ago

From the flic.sqlite3: (partly anonymised)

sqlite> select * from buttons; my_bdaddr|my_bdaddr_type|bdaddr|button_uuid|serial_number|color|curvekey|curvekey_signature|h1|h3|last_values|button_counter|boot_counter|battery_samples|next_battery_index|battery_timestamp b8:27:eb:d0:xx:xx|0|80:e4:da:71:f2:11|085fdd0237fcaf0cf36d313f9c5121b0|AF25-B04264|black|xxxx|xxxx|xxxx|xxxx|1|612|3||0|0

It seems that colums "battery_samples", "next_battery_index" and "battery_timestamp" are always void or zero, which indicates that the "flicd" server never receives or updates the batterystatus.

aboulfad commented 5 years ago

Bump... I've tested few different flic's (old and recent) and none return battery status and return -1. It's too bad there is no traction or follow-up on most issues.

osos commented 4 years ago

@Emill, any change of an answer on this one?

The problem is, I have some buttons which re rarely used and the event to be triggered is happening in a remote location, so the one pushing the flic button must rely on the button to work. Thus, I need to monitor the buttons to ensure battery is sufficient.

Or, is it possible to ping the buttons?

Emill commented 4 years ago

How do you mean ping the buttons? If a button is disconnected and it's not advertising, then the radio is off. If you want to monitor the battery level the button must be connected.

osos commented 4 years ago

So how will I ensure that the button remains connected to advertise its battery status? The buttons event does all get through until out of battery. Battery status seems not to be advertised during button events.