mKeRix / room-assistant

Presence tracking and more for automation on the room-level
https://www.room-assistant.io
MIT License
1.28k stars 122 forks source link

Not working on Pi Zero W 2 #958

Open madmic1314 opened 3 years ago

madmic1314 commented 3 years ago

Describe the bug Installing on Pi Zero W 2, fails at start up with an error

To reproduce Install on Pi Zero W 2

Relevant logs [Nest] 637 ERROR [ClusterService] Cannot file module '../build/Release/dns_sd_bindings' Require stack:

Also can see: warn: ConfigService: No configuration found in /home/pi/room-assistant/config/config

Even though local.yml exists in this folder. Have tired making a subfolder "config" in /home/pi/room-assistant/config with no joy.

RA doesn't create entities in HA, can't see connections to the mqtt broker.

Environment

Fresh flash, repeated twice to check

rust84 commented 3 years ago

I've got it running successfully on two Pi Zero W 2's. Suggest doing a fresh install and following the instructions for the Pi 3 as it uses the same CPU. I had problems with the Pi Zero instructions and in the end a clean install following the Pi 3 instructions worked. The warning you have there suggests you are not starting room-assistant from the room-assistant folder. That has caught me out as well. Good luck :)

bigstation17 commented 3 years ago

I followed Pi3 installation guide on Rpi Zero 2, and for me does not work. I get the following error.

`pi@RoomAssistant:~ $ sudo npm i --global --unsafe-perm room-assistant npm WARN deprecated har-validator@5.1.5: this library is no longer supported npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap. npm notice npm notice New patch version of npm available! 8.1.0 -> 8.1.2 npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.1.2 npm notice Run npm install -g npm@8.1.2 to update! npm notice npm ERR! code 2 npm ERR! path /usr/lib/node_modules/room-assistant npm ERR! command failed npm ERR! command sh -c github-sponsors npm ERR! sh: 1: github-sponsors: Exec format error

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2021-11-01T16_49_43_156Z-debug.log`

Also, i am not able to install it on orginal Rpi Zero W. I could get working only with Rpi3+.

JeroenTuinstra commented 3 years ago

Try what it says in the notice:

npm notice
npm notice New patch version of npm available! 8.1.0 -> 8.1.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.1.2
npm notice Run npm install -g npm@8.1.2 to update!
npm notice

sudo npm install -g npm@8.1.2

And then do sudo npm i --global --unsafe-perm room-assistant again.

Had similar errors when upgrading room assistant.

JeroenTuinstra commented 3 years ago

It might also be an incompatible bluez-firmware. First find out what version you have with: sudo apt list --installed | grep bluez-firmware

If it newer than 1.2-4 then downgrade to 1.2-4 firware with the following steps:

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
echo "bluez-firmware hold" | sudo dpkg --set-selections 

The last line is to prevent it from upgrading when you do sudo apt update && sudo apt upgrade You can also skip that line, but with the next upgrade you get the latest firmware again and you would have to repeat the process. Unless things have changed in raspbian or room-assistant.

Blink515 commented 3 years ago

I've had nothing but issues with my Pi Zero W 2s.

I started fresh with a clean install of Bullseye and room-assistant on each Pi. When room-assistant is running they drop off my network or become unresponsive to SSH. This also causes issues with other devices running on the same network. When I look at the channel utilization for my APs it shows near 90% which is bad.

One of the new Pi's has issues seeing BLE devices when room-assistant is running but if I scan using bluetoothctl it picks those devices up without any issues.

Prior to switching to the new Pi's I had things running very well with the original Zero W and room-assistant 2.1.1. Movement between rooms was picked up within 1 second but now it takes 5 minutes or just shows my device as unavailable.

I wiped everything on the new Pi's again and tried using version 2.1.1 but still no luck.

At this point I don't think it's room-assistants fault and more of an issue with the new hardware and software.

zackpollard commented 2 years ago

So I played around a bunch with this and I managed to get it working mostly on the raspberry pi zero W 2's. One main thing I had to do was disabled the instanceBeaconEnabled feature under the bluetoothLowEnergy integration bluetoothLowEnergy: instanceBeaconEnabled: false I do still notice at times instances where a specific raspberry pi struggles to see a device and so it flickers between rooms as one device that is further away sees the announcement but the closer one misses it. I'm not sure what I can do to resolve this last issue but going to keep tweaking the config. If there's anything that could be done within the code on room-assistants side to help with this problem that would be great, but i'm not hopeful.

EDIT: Another thing I had to do was use latest node-12 not node-16

lpfann commented 2 years ago

I've had nothing but issues with my Pi Zero W 2s.

I started fresh with a clean install of Bullseye and room-assistant on each Pi. When room-assistant is running they drop off my network or become unresponsive to SSH. This also causes issues with other devices running on the same network. When I look at the channel utilization for my APs it shows near 90% which is bad.

One of the new Pi's has issues seeing BLE devices when room-assistant is running but if I scan using bluetoothctl it picks those devices up without any issues.

Prior to switching to the new Pi's I had things running very well with the original Zero W and room-assistant 2.1.1. Movement between rooms was picked up within 1 second but now it takes 5 minutes or just shows my device as unavailable.

I wiped everything on the new Pi's again and tried using version 2.1.1 but still no luck.

At this point I don't think it's room-assistants fault and more of an issue with the new hardware and software.

I also had the issues with BLE utilizing 90% of the wifi band while active. BluetoothClassic is much better but not as accurate I think. Could you make it work with BLE without killing the 2.4 Band?

zackpollard commented 2 years ago

I've had nothing but issues with my Pi Zero W 2s.

I started fresh with a clean install of Bullseye and room-assistant on each Pi. When room-assistant is running they drop off my network or become unresponsive to SSH. This also causes issues with other devices running on the same network. When I look at the channel utilization for my APs it shows near 90% which is bad.

One of the new Pi's has issues seeing BLE devices when room-assistant is running but if I scan using bluetoothctl it picks those devices up without any issues.

Prior to switching to the new Pi's I had things running very well with the original Zero W and room-assistant 2.1.1. Movement between rooms was picked up within 1 second but now it takes 5 minutes or just shows my device as unavailable.

I wiped everything on the new Pi's again and tried using version 2.1.1 but still no luck.

At this point I don't think it's room-assistants fault and more of an issue with the new hardware and software.

I also had the issues with BLE utilizing 90% of the wifi band while active. BluetoothClassic is much better but not as accurate I think. Could you make it work with BLE without killing the 2.4 Band?

Yea I've had the same issue and it killed most of my IoT network so I had to disconnect the room assistant devices. Not sure what they are doing exactly but I had so many issues with devices dropping from the network while the room assistant pi zero 2 w's were connected. Hopefully something can be done to sort this as it seems impossible now to even get hold of the original pi zero w's.

fdellutri commented 2 years ago

Same issue for me. I needed to install avahi-utils and mdns-scan

apt install avahi-utils mdns-scan
npm install --verbose --unsafe-perm mdns
cd /usr/lib/node_modules/room-assistant/
npm rebuild --verbose --unsafe-perm
sdeveer commented 2 years ago

I've tried the suggestions multiple times, no Cigar... unfortunately. Hopefully a future update could resolve the issue.

Gotcha-1980 commented 2 years ago

I have also been unable to get this working on a rpi zero 2 w. I have tried the suggestions here but have been unsuccessful. I too will wait hopefully on a fix!

UPDATE: OK, so after a lot more playing around with this, I finally got it to work.

I followed the RPi3 instructions, but then instead of using the command provided: sudo npm i --global --unsafe-perm room-assistant

I used: sudo npm i --global --unsafe-perm --verbose --foreground-scripts room-assistant

After installation completed, it advised I needed to update the npm install, which I did. All now up and running as required.

Thank you the work done on this - it is very useful!

Substarbo commented 2 years ago

I have also been unable to get this working on a rpi zero 2 w. I have tried the suggestions here but have been unsuccessful. I too will wait hopefully on a fix!

UPDATE: OK, so after a lot more playing around with this, I finally got it to work.

I followed the RPi3 instructions, but then instead of using the command provided: sudo npm i --global --unsafe-perm room-assistant

I used: sudo npm i --global --unsafe-perm --verbose --foreground-scripts room-assistant

After installation completed, it advised I needed to update the npm install, which I did. All now up and running as required.

Thank you the work done on this - it is very useful!

Thanks so much. What is the command to update the npm install?

townsmcp commented 2 years ago

Not sure if this is useful to people, however with the latest release of RM I had so many problems. Devices dropping off randomly, RPI locking up etc. I installed the latest beta and have had no more issues since. In case anyone is interested, follow the RPI 3 install instructions however run the following to install RA:

sudo npm i --global --unsafe-perm --verbose --foreground-scripts room-assistant@3.0.0-beta.4

Substarbo commented 2 years ago

Not sure if this is useful to people, however with the latest release of RM I had so many problems. Devices dropping off randomly, RPI locking up etc. I installed the latest beta and have had no more issues since. In case anyone is interested, follow the RPI 3 install instructions however run the following to install RA:

sudo npm i --global --unsafe-perm --verbose --foreground-scripts room-assistant@3.0.0-beta.4

Has this been reliable for you? As it only worked for a few hours then stopped for me.

townsmcp commented 2 years ago

Not sure if this is useful to people, however with the latest release of RM I had so many problems. Devices dropping off randomly, RPI locking up etc. I installed the latest beta and have had no more issues since. In case anyone is interested, follow the RPI 3 install instructions however run the following to install RA: sudo npm i --global --unsafe-perm --verbose --foreground-scripts room-assistant@3.0.0-beta.4

Has this been reliable for you? As it only worked for a few hours then stopped for me.

Beta 4 was very stable for me. I’m currently on beta 5 and not so convinced at the moment. Keeps going to unavailable however since beta 4 I have made some pretty big changes - I now have 3 RPIs running, I’m running on the latest version of Node (17) so not 100% sure where the instability is coming from

Substarbo commented 2 years ago

I have had beta 4 running quite happily now

Not sure if this is useful to people, however with the latest release of RM I had so many problems. Devices dropping off randomly, RPI locking up etc. I installed the latest beta and have had no more issues since. In case anyone is interested, follow the RPI 3 install instructions however run the following to install RA: sudo npm i --global --unsafe-perm --verbose --foreground-scripts room-assistant@3.0.0-beta.4

Has this been reliable for you? As it only worked for a few hours then stopped for me.

Beta 4 was very stable for me. I’m currently on beta 5 and not so convinced at the moment. Keeps going to unavailable however since beta 4 I have made some pretty big changes - I now have 3 RPIs running, I’m running on the latest version of Node (17) so not 100% sure where the instability is coming from

I've had beta 4 running quite happily for a while now. I don't know why it didn't work before but really happy with it now. Going to add a few more now. Thanks for your help.

townsmcp commented 2 years ago

@Substarbo might be a good idea if you can share your config if your happy with your setup? Might help show some good tips and tricks that some of us are missing

steuerzentrale commented 2 years ago

I have also been unable to get this working on a rpi zero 2 w. I have tried the suggestions here but have been unsuccessful. I too will wait hopefully on a fix! UPDATE: OK, so after a lot more playing around with this, I finally got it to work. I followed the RPi3 instructions, but then instead of using the command provided: sudo npm i --global --unsafe-perm room-assistant I used: sudo npm i --global --unsafe-perm --verbose --foreground-scripts room-assistant After installation completed, it advised I needed to update the npm install, which I did. All now up and running as required. Thank you the work done on this - it is very useful!

Thanks so much. What is the command to update the npm install?

I would be interested in the command too. I can confirm that the following command sudo npm i --global --unsafe-perm --verbose --foreground-scripts room-assistant@3.0.0-beta.4 worked on a Raspi Zero W2. I used the instructions for the Pi 3 as supposed here.

Substarbo commented 2 years ago

Sorry for the late reply but all 3 of my Pi zero's become available after a short period. It did work for a few weeks once but now lucky if it lasts a day. I have pretty much given up. Anyone else had better luck?