Z-wave JS out of Memory

Hi,

I’m having an issue where my Z-wave has died after updating to the latest core and version of Z-wave JS. I have an Aeotec Gen 5+ Zwave usb stick attached to my RPI4b 8GB with a few sensors of various kinds around the house for an alarm. It was all working perfectly until a couple of days ago when I updated to Core-2021.11.5 and Zwave-JS 0.1.49. I’ve tried rolling back to Zwave-JS 0.1.37 but still not connecting.

The Zwave-JS addon is also using a heap of memory and CPU, currently 24% & 37% respectively. Tried uninstalling and re-installing several times. Tried switching to ZwaveJS2MQTT but can’t seem to fix it. Assume its something to do with the “JavaScript heap out of memory” error in the log but don’t know how to fix it.

Any help would be much appreciated.

From the log in Zwave-JS add-on I get the following.

2021-12-01T05:42:13.380Z DRIVER version 8.1.1
2021-12-01T05:42:13.381Z DRIVER
2021-12-01T05:42:13.382Z DRIVER starting driver…
2021-12-01T05:42:13.420Z DRIVER opening serial port /dev/ttyAMA0
2021-12-01T05:42:13.445Z DRIVER serial port opened
2021-12-01T05:42:13.448Z SERIAL » [NAK] (0x15)
<— Last few GCs —>
[245:0x7f8dc112a0] 948081 ms: Scavenge 2042.5 (2048.3) → 2041.0 (2048.6) MB, 4.8 / 0.0 ms (average mu = 0.232, current mu = 0.182) task
[245:0x7f8dc112a0] 948137 ms: Scavenge 2042.6 (2048.6) → 2041.1 (2048.6) MB, 4.9 / 0.0 ms (average mu = 0.232, current mu = 0.182) task
[245:0x7f8dc112a0] 948193 ms: Scavenge 2042.7 (2052.6) → 2041.2 (2052.6) MB, 5.1 / 0.0 ms (average mu = 0.232, current mu = 0.182) task
<— JS stacktrace —>
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
[13:58:05] INFO: Successfully send discovery information to Home Assistant.
2021-12-01T05:58:07.476Z DRIVER

Update: after reflashing a fresh install of HA on my RPi and getting the same result I figured I’d try connecting it to an unpowered USB hub and it works now.

No idea how a software update made it need a a hub. It was working perfectly fine without one previously.

To anyone else with an Aeotec Gen 5+ zwave usb stick who gets weird issues. Try a USB hub before anything else as it’s a quick and easy test.

Talk about frustrating!