I have a CyberPower SX650G which is connected via USB cable. After upgrading to nut-2.8.1_1 from nut-2.8.0_24, the USB connectivity appeared to stop working. It seems that there is a bug introduced in upstream cbfe3a8ccd72cd890a72bc2d81c293d849e5cb23 that introduced a requirement that bus number has to be non-zero, which doesn't make sense because the 0 is a valid bus number. I have submitted a patch to upstream at https://github.com/networkupstools/nut/pull/2198 to address this. The patch applies cleanly on nut 2.8.1 so please consider including it in the port too.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=8d2996f519277001777d07bd61c9cdab77a5c334 commit 8d2996f519277001777d07bd61c9cdab77a5c334 Author: Xin LI <delphij@FreeBSD.org> AuthorDate: 2023-11-24 15:52:06 +0000 Commit: Cy Schubert <cy@FreeBSD.org> CommitDate: 2023-11-24 16:03:39 +0000 sysutils/nut: Remove unnecessary validation for bus_num The libusb_get_bus_number() function serves as a simple accessor for the bus number of the opaque device struct. Unlike libusb_get_port_number(), it does not have the ability to convey errors back to the caller, and a bus number of 0 is a valid value. Therefore, any validation around bus_num is redundant. This commit removes the unnecessary validation code related to bus_num. Signed-off-by: Xin LI <delphij@FreeBSD.org> PR: 275293 Upstream commit: 4aeb199eb Upstream Pull Request: https://github.com/networkupstools/nut/pull/2198/ sysutils/nut/Makefile | 2 +- sysutils/nut/files/patch-drivers_libusb1.c (new) | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-)
Thanks. Incorporated your commit into the port and updated the nut-devel port to the latest upstream commit.