Skip to content

Fix false-positive unlocks: gate unlock on smoothed RSSI + minimum sample count - #183

Open
7onnie wants to merge 194 commits into
ts1:masterfrom
7onnie:fix/smoothed-unlock-debounce
Open

Fix false-positive unlocks: gate unlock on smoothed RSSI + minimum sample count#183
7onnie wants to merge 194 commits into
ts1:masterfrom
7onnie:fix/smoothed-unlock-debounce

Conversation

@7onnie

@7onnie 7onnie commented Jun 18, 2026

Copy link
Copy Markdown

The presence/unlock transition used a single raw RSSI sample, so one spurious strong reading (multipath reflection, advertising burst) could unlock the Mac from across the home. This computes the moving average first and gates the unlock on it plus a minimum sample count, and removes the buffer-clearing that destabilised the lock decision. Pure logic is covered by standalone tests in Tests/. Refs #153.

ts1 and others added 28 commits January 8, 2022 17:30
commit 8c6d4b9ede6e3e101ba8ce32ec1da66d24ebbe9e
Author: Takeshi Sone <takeshi.sone@gmail.com>
Date:   Sun Jan 16 14:55:04 2022 +0900

    Remove zip

commit edfa3aacdfde4111428a9c6530925b9ce30cf467
Merge: 803dc72 ea17760
Author: Takeshi Sone <takeshi.sone@gmail.com>
Date:   Sun Jan 16 14:54:13 2022 +0900

    Merge branch 'master' into cyberclaus-master

commit 803dc729de552ed42ed684ca07c6a5cd17f9b3a0
Author: Klaus-J <95517970+cyberclaus@users.noreply.github.com>
Date:   Sun Jan 9 18:24:13 2022 +0100

    Add files via upload

commit 42f921d4606898cbdc6adb7aade0895ebe902bfc
Author: Klaus-J <95517970+cyberclaus@users.noreply.github.com>
Date:   Sun Jan 9 18:16:07 2022 +0100

    Add files via upload

commit 4a25e743768fc7c17b280db3e3a36aa2d7b54639
Author: Klaus-J <95517970+cyberclaus@users.noreply.github.com>
Date:   Sun Jan 9 18:15:34 2022 +0100

    Add files via upload

commit 740d3ead61820e0e659f71df0913b881ee9e99b1
Author: Klaus-J <95517970+cyberclaus@users.noreply.github.com>
Date:   Sun Jan 9 18:14:33 2022 +0100

    Add files via upload

commit 98b9810afb44402c75a8cf35a47e244b8344dcca
Author: Klaus-J <95517970+cyberclaus@users.noreply.github.com>
Date:   Sun Jan 9 18:13:58 2022 +0100

    Add files via upload

commit 7bf49014eedbe533de0703440472097107aae265
Author: Klaus-J <95517970+cyberclaus@users.noreply.github.com>
Date:   Thu Jan 6 08:27:48 2022 +0100

    Delete sv.lproj directory

commit 67c2ae8480d3e5664711d083aafb37a3ec6021eb
Author: Klaus-J <95517970+cyberclaus@users.noreply.github.com>
Date:   Thu Jan 6 08:27:40 2022 +0100

    Delete nb.lproj directory

commit ab6eddaceec6d41460bb550b92ddd7a4a2045177
Author: Klaus-J <95517970+cyberclaus@users.noreply.github.com>
Date:   Thu Jan 6 08:27:30 2022 +0100

    Delete de.lproj directory

commit 4a0e55ff4ead4122a6107fa3f2777238af052f50
Author: Klaus-J <95517970+cyberclaus@users.noreply.github.com>
Date:   Thu Jan 6 08:27:21 2022 +0100

    Delete da.lproj directory

commit 0c793764eb768c799c4a058ffeb5319898d7174b
Author: Klaus-J <95517970+cyberclaus@users.noreply.github.com>
Date:   Thu Jan 6 08:25:44 2022 +0100

    Add files via upload

commit 9629522
Merge: 7b6d951 785d431
Author: Klaus-J <95517970+cyberclaus@users.noreply.github.com>
Date:   Thu Jan 6 08:30:05 2022 +0100

    Merge branch 'ts1:master' into master

commit 7b6d951
Author: Klaus-J <95517970+cyberclaus@users.noreply.github.com>
Date:   Thu Jan 6 08:28:36 2022 +0100

    Add files via upload

commit 328a4a4
Author: Klaus-J <95517970+cyberclaus@users.noreply.github.com>
Date:   Thu Jan 6 08:27:48 2022 +0100

    Delete sv.lproj directory

commit 364ffee
Author: Klaus-J <95517970+cyberclaus@users.noreply.github.com>
Date:   Thu Jan 6 08:27:40 2022 +0100

    Delete nb.lproj directory

commit a0204f2
Author: Klaus-J <95517970+cyberclaus@users.noreply.github.com>
Date:   Thu Jan 6 08:27:30 2022 +0100

    Delete de.lproj directory

commit 79e0ed3
Author: Klaus-J <95517970+cyberclaus@users.noreply.github.com>
Date:   Thu Jan 6 08:27:21 2022 +0100

    Delete da.lproj directory

commit 7096032
Author: Klaus-J <95517970+cyberclaus@users.noreply.github.com>
Date:   Thu Jan 6 08:25:44 2022 +0100

    Add files via upload
Fixed all of the "google translate" errors for the swedish translations
…ike false positives

The presence/unlock transition previously used a single raw RSSI reading, so one
spurious strong sample (multipath reflection, advertising burst) could unlock the Mac
from far away. Compute the moving average first and gate the transition on it plus a
minimum sample count; drop the buffer-clearing that destabilised the lock decision.
Refs ts1#153.
Eggwardhan added a commit to Eggwardhan/BLEUnlock that referenced this pull request Jul 24, 2026
@7onnie
7onnie force-pushed the fix/smoothed-unlock-debounce branch from 12eeddb to b2e0ef4 Compare August 6, 2026 12:52
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

Successfully merging this pull request may close these issues.

9 participants