Comments (3)
Thanks for the help. I managed to build it. Here is some note.
My server is running Ubuntu 20.04 LTS. So I created an VM with the same OS to build things.
My configuration command is
./configure --prefix= \
--with-user=nut --with-group=nut \
--with-modbus \
--sysconfdir=/etc/nut \
--includedir=/usr/include \
--with-dev \
--enable-static \
--with-statepath=/run/nut \
--with-altpidpath=/run/nut \
--with-drvpath=/lib/nut \
--with-pidpath=/run/nut \
--datadir=/usr/share/nut \
--with-pkgconfig-dir=/usr/lib/pkgconfig
This is partially adapted from @biergaizi 's and partially from rules
defined in the package source. Note that libmodbus-dev
need to be installed for configuration to succeed. After configuration, I just followed the build instructions from @biergaizi , and copy the binary to my server. I also installed libmodbus5
on the server.
The modbus driver provides way more information and controls than the usbhid-ups
I was using before. For example, I can now read the ups.load
and shutdown/power cycle each outlet groups independently, which are previously unavailable.
from nut.
Yes, it's possible. As a driver developer, I've used this method extensively for testing purpose.
In order to do that, the driver must be built using the same search paths as the system-wide NUT installation when running ./configure
, otherwise they would be unable to find each other's files. For example, on Debian, it would be:
./configure --with-modbus \
--with-user=nut --with-group=dialout \
--datadir=/usr/share/nut \
--sysconfdir=/etc/ups \
--with-statepath=/var/run/nut \
--with-pidpath=/var/run/nut \
--with-altpidpath=/var/run/nut \
--with-drvpath=/usr/sbin \
--with-systemdsystemunitdir=/usr/lib/systemd/system \
--with-pkgconfig-dir=/usr/lib/pkgconfig \
--with-udev-dir=/usr/lib/udev \
--libdir=/usr/lib/
All of these parameters must be set identical to the system-wide NUT package. Thus, it's often necessary to examine the source code of your distro package's build files to find the correct values. Don't use random values, it won't work and may mess your system up.
But if you're able to do that, all you need is to:
# compile include/ separately
cd include
make
cd ..
# compile common/ separately
cd common/
make
cd ..
# compile driver-name separately
cd drivers
make driver-name
Then, simply copy the driver to your system's path.
from nut.
For apc_modbus
in particular, if you plan to use USB connection, you would need a custom-built libmodbus and then configure NUT against that (see wiki).
For Serial and TCP links the stock version should do.
from nut.
Related Issues (20)
- Summary PowerWalker VFI 3000 CG PF1 HOT 10
- blazer_usb failing after apt-get upgrade HOT 4
- Support of linux hwmon (ina219) HOT 1
- Issues with Bookworm and NUT upscode2 > 2.7.4 HOT 9
- usbhid-ups: Eaton battery.voltage value is missing
- Invalid signature on nut-2.8.2 HOT 20
- CI: Add a test case for NUT with musl libc implementation (and non-fatally, a recent collectd source for good measure)
- CPS FAQ - quick discharge (from IRC)
- [HCL] APC Back-UPS RS 1200 aka APC Back-UPS Pro 1200VA/720W (NUT 2.8.2)
- blazer_usb:how display battery.runtime on NUT HOT 10
- Driver riello_ser have the same issue #1685 of riello_usb about battery capacity and runtime HOT 5
- Driver `main.c`: use Unix socket protocol to kill off "Duplicate other instance" HOT 2
- NUT systemd unit journals duplicate some lines
- UPS Visench C1K not support HOT 30
- Use `upsdebug_with_errno()` instead of a few cases calling `upsdebugx(..., errno, strerror())` explicitly
- Support for CyberPower Smart App online double conversion UPS HOT 2
- New device FSP FP650 HOT 2
- logging "nut_libusb_get_string: Success" every 12 seconds HOT 9
- strange data in logs, `file_report_buffer: expected 2 bytes, but got 512 ` HOT 2
- The dictionary in NUT sources also stores keywords for spell-checking nut-website
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nut.