getstate error for remote devices
Closed this issue · 6 comments
[9/4/2024, 1:43:46 PM] [RPi] rpi4b2g: warning: heartbeat error: invalid state: Bad control character in string literal in JSON at position 235
[9/4/2024, 1:43:46 PM] [RPi] rpi3b: warning: heartbeat error: invalid state: Bad control character in string literal in JSON at position 234
I am getting these errors all the time from local hombridge on another rpi which does not throws the error for itself and works fine. I rebooted service and device and still getting these every 15 seconds on hearbeart check intervals. Just change the get state script to the latest one as you suggested in the latest update of the plugin.
remote test:
rpi -H REMOTEIP info
rpi info: error: invalid state: Bad control character in string literal in JSON at position 234
local is fine.
Edit: removed this line from script
"swap": "$(swapon --show=size,used --noheadings --bytes)",
it is working for remote devices now but getting the warning of "old getstate is used in the plugin"
homebridge latest stable
nide.js 20 latest stable
plugin latest stable
What version of Raspberry Pi OS do you have?
What's the output of the command swapon --show=size,used --noheadings --bytes
when executed on the Pi?
What version of Raspberry Pi OS do you have?
What's the output of the command
swapon --show=size,used --noheadings --bytes
when executed on the Pi?
swapon --show=size,used --noheadings --bytes
1073737728 0
1149235200 11534336
Raspbian GNU/Linux 12 (bookworm) (6.1.21-v7+).
Hm, do you have multiple swap files configured? What's the output of swapon --show
?
it is working for remote devices now but getting the warning of "old getstate is used in the plugin"
Just change the line to "swap": 0,
to suppress the warning.
swapon --show
NAME TYPE SIZE USED PRIO
/var/swap file 1024M 0B -2
/dev/zram0 partition 1.1G 18M 5
you might getting to the point :) I have ZRAM set up on those two remote devices but not on the local being 8g ram not needed there. Could this be the reason?
Yes, the script doesn't take into account that (apparently) there can be multiple swap files. This is probably an edge case.
Can you disable /var/swap
, using only the ZRAM partition? Otherwise, change the script line to only return the last line (assuming /dev/zram0
is listed last on all Pi-s):
"swap": "$(swapon --show=size,used --bytes | tail -1)",
Yes, the script doesn't take into account that (apparently) there can be multiple swap files. This is probably an edge case.
Can you disable
/var/swap
, using only the ZRAM partition? Otherwise, change the script line to only return the last line (assuming/dev/zram0
is listed last on all Pi-s):"swap": "$(swapon --show=size,used --bytes | tail -1)",
"swap": "$(swapon --show=size,used --bytes | tail -1)",
used this and it is working as it should. Thanks