getsenic / nuimo-linux-python

Nuimo Python SDK for Linux to connect and communicate with Nuimo controllers made by Senic
https://senic.com
MIT License
52 stars 20 forks source link

Bluetooth MAC is AA:AA:AA:AA:AA:AA after bluez upgrade #22

Closed jo-me closed 7 years ago

jo-me commented 7 years ago

Hi Lars, I've followed your guide to upgrade bluez from 5,23 to 5.43 closely but it is not working correctly for me.

I'm on a raspberry pi 3 with the integrated bluetooth module and started out with a clean install of raspbian lite (image from January 2017).

Initially, bluez 5,23 is already installed and the bluetoothctl command shows the controller itself and discovers the nuimo just fine. Then, I carried out the bluez upgrade steps and immediately after, everything is still ok. Nuimo can be disovered etc.

However, after a "sudo reboot", bluetooth is not working anymore. The MAC address of the bluetooth controller is set to AA:AA:AA:AA:AA:AA and also the discovery is not working.

pi@raspberrypi:~ $ sudo bluetoothctl
[NEW] Controller AA:AA:AA:AA:AA:AA raspberrypi [default]
pi@raspberrypi:~ $ sudo hciconfig -a
hci0:   Type: Primary  Bus: UART
        BD Address: AA:AA:AA:AA:AA:AA  ACL MTU: 1021:8  SCO MTU: 64:1
        UP RUNNING
        RX bytes:1496 acl:0 sco:0 events:160 errors:0
        TX bytes:2624 acl:0 sco:0 commands:142 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: 'raspberrypi'
        Class: 0x000000
        Service Classes: Unspecified
        Device Class: Miscellaneous,
        HCI Version: 4.1 (0x7)  Revision: 0x0
        LMP Version: 4.1 (0x7)  Subversion: 0x2209
        Manufacturer: Broadcom Corporation (15)

I've tried this procedure twice - once on the raspbian lite and once in a volumio installation which is my actual target system.

Any hints?

Jochen

larsblumberg commented 7 years ago

Hi Jochen,

If you follow the BlueZ upgrade steps closely, BlueZ should continue to work after a reboot. We use the the same steps on our Pi3 with Raspbian Lite.

Did you uninstall/purge BlueZ before upgrading? This can lead to your issue as uninstalling BlueZ also removes the Bluetooth driver. This said, keep the pre-installed Bluetooth packages and only run the installation steps in this readme.

Please also do a web search for "BlueZ AA:AA:AA:AA:AA" as this is a common failure symptom with BlueZ. However, as said, following the upgrade steps as per this readme should work.

larsblumberg commented 7 years ago

We don't run sudo apt-get install --no-install-recommends bluetooth as we always install BlueZ from sources. Maybe that made the difference.

larsblumberg commented 7 years ago

And try running again

sudo systemctl restart bluetooth
sudo hciconfig hci0 up
jo-me commented 7 years ago

Hi Lars, thanks for your quick reply on a Sunday ;-) I read those articles related to that MAC problem but they did not help. They indicate that the base firmware of the BT module is missing or something.. very strange. It was a completely fresh installation and copy&paste of your steps. No purge or other messing with the old bluetooth stuff. Since I had this phenomenon on two different systems (the clean raspbian lite and an older volumio with the older nuimo scripts running) I think that there is something wrong when used with the onboard bluetooth module.

However, during my fiddling I found that there is an even newer version of bluez that is just 2 days old. So, I started over and used that one and voila: everything works - both in raspbian lite and volumio. The new bluez apparently fixes something GATT-related so I'll just assume this was the cause ;-)

For reference, compared to the hciconfig snippet above, the output is exactly the same except for the MAC and the HCI version. It is now: HCI Version: 4.1 (0x7) Revision: 0xb6

Cheers, Jochen

larsblumberg commented 7 years ago

Happy to hear that it's working – but I'm not sure if using BlueZ 5.44 fixed the issue or if it was simply the circumstance that you set up a completely fresh installation. As said, we're running our development on a Raspberry Pi 3 here with a built-in Bluetooth adapter, too. And it had worked for us quiet good so far.