Skip to content

Advertise the Bluetooth proxy as an iBeacon - #7

Merged
ygelfand merged 7 commits into
ygelfand:mainfrom
baronfel:feature/ble-ibeacon
Aug 13, 2026
Merged

Advertise the Bluetooth proxy as an iBeacon#7
ygelfand merged 7 commits into
ygelfand:mainfrom
baronfel:feature/ble-ibeacon

Conversation

@baronfel

@baronfel baronfel commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR makes echod emit a BLE iBeacon for use in BPS or other triangulation-based tools.
The iBeacon uses a custom UUID so echolocal installs are identifiable, and it sets the minor field of the iBeacon to a value derived from the MAC address of the device.

Since advertising and scanning use the same radio, the radio integration/listeners/senders needed enhancements to

  • better handling waiting for command completion
  • handle events that get logically split across buffer reads
  • handle transient radio reboots/startup failures

The MAC address was repeatedly calculated across a few areas of the echod codebase, so I took an opportunity to centralize that so all callsites are consistent.

The four new commits

  • push down the MAC calculation
  • change the iBeacon to use the MAC
  • handle split/multi-command buffer reads
  • enable retries during radio startup

Fixes #6

Home Assistant retains its requested scan mode while the proxy reconnects.
Waiting for a subscription before scanning reports NONE against that request,
which makes Home Assistant mark the scanner as broken and ask for a power cycle.

Keep the radio scanning whenever the proxy is enabled, but discard reports until
a client subscribes so unused advertisements do not fill the delivery queue.
Comment thread internal/feature/bluetooth/beacon.go Outdated
baronfel and others added 4 commits August 13, 2026 10:34
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Comment thread internal/hardware/ble/ble.go Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@ygelfand

Copy link
Copy Markdown
Owner

thx this lgtm, will merge and tag a new release in a bit

@ygelfand
ygelfand merged commit 8ec13ea into ygelfand:main Aug 13, 2026
1 check passed
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.

Expose a BLE iBeacon advertisement to work with extensions like BPS

2 participants