When I run the command: btmgmt phy LE2MTX LE2MRX
It returns:
Could not set PHY Configuration with status 0x0d (Invalid Parameters)
btmon shows:
@ MGMT Open: btmgmt
@ MGMT Command: Set PHY Configuration (0x0045) plen 4
Selected PHYs: 0x1800
LE 2M TX
LE 2M RX
@ MGMT Event: Command Status (0x0002) plen 3
Set PHY Configuration (0x0045)
Status: Invalid Parameters (0x0d)
@ MGMT Close: btmgmt
I'm very unfamiliar with btmgmt, how do I specify that I want LE 2M PHY whenever possible?
If I run: btmgmt phy
I get the available PHYs which incudes the LE2MTX and LE2MRX (which I am after).
Supported phys: BR1M1SLOT BR1M3SLOT BR1M5SLOT EDR2M1SLOT EDR2M3SLOT EDR2M5SLOT EDR3M1SLOT EDR3M3SLOT EDR3M5SLOT LE1MTX LE1MRX LE2MTX LE2MRX
Configurable phys: BR1M3SLOT BR1M5SLOT EDR2M1SLOT EDR2M3SLOT EDR2M5SLOT EDR3M1SLOT EDR3M3SLOT EDR3M5SLOT LE2MTX LE2MRX
Selected phys: BR1M1SLOT BR1M3SLOT BR1M5SLOT EDR2M1SLOT EDR2M3SLOT EDR2M5SLOT EDR3M1SLOT EDR3M3SLOT EDR3M5SLOT LE2MTX LE2MRX
These can also be seen in btmon:
Get PHY Configuration (0x0044) plen 12
Status: Success (0x00)
Supported PHYs: 0x1fff
BR 1M 1SLOT
BR 1M 3SLOT
BR 1M 5SLOT
EDR 2M 1SLOT
EDR 2M 3SLOT
EDR 2M 5SLOT
EDR 3M 1SLOT
EDR 3M 3SLOT
EDR 3M 5SLOT
LE 1M TX
LE 1M RX
LE 2M TX
LE 2M RX
Configurable PHYs: 0x19fe
BR 1M 3SLOT
BR 1M 5SLOT
EDR 2M 1SLOT
EDR 2M 3SLOT
EDR 2M 5SLOT
EDR 3M 1SLOT
EDR 3M 3SLOT
EDR 3M 5SLOT
LE 2M TX
LE 2M RX
Selected PHYs: 0x19ff
BR 1M 1SLOT
BR 1M 3SLOT
BR 1M 5SLOT
EDR 2M 1SLOT
EDR 2M 3SLOT
EDR 2M 5SLOT
EDR 3M 1SLOT
EDR 3M 3SLOT
EDR 3M 5SLOT
LE 2M TX
LE 2M RX
You cannot disable PHYs which are not configurable. You have to include at least
BR1M1SLOT,LE1MTXandLE1MRXin the list of PHYs. So, calling the following should work:The list of configurable PHYs is hard-coded within the Linux kernel (as in 5.15.141):
Please note that
btmgmt phycauses setting the default PHY (Bluetooth Core v5.3, section 7.8.48 – LE Set Default PHY command). This is the list of preferred PHYs which is used for new connections. As it is not possible to only specify the BLE 2M PHYs here, I cannot tell whether the command above increases the chance that actually the BLE 2M PHYs will be used.The Bluetooth Core v5.3 specification has another chapter (7.8.49 – LE Set PHY command) to set the PHY(s) of an active connection. But this HCI command is not implemented in
btmgmtnor in the Linux kernel. A patch series which calls the LE Set PHY command for the underlying LE connection of a socket (viasetsockopt) has been rejected.As a last resort, you could try to force the PHY via
hcitool:This sets the default PHY for new LE connections to BLE 2M (without BLE 1M). But I haven't tested whether this finally gives the desired result.