Posts: 1
Joined: Sun Feb 17, 2019 10:14 pm

Bluetooth takes too long to timeout

Sun Feb 17, 2019 10:34 pm

Hi all,

I've had my Pi for a while but quite new to using it in this way so I'd appriciate any help.

I'm trying to setup a python-based script that pings a list of Bluetooth mac addresses using FrederikBolding's bluetooth-proximity code (, the idea is to create a system that can determine if a device is in range and inside the same room as the Pi based on RSSI signal strength. This works fine for the most part, however, I have noticed that it takes 5-7 seconds for the command to time out when the target device is not in range/not running Bluetooth, I have tried Frederik's .request_rssi(), sudo l2ping -t 1 and hcitool name, and all of them take the same period of time to time out with a failure (even with l2ping using -t 1).

I have gone as far as trying timeout with SIGINT and SIGKILL, but still can't get it to give up fast enough. Following ... s-on-linux I have tried to tweak /sys/kernel/debug/bluetooth/hci0/supervision_timeout but I don't know if a step is needed to have it take effect, or if that's the wrong thing to modify.

tl:dr is there a way to force a faster timeout with Bluetooth on a Pi 3 B+ running the latest Raspbian?

Return to “Beginners”