Unable to Get RSSI from Flic 2 Using fliclib-linux-hci on Raspberry Pi
-
I’m working with a Flic 2 button and a Raspberry Pi Zero 2 W, using the fliclib-linux-hci Git SDK.
I successfully built my own Debian package from the SDK and installed it on the Pi:
Package:
flicd_1.0-1_arm64.debThe daemon installs and runs correctly. Below is the systemd service I’m using:
cat /etc/systemd/system/flicd.service
[Unit]
Description=Flic Button Daemon
After=bluetooth.target
Requires=bluetooth.target[Service]
Type=simple
ExecStart=/usr/bin/flicd -f /var/lib/flicd/flic.sqlite3
Restart=always
RestartSec=3
User=root[Install]
WantedBy=multi-user.targetPairing and button events work fine, so communication with the button is confirmed.
Issue
I’m trying to read RSSI (signal strength) from the Flic 2 button, or otherwise estimate distance between the Pi and the button.
I’ve tried multiple code variants (both modifying the SDK and external BLE approaches), but I’m unable to retrieve:
RSSI values
Any distance-related data
It seems like RSSI is either not exposed through the SDK, or not available during normal operation.
Questions
Is RSSI data available at all from Flic 2 via fliclib-linux-hci?
If not, is there an alternative supported way to estimate proximity or distance?
Does the Flic firmware intentionally block RSSI access for power or privacy reasons?
Has anyone successfully retrieved RSSI from a Flic 2 on Linux/Raspberry Pi?
Any guidance, confirmation, or examples would be greatly appreciated.
Thanks in advance! -
@Emil Ya it be a great help write now i am using a python progame on pi to run 24/7 to recive signal for flic device i have provide the code below
#!/usr/bin/env python3 import fliclib from datetime import datetime button_rssi = {} def now_ts(): return datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[:-3] # Advertisement RSSI (best-effort) def on_advertisement_packet(scanner, bd_addr, name, rssi, is_private, already_verified, already_connected_to_this_device, already_connected_to_other_device): button_rssi[bd_addr] = rssi print(f"{now_ts()} ADV {bd_addr} RSSI={rssi} dBm") def on_button_event(channel, click_type, was_queued, time_diff): click_name = str(click_type).split(".")[-1] rssi = button_rssi.get(channel.bd_addr, "N/A") print(f"{now_ts()} BUTTON {channel.bd_addr} {click_name} RSSI={rssi}") def got_button(bd_addr): print(f"{now_ts()} Found verified button {bd_addr}") cc = fliclib.ButtonConnectionChannel(bd_addr) cc.on_button_single_or_double_click_or_hold = on_button_event client.add_connection_channel(cc) # ---- MAIN ---- client = fliclib.FlicClient("localhost") #scanner = fliclib.ButtonScanner(client) scanner = fliclib.ButtonScanner() scanner.on_advertisement_packet = on_advertisement_packet client.add_scanner(scanner) client.on_new_verified_button = got_button client.handle_events() dietpi@DietPi:~$ -
If you want to get the RSSI value on a connected button, we must send a HCI command to the Bluetooth controller and ask to get the latest value. Do you have a suggestion for how such an API should look like from the client side?