ebaauw / homebridge-rpi

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

Warning flooding log #143

Closed fab7282 closed 1 year ago

fab7282 commented 1 year ago

Dear all,

today I updated my system and ... ... now I get this warning every 10 seconds. [homebridge-rpi] This plugin generated a warning from the characteristic 'Load': characteristic was supplied illegal value: number Infinity exceeded maximum of 1.7976931348623157e+308. See https://homebridge.io/w/JtMGR for more info.

I checked if the getstate script or anything else has changed. I installed version 1.4.0 from plugin. Has anyone any clues how what is wrong? thank you for your efforts.

ebaauw commented 1 year ago

Could you please list the output of rpi -Hipaddess-D info?

Did you re-install Homebridge? Could also you please list the output of npm -g list homebridge and of npm -g list hap-nodejs?

fab7282 commented 1 year ago

Hi, yes of course: rpi -H localhost -D inforpi info: read file /etc/os-release rpi info: read file /proc/cpuinfo rpi info: read file /sys/class/leds/led1/brightness rpi info: exec vcgencmd measure_temp rpi info: exec vcgencmd measure_clock arm rpi info: exec vcgencmd measure_volts rpi info: exec vcgencmd get_throttled { "gpioMask": "0x0FFFFFFC", "gpioMaskSerial": "0x0000C000", "id": "0000000011C620B4", "isRpi": true, "manufacturer": "Sony UK", "memory": "1GB", "model": "3B+", "modelRevision": "1.3", "prettyName": "Raspberry Pi 3B+ 1.3 (1GB)", "powerLed": true, "processor": "BCM2837", "revision": "A020D3", "usbPower": true, "state": { "date": "2022-09-18T18:21:16.000Z", "boot": "2022-09-18T14:51:36.810Z", "powerLed": 255, "load": 0.09, "temp": 49.4, "freq": 1400146000, "volt": 1.3188, "throttled": "0x00000000" } }

npm -g list homebridge /usr/local/lib └── homebridge@1.5.0

npm -g list hap-nodejs /usr/local/lib ├─┬ homebridge-xiaomi-roborock-vacuum@0.26.5 │ └── hap-nodejs@0.10.2 └─┬ homebridge@1.5.0 └── hap-nodejs@0.10.3

I hope this helps…

Best regards

fab

ebaauw commented 1 year ago

The output of rpi info looks good. Are you only exposing the local Pi (on which Homebridge runs)?

What does the Homebridge RPi log message setting Load list as the new value?

Hm, the Xiaomi plugin has listed HAP-NodeJS as dependencies. It shouldn’t, but I don’t think that’s related to this issue.

By re-installing Homebridge, it picked up hap-nodejs@0.10.3, which was released 5 days ago, and includes a change in validation, see https://github.com/homebridge/HAP-NodeJS/releases/tag/v0.10.3. Maybe that’s causing an issue; could you install 0.10.2 manually to check that? From the command line, go to /usr/local/lib/node_modules/homebridge and issue sudo npm i hap-nodejs@0.10.2. Double-check with npm -g list hap-nodejs that the old version was installed.

ebaauw commented 1 year ago

Ok, re-installed Homebridge on my test system, causing it to upgrade to hap-nodejs@0.10.3 and now seeing the same error. After revering to hap-nodejs@0.10.2, the warnings are gone again.

ebaauw commented 1 year ago

Changes in v1.4.1 will stop the warning from happening, defining minValue and maxValue properties. Still don't understand what's causing the warning, though.

OrigamiDream commented 1 year ago

@ebaauw In 0.10.2 HAP-NodeJS, the rounding algorithm couldn't handle recurring decimals and always assume the minimum value as integer which have no decimal points. However, new 0.10.3 algorithm provides recurring decimal supports, now the minValue is exact -Float.MAX_VALUE which have many decimal points. This is why your previous implementation had problem on newer version.