Skip to content

_bleio: iPhones can't see BLE extended advertisements; add a secondary_phy option #12020

In review

Description

@Lotram

iPhones don't see BLE advertisements longer than 31 bytes from CircuitPython, because the data part is sent on the 1M PHY.

What happens

_bleio.Adapter.start_advertising() switches to extended advertising when the data is longer than 31 bytes.
An extended advertisement has two parts.
The first part always goes on the 1M PHY.
The second part holds the data, and the Espressif port also sends it on 1M.
The secondary PHY is hardcoded in ports/espressif/common-hal/_bleio/Adapter.c.

iOS does not receive the second part when it goes on 1M.
The iPhone does not see the advertisement at all.

How I tested

The board is an Adafruit QT Py ESP32-S3.
The phone is an iPhone 13 mini, iOS 27.2.1, scanning with nRF Connect.
A Linux PC with BlueZ to control.
The board advertised one connectable extended advertisement of 57 bytes, with 9 dBm TX power and a 200 ms interval.
Only the secondary PHY changed between runs.

In runs 1 to 3, I flashed a different firmware for each PHY.
The 1M firmware is main, and the 2M firmware changes only the hardcoded PHY.
In runs 4 and 5, one firmware ran the whole time.
It includes the secondary_phy parameter proposed below, and Python code switched the PHY.

Run Firmware Secondary PHY iPhone PC
1 main 1M not seen seen
2 hardcoded 2M 2M seen seen
3 main 1M not seen seen
4 with the parameter secondary_phy=2 seen seen
5 with the parameter secondary_phy=1 not seen seen

The PC received every run, so the board did send the 1M advertisements.

I hit this while emulating a Ruuvi Air sensor.
The real Ruuvi Air sends its extended advertisement on 2M, and the Ruuvi iOS app sees it.

Is this an iOS rule?

The Bluetooth spec allows 1M, 2M or Coded for the secondary PHY.
1M is valid, and it is the most compatible choice.
Apple doesn't document this behavior.
Other developers report the same thing, starting with iOS 13:

Proposed change

Add a keyword argument, secondary_phy, to start_advertising().
It takes 1 or 2, and the default stays 1, so nothing changes for existing code.

  • Espressif and Nordic use it for extended advertisements.
  • Nordic also sends extended advertisements on 1M today, because the SoftDevice uses 1M when the field is unset. I expect iPhones to miss those too, but I have not tested a Nordic board.
  • Silabs, Zephyr and the generic HCI port only send legacy advertisements. A legacy advertisement has no secondary PHY, so these ports ignore the parameter.
  • The BLE workflow keeps 1M.

An alternative is to make 2M the default for extended advertisements.
I did not choose that, because 2M is optional in Bluetooth 5, so a scanner without 2M support would stop seeing the board.
2M also has a slightly shorter range.

I'll create a PR with the new parameter, if you're fine with the approach.

Activity

  1. self-assigned this
    on Dec 2, 2026
  2. added this to the 11.x.x milestone on Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions