apcupsd widget error with 23.1 installed
-
I get the same error message here after the upgrade, apcupsd itself works though and I am able to connect to it from my NetworkUPSTools install.
I really like the widget though so I hope it gets bugfixed :)
It worked fine on 22.05
-
https://redmine.pfsense.org/issues/13970
Do you see it if you select °F for temperature?
Are you both running amd64 platforms?
Steve
-
@stephenw10 Upgrade from most recent 22 release to 23.1 on a Netgate 6100.
apcupsd was working fine previously. I tried uninstalling rand reinstalling it (with a reboot in between) and got the same result. -
@stephenw10 Same result regardless of C or F
-
I am running a Netgate 2100, ARM Cortex-A53 r0p4
-
I had the same issue, except on line 208. As a temp fix until the package gets updated, I just edited apcupsd.widget.php, and on line 208 change:
((ceil(substr(($degc)
to:
((ceil(substr(((int) $degc)
My widget started working fine after that.
I would assume the same modification could be made on line 206 as well, as its the same function. YMMV
-
@netskillz That did the trick. I changed it in both 206 and 208 just to be safe. Thanks!
-
@dstacey147 Interesting, I do not have an error on the dashboard widget. 2100, new install of 22.05, restored config (from 22.05 which had apcupsd installed), upgraded to 23.01, installed apcupsd (because it wasn't installed).
-
@steveits Both lines (206 and 208) are part of a rather large set of nested conditional statements, my guess is you simply don't have the conditions present that trigger either of the two lines. I was triggering line 206, @netskillz, who came up with the solution, was triggering line 208, you're triggering neither.
-
@netskillz Thank you!!
Upgraded from 22.05 and also had this problem on line 208.
Your solution worked a treat. -
just curious in the included screen capture of the settings,
Don't you actually have to have numeric values that can be parsed?
Mine looks more like this and I have not seen this both in 22.05 and 23.01 I have not experiences this error. (the package was updated as part of the 23.01 as well and is currently at 0.3.92 (although as I just went to look this version up I see there is another update which will bring it to 0.3.92_1, and which I just installed no issues) -
@jrey Yes, the fields had numbers in them before the 23.01 upgrade but I think the script error garbled all the values
Anyway, after updating the apcupsd package to 0.3.92_1 the widget has started working again here. It looks like it was published a couple hours ago!
-
okay - I did not experience any of that moved from 22.05 to 23.01 with no issue at all. Thanks
-
I am guessing it only happened for certain UPS models and connection types, my old SmartUPS 1000 is using modbus protocol over serial (with a usb rs232 dongle)
Most people are probably using a direct USB connection with the usbhid driver but I never got that to work reliably with my UPS, it would stop responding to polling from apcupsd after a couple days or weeks. Maybe the temperature parsing acts differently depending on the UPS type and connection method, or maybe some UPSes don't report a temperature at all.