agittins / agittins/bermuda

Data gathering for iOS device traffic invisible to Bermuda

未关闭
#375 33 条评论 0 个 reaction 已指派 1 人 已被 @agittins 认领 在 GitHub 查看
cogitating discussion iOS Transmit Outages moreinfo
主要语言
Python
星标
2k
派生
70
PR 合并指标
30 天内没有已合并 PR

描述

> [!IMPORTANT]
> Update 2025-05-20: I think this issue should be either solved, or much improved with the recent release of v0.8.2-beta3 (and therefore the full v0.8.2). Reports of success or failure are both welcome!
>
> The core issues seem to have been combinations of:
> - rate of MAC rotation being high - fixed by Bermuda switching to using callbacks from Private BLE Device instead of watching it's sensors
> - bugs introduced while restructuing bermuda's advertisement gathering circa v0.8.0
> - Some traffic from iOS devices not being passed on to Private BLE Device (fixed by implementing IRK-checking in Bermuda, but PR will be submitted to habluetooth when cause verified)
> - (possibly) devices switching between multiple IRK MACs active at the same time - fixed in Bermuda by keeping a log of all possibly-valid MACs for each metadevice.

This issue is to (hopefully) gather data from people who can capture iOS BLE traffic at times when Bermuda considers the device to be `AWAY` or `UNAVAILABLE`.


> [!IMPORTANT]
> There might be a bug where iOS devices go "unknown" *specifically* when they have the HA Companion app open and foregrounded. If that sounds like you, please subscribe to #544 and comment with which of your iOS devices do and don't suffer from it, and their iOS and HA Companion versions. Thanks!


The operating theory is that these devices *might* be sending identifiable traffic, but the habluetooth lib [might be filtering](https://github.com/Bluetooth-Devices/habluetooth/blob/306c460a4bbc86286820c22757208fd85b5e56b9/src/habluetooth/manager.py#L448) it out, making the device invisible to Bermuda.

If you've managed to save some data from iOS broadcasts while Bermuda considered the device "away", please upload the saved file here, and optionally, include some screenshots if they're interesting, and any comments if things were noteworthy (eg, "I think the data at 01:32:45 was when I opened my airpods case..")

Thanks!

Post to the HA community group:

# Help with analysing iPhone traffic

Howdy all - I am interested in seeing if we can do better with spotting iPhones. The HA bluetooth library does a bit of filtering on certain apple traffic, and I am wondering if it is causing Bermuda to not be able to see iPhones at times when they are actually transmitting.

Unfortunately, the only iOS devices I have here are older ones, and they are annoyingly rock-solid at being detected.

If you have:
- at least one iOS device that should be always visible, but Bermuda often shows as `away` or `unavailable`
- another phone/tablet that can run NRFConnect or similar
- a bit of time to stuff around

then perhaps you could help! :slight_smile:

What I would like to see is if there is any BLE traffic being sent by an iOS device at a time that Bermuda thinks it's away. In NRFConnect, the "More" screen gives a graph of adverts, colour-coded by content, and below that a summary of the adverts as they change over time. You can then hit the three-dots, Save, and choose "Save to file". If you could gather that and forward the data to me, we might be able to find more reliable ways to track iOS devices when they go into their various power-saving modes. Or not - at this stage it's just a theory without supporting data.

# User reports of iOS transmit outages

Issue #369
- Recent iPhone?
- Mainly happens on arriving home, BT adverts don't start for perhaps 15 minutes
- Suspect possible interaction with not transmitting until after home wifi is active?

Issue #385, #323
- Iphone 15, iPhone 15PRO
- iOS 18.0.1 (both)
- Daytime usually OK, outages between ~ 9PM and 1AM.

# Potential fixes
- Install the Room Assistant App, as it sends BLE broadcasts
- Install a COVID19 exposure tracking app, as they seem to be able to transmit reliably
- An iOS setting "Auto-toggle visibility" being turned *off* may improve things. Unclear where this setting is or how it's accessed or enabled. Perhaps an app needs to be granted location permissions first, then it shows up in this list? Not sure.

The [espresence docs](https://espresense.com/beacons/apple) state:
> Note: Some iOS devices do not emit a beacon while the phone screen is off if there is not a reason for the device to broadcast a signal, consequently the device may not appear while the screen is off. Something like an iWatch, Universal Clipboard with Handoff enabled, or other services that require the phone to communicate regularly may resolve this issue as they require the subject iOS device to communicate while ‘sleeping’. In the case you do not have a bluetooth device like an iWatch, some people report that using background apps like iCloud Family Sharing, iCloud Photo Backup, or Room Assistant have convinced the device to communicate while ‘sleeping’. This issue is not universal, but it’s not clear why this occurs at this time and you may not experience this issue even if the device seemingly has no reason to communicate.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。