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

Constant crashing after updating bluez/bluetooth packages Pi4 #870

Closed
iceman23e opened this issue Aug 10, 2021 · 20 comments
Closed

Constant crashing after updating bluez/bluetooth packages Pi4 #870

iceman23e opened this issue Aug 10, 2021 · 20 comments

Comments

@iceman23e
Copy link

Describe the bug
After updating bluez and bluetooth packages on my Pi4, room-assistant continually crashes. Most times it lasts only a couple seconds before crashing, but occasionally it will make it a couple minutes. It has been running rock solid for months with no issues before updating these packages. I've tried downgraded the four upgraded packages, but that doesn't seem to work. Also tried downgrading bluez-firmware.

To reproduce
Not sure, but update bluez and bluetooth packages.

Relevant logs

room-assistant[2004]: 8/10/2021, 6:52:09 PM - error - BluetoothService: Inquiring RSSI via BT Classic failed: Command failed: hcitool -i hci0 cc "xx" && hcitool -i hci0 rssi "xx"
room-assistant[2004]: Can't create connection: Operation not permitted
room-assistant[2004]: Get connection info failed: No such file or directory

Relevant configuration

global:
  instanceName: Living
  integrations:
    - homeAssistant
    - bluetoothClassic
    - gridEye
homeAssistant:
  mqttUrl: 'mqtt://192.168.1.142:1883'
  mqttOptions:
    username: xx
    password: xx
bluetoothClassic:
  minRssi: -25
  addresses:
    - 'xx'
    - 'xx'
gridEye:
  deltaThreshold: 3
  heatmap:
    enabled: true
cluster:
  weight: 20
  port: 6425
  peerAddresses:
    - 192.168.1.121:6425
    - 192.168.1.142:6425
    - 192.168.1.167:6425

Expected behavior
To not crash

Environment

  • room-assistant version: 2.18.4
  • installation type: NodeJS
  • hardware: Pi4
  • OS: Raspbian lite
@iceman23e iceman23e added the bug label Aug 10, 2021
@hellcry37
Copy link

up for this, same thing happens to me also, every time. i have a node that constantly crush after updates

@hawkseye76
Copy link

Any updates on this one? my entire instance (3 nodes) won't work because of this error.

Thanks

@sotatech
Copy link

Exact same problem here, 4 nodes down after doing an update. I may just bite the bullet and wipe everything and start from scratch over the weekend.

@Hukuma1
Copy link

Hukuma1 commented Aug 23, 2021

wget http://archive.raspberrypi.org/debian/pool/main/b/bluez-firmware/bluez-firmware_1.2-4+rpt2_all.deb
sudo dpkg -i bluez-firmware_1.2-4+rpt2_all.deb

Try to downgrade your bluez to this version and see if that works. Taken from the pinned issue: #661

@iceman23e
Copy link
Author

wget http://archive.raspberrypi.org/debian/pool/main/b/bluez-firmware/bluez-firmware_1.2-4+rpt2_all.deb
sudo dpkg -i bluez-firmware_1.2-4+rpt2_all.deb

Try to downgrade your bluez to this version and see if that works. Taken from the pinned issue: #661

Tried this already and it doesn't help with my instance.

@Hukuma1
Copy link

Hukuma1 commented Aug 23, 2021

What do you see if you do rfkill list? Also what output do you get with hciconfig?

Edit: And do you see your bluetooth MAC if you run hcitool dev?

Realized hcitool is deprecated. In case that's an issue, run bluetoothctl and then issue command of show. Has some information, e.g. maybe bluetooth isn't powered.

@iceman23e
Copy link
Author

rfkill list:

hci0: Bluetooth
	Soft blocked: no
	Hard blocked: no

hciconfig:

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:1478 acl:0 sco:0 events:88 errors:0
	TX bytes:2534 acl:0 sco:0 commands:88 errors:0

hcitool dev:

Devices:
	hci0	AA:AA:AA:AA:AA:AA

bluetoothctl shows it's powered

Looks like something is going on with the address?

@Hukuma1
Copy link

Hukuma1 commented Aug 25, 2021

Searched for that MAC address coming up and found this: https://raspberrypi.stackexchange.com/questions/69222/why-is-bluetooth-address-now-showing-up-as-aaaaaaaaaaaa

Seems to be the issue is always some sort of downgrade needed. heh

Try running sudo apt list --installed | grep bluez-firmware and check which version is installed?

@hawkseye76
Copy link

this is what i get:

bluez-firmware/now 1.2-4+rpt2 all [installed,upgradable to: 1.2-4+rpt8]

@Hukuma1
Copy link

Hukuma1 commented Aug 25, 2021

Are you having the same exact issue as the OP?

Also they have a v3 beta2 version of Room Assistant up if you're wanting to test that out: docker pull mkerix/room-assistant:3.0.0-beta.2

And are you guys running by any chance both bluetoothClassic and LowEnergy? If so, try taking out Classic out of the config file and see if that improves the stability. I'm still experiencing crashes myself. Got an RPi4 and a NAS both running it. Trying to figure out what the root of the cause is (different crash I believe).

@hawkseye76
Copy link

So, i did a reimage of the sd card and complete reinstall of room assistant on one of my nodes, and before doing an apt update, i put a hold on the bluez package, and everything seems to be working properly now. I plan on doing the other nodes later this evening to see if it gets everything back up and running.

@Hukuma1
Copy link

Hukuma1 commented Aug 25, 2021

You put a hold to not update the package, so what version is it on now? Above you wrote it was already on bluez-firmware/now 1.2-4+rpt2 all [installed,upgradable to: 1.2-4+rpt8]

Is it even lower now?

@hawkseye76
Copy link

hawkseye76 commented Aug 25, 2021

bluez-firmware/testing,now 1.2-4+rpt8 all [installed,automatic]
maybe the upgraded version of this fixed it? this is what came preinstalled from the rpi image i assume.

@iceman23e
Copy link
Author

sudo apt list --installed | grep bluez-firmware

now 1.2-4+rpt2 all [installed,upgradable to: 1.2-4+rpt8] because I downgraded.

I'm only running classic. I would guess it's not the bluez-firmware, since I've tried both versions with problems and reimaging and starting from scratch installs the latest version. It seems as though starting from scratch might be the only way to get everything working again for the time being.

@pshellguruwannabe what versions of bluetooth bluez libbluetooth-dev & libbluetooth3 are you running on your fresh install? I'm curious if you're running the same versions that were upgraded to and if so, why they work on a fresh install and not after updating.

@hawkseye76
Copy link

bluetooth/oldstable,now 5.50-1.2deb10u2 all [installed]
libbluetooth-dev/oldstable,now 5.50-1.2
deb10u2 armhf [installed]
libbluetooth3/oldstable,now 5.50-1.2~deb10u2 armhf [installed,automatic]
pi-bluetooth/testing,now 0.1.17 all [installed]

bluez-firmware/testing,now 1.2-4+rpt8 all [installed,automatic]
bluez/testing,now 5.50-1.2deb10u1+rpt2 armhf [installed,upgradable to: 5.50-1.2deb10u2]

libbluetooth-dev/oldstable,now 5.50-1.2~deb10u2 armhf [installed]

libbluetooth3/oldstable,now 5.50-1.2~deb10u2 armhf [installed,automatic]

@iceman23e
Copy link
Author

@pshellguruwannabe As suspected, all are the same as what I'm running on my instance that crashes constantly. Looks like a fresh install it is.

@Hukuma1
Copy link

Hukuma1 commented Aug 25, 2021

I'm so confused now. So there are multiple bluetooth driver packages in play that we have to cross-reference to pinpoint the issue(s)? D:

@MariusGGS
Copy link

MariusGGS commented Aug 26, 2021

For people still struggling with the bluez version, this should work for both RPI4 and RPI400:

sudo apt install bluez=5.50-1.2~deb10u1+rpt2

If you're trying to change the bluez of a docker it won't be that command I guess, but that's a version that will 100% work

@iceman23e
Copy link
Author

For people still struggling with the bluez version, this should work for both RPI4 and RPI400:

sudo apt install bluez=5.50-1.2~deb10u1+rpt2

If you're trying to change the bluez of a docker it won't be that command I guess, but that's a version that will 100% work

Already tried downgrading this alone and also with the other three, does not work on my instance.

@github-actions
Copy link

There hasn't been any activity on this issue recently. In an effort to provide a better overview of current issues we automatically clean some of the old ones. Many of them may already be resolved in newer versions of room-assistant.
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants