Is it possible to switch PHY on USB-BT5.0+ adapter in LE Long Range?
pvvx opened this issue · 4 comments
ble_monitor: bt_helpers.py (0x0045: Packet([Parameter(name='selected_phys', width=4)])) -> API btmgmt_protocol.py (SetPHYConfiguration = 0x0045) -> Bluetooth Management API (Linux kernel)
http://www.bluez.org/
Bluetooth Management API
/doc/mgmt-api.txt
Set PHY Configuration Command
=============================
Command Code: 0x0045
Controller Index: <controller id>
Command Parameters: Selected_PHYs (4 Octet)
Return Parameters:
This command is used to set the default PHY to the controller.
This will be stored and used for all the subsequent scanning
and connection initiation.
The list of supported PHYs can be retrieved via the
Get PHY Configuration command. Selecting unsupported or
deselecting default PHYs will result in an Invalid Parameter
error.
This can be called at any point to change the Selected PHYs.
Refer Get PHY Configuration command for PHYs parameter.
This command generates a Command Complete event on success
or a Command Status event on failure.
Possible errors: Invalid Parameters
Invalid Index
Set advertising acceptance and operation in Bluetooth 5.0+ SIG (PHY 1M and Coded):
hcitool -i hciX cmd 08 31 03 05 05
Set advertising acceptance and operation in all PHYs: 1M/2M/Coded:
hcitool -i hciX cmd 08 31 03 07 07
log btmon:
@ RAW Open: hcitool (privileged) version 2.22
< HCI Command: LE Set Default PHY (0x08|0x0031) plen 3
All PHYs preference: 0x03
No TX PHY preference
No RX PHY preference
TX PHYs preference: 0x07
LE 1M
LE 2M
LE Coded
RX PHYs preference: 0x07
LE 1M
LE 2M
LE Coded
> HCI Event: Command Complete (0x0e) plen 4
LE Set Default PHY (0x08|0x0031) ncmd 2
Status: Success (0x00)
Show current PHY setting:
# btmgmt -i 1 phy
Supported phys: BR1M1SLOT BR1M3SLOT BR1M5SLOT EDR2M1SLOT EDR2M3SLOT EDR2M5SLOT EDR3M1SLOT EDR3M3SLOT EDR3M5SLOT LE1MTX LE1MRX LE2MTX LE2MRX LECODEDTX LECODEDRX
Configurable phys: BR1M3SLOT BR1M5SLOT EDR2M1SLOT EDR2M3SLOT EDR2M5SLOT EDR3M1SLOT EDR3M3SLOT EDR3M5SLOT LE2MTX LE2MRX LECODEDTX LECODEDRX
Selected phys: BR1M1SLOT BR1M3SLOT BR1M5SLOT EDR2M1SLOT EDR2M3SLOT EDR2M5SLOT EDR3M1SLOT EDR3M3SLOT EDR3M5SLOT LE1MTX LE1MRX
To the 'Selected phys' options, add the options 'LECODEDTX' and 'LECODEDRX':
# btmgmt -i 1 phy BR1M1SLOT BR1M3SLOT BR1M5SLOT EDR2M1SLOT EDR2M3SLOT EDR2M5SLOT EDR3M1SLOT EDR3M3SLOT EDR3M5SLOT LE1MTX LE1MRX LECODEDTX LECODEDRX
PHY Configuration successfully set
Hi,
I did the fix hcitool -i hciX cmd 08 31 03 07 07
and it worked to get 2 Mbps for my 5.1 dongle. But afterwards, the 4.2 dongle does not get recognized anymore. No matter what I am doing restarting bluetooth service, kernel modules or restart. It stays the same. Dmesg and lsusb show no errors the device is correctly recognized. And even if I switch back to 1 Mbps with hcitool -i hciX cmd 08 31 03 05 05
it still does not show a hci device. I've also checked that the dongle is working on other Ubuntu machines without calling the stated command.
Machine:
Ubuntu 22.04
bluez 5.64
Dongle 5.1: Edimax BT-8500
Dongle 4.2: Laird BT820
Edimax BT-8500
Bluetooth 5.0? May not support PHY Coded
#btmgmt -i 1 phy
?
log btmon
? (#hcitool -i hciX cmd 08 31 03 05 05)