ebaauw / homebridge-rpi

Homebridge plugin for Raspberry Pi.
Apache License 2.0
307 stars 18 forks source link

Error when no swap file configured #183

Closed berndhose closed 1 week ago

berndhose commented 1 week ago

Plugin reports error in homebridge log when swap file is configured in RPi

[7.9.2024, 16:55:12] [Homebridge_RPI] Homebridge: warning: heartbeat error: TypeError: Cannot read properties of null (reading '2') at Function.parseSwap (file:///var/lib/homebridge/node_modules/homebridge-rpi/lib/RpiInfo.js:166:22) at RpiInfo.getState (file:///var/lib/homebridge/node_modules/homebridge-rpi/lib/RpiInfo.js:52:21) at processTicksAndRejections (node:internal/process/task_queues:95:5) at RpiAccessory.heartbeat (file:///var/lib/homebridge/node_modules/homebridge-rpi/lib/RpiAccessory.js:159:19) at RpiAccessory. (file:///var/lib/homebridge/node_modules/homebridge-rpi/lib/RpiAccessory.js:107:11)

ebaauw commented 1 week ago

Is this on a local or on a remote Pi? Could you please list the output of swapon --info?

berndhose commented 1 week ago

Running local on Raspberry with Raspberry PI OS Debian 12. All swapping options disabled with swapoff --all, swap file deleted.

Output of swapon:

root@homebridge:~# swapon --summary root@homebridge:~# swapon --info swapon: Unbekannte Option »--info« Try 'swapon --help' for more information.

ebaauw commented 1 week ago

My bad. And plain swapon?

berndhose commented 1 week ago

root@homebridge:/# swapon --show=size,used --noheadings --bytes root@homebridge:/# swapon root@homebridge:/# swapon -V swapon from util-linux 2.38.1

ebaauw commented 1 week ago

Thanks. Should be fixed in v1.8.21.