zigbee2mqtt.io icon indicating copy to clipboard operation
zigbee2mqtt.io copied to clipboard

RPi Zero Update guide

Open templehasfallen opened this issue 1 year ago • 5 comments

Created a guide detailing a workaround for updating Zigbee2MQTT out-of-place when using a RPi Zero, 2, W using chroot and qemu. This is in the likely case of users running into OOM issues on their Pi.

templehasfallen avatar Aug 01 '24 11:08 templehasfallen

I'm wondering if pnpm will fix this, can you try:

npm install -g pnpm
pnpm install

Koenkk avatar Aug 01 '24 18:08 Koenkk

I'm wondering if pnpm will fix this, can you try:

npm install -g pnpm
pnpm install

Sadly this also errors out due to OOM related errors.

 WARN  GET https://registry.npmjs.org/is-stream error (EAI_AGAIN). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/async error (EAI_AGAIN). Will retry in 10 seconds. 2 retries left.
Progress: resolved 520, reused 0, downloaded 484, added 0

<--- Last few GCs --->

[2901:0x47058a0]   198301 ms: Mark-Compact (reduce) 124.2 (129.2) -> 122.7 (128.6) MB, 317.22 / 0.00 ms  (average mu = 0.222, current mu = 0.162) allocation failure; scavenge might not succeed
[2901:0x47058a0]   199194 ms: Mark-Compact (reduce) 123.6 (128.9) -> 123.2 (128.4) MB, 745.23 / 0.17 ms  (average mu = 0.189, current mu = 0.166) allocation failure; scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

Aborted

I also tried setting export NODE_OPTIONS="--max-old-space-size=256" or 512, in which case it completed, but the service just kept starting/restarting without any specific errors.

templehasfallen avatar Aug 02 '24 14:08 templehasfallen

What if you configure the Pi to have a swap file? https://forums.raspberrypi.com/viewtopic.php?t=369538

Koenkk avatar Aug 03 '24 10:08 Koenkk

What if you configure the Pi to have a swap file? https://forums.raspberrypi.com/viewtopic.php?t=369538

I went to do that but apparently already did that a while ago (I have 2G swap). This may also explain why my npm ci didn't directly fail and was still running after ~12 hours without any change.

templehasfallen avatar Aug 03 '24 20:08 templehasfallen

I wonder if it would be easier to grab to dependencies from the Docker image. Since this is quite complicated and needs to be done after every update of z2m.

Koenkk avatar Aug 04 '24 19:08 Koenkk

This pull request is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days

github-actions[bot] avatar Dec 11 '24 01:12 github-actions[bot]