Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth Firmware MAC Address Issue #860

Closed
lsgunth opened this issue Aug 22, 2017 · 4 comments
Closed

Bluetooth Firmware MAC Address Issue #860

lsgunth opened this issue Aug 22, 2017 · 4 comments

Comments

@lsgunth
Copy link

lsgunth commented Aug 22, 2017

While upgrading from Jessie to Stretch, I found the latest Bluetooth firmware has a weird issue with the MAC Address it initializes the bluetooth adapter with.

With bluez-firmware version 1.2-3+rpi2, the mac address is set to 43:43:A1:12:1F:AC. This may be constant across hardware seeing I've found reference to it on the internet [1]. Besides that, this weird MAC address breaks bluetooth PAN because the bnep adapter gets rejected as a valid device when adding it to bridge. This is because the mac address is actually a multicast address (bit 1 is set in the first octet) and thus fails the 'is_valid_ether_addr' check in the kernel.

With bluez-firmware version 1.2-3+rpi1, the mac address is what it was originally (with a proper B8:27:EB: prefix). However, this version of the firmware doesn't seem to work correctly with the rest of the bluetooth stack in Stretch.

Thanks,

Logan

[1] https://www.raspberrypi.org/forums/viewtopic.php?t=148305&start=100

@asavah
Copy link

asavah commented Aug 22, 2017

I can confim this too.
And I have exactly the same BT MAC as you do

hciconfig -a
hci0:   Type: Primary  Bus: UART
        BD Address: 43:43:A1:12:1F:AC  ACL MTU: 1021:8  SCO MTU: 64:1
        UP RUNNING PSCAN
        RX bytes:822 acl:0 sco:0 events:57 errors:0
        TX bytes:3982 acl:0 sco:0 commands:57 errors:0
        Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
        Link policy: RSWITCH SNIFF
        Link mode: SLAVE ACCEPT
        Name: 'rpi3'
        Class: 0x1c0000
        Service Classes: Rendering, Capturing, Object Transfer
        Device Class: Miscellaneous,
        HCI Version: 4.1 (0x7)  Revision: 0x145
        LMP Version: 4.1 (0x7)  Subversion: 0x2209
        Manufacturer: Broadcom Corporation (15)

@pelwell
Copy link
Contributor

pelwell commented Aug 23, 2017

The new Bluetooth firmware seems to be ignoring the MAC address programmed into its OTP- the address you have now is a default for that chip (4343 A1 ...). Fortunately there is a way to set a MAC address using hciattach. Here is a modified version of the /usr/bin/btuart script that should set the MAC address correctly.

If you want to try it, download it to the home directory of user pi and:

sudo mv /usr/bin/btuart{,.orig}
sudo cp ~pi/btuart /usr/bin/btuart
sudo reboot

To return to the shipping version, which I recommend before updating the pi-bluetooth package, run:

sudo mv /usr/bin/btuart{.orig,}

@asavah
Copy link

asavah commented Aug 23, 2017

Thx, modified btuart indeed works as expected here, bt mac now is the good one.

@lsgunth
Copy link
Author

lsgunth commented Aug 23, 2017

Cool, thanks. This workaround solves my problems too.

@lsgunth lsgunth closed this as completed Aug 23, 2017
escalade pushed a commit to escalade/RetroELEC that referenced this issue Aug 31, 2017
See: raspberrypi/firmware#860 (comment)

Also, use sh instead of bash - one less unecessary bash dependency.
steals pushed a commit to steals/LibreELEC.tv that referenced this issue Feb 19, 2018
See: raspberrypi/firmware#860 (comment)

Also, use sh instead of bash - one less unecessary bash dependency.
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

No branches or pull requests

3 participants