Skip to content

APC UPS with Modbus protocol

Jim Klimov edited this page Dec 10, 2023 · 11 revisions

Since about 2010, many APC devices have largely deprecated the use of standard USB HID protocol in favor of a ModBus based one, which they can use over other media (Serial, TCP/IP) as well. Lack of support for the new protocol in NUT was a sore point for years, see https://github.com/networkupstools/nut/issue/139 and generally the labelled issues and PRs via https://github.com/networkupstools/nut/issues?q=label%3AAPC+label%3Amodbus query.

But as of https://github.com/networkupstools/nut/pull/2063 with initial read-only handling support (and some linked issues and PRs before and after it) such support did appear in NUT release v2.8.1 and is still expanding (e.g. for commands and writable variables with https://github.com/networkupstools/nut/pull/2184 slated for NUT v2.8.2 or later).

One caveat here is that the work with modbus from NUT relies on libmodbus, and the upstream project currently lacks the USB layer support. The author of PR #2063 linked above did implement it in https://github.com/EchterAgo/libmodbus/commits/rtu_usb (PR pending) with instructions to build the custom libmodbus and then build NUT against it detailed in the PR #2063.

Without that change ("out of the box") APC devices using the protocol over Serial and TCP/IP links should "just work" with the new apc_modbus NUT driver.

Clone this wiki locally