This document intends to detail the change log for relatively recent work (roughly since the source code was tracked in Git).
strncpy
does not necessarily zero terminate the buffer so we
replace it with snprintf
and add error checking. This also fixes
an off-by-one in the snprintf
error checking of the
_apc_modbus_double_to_nut
and _apc_modbus_power_to_nut
functions and adds error checking to every snprintf
call.
SIZEOF_ARRAY
macro
and use where applicable This adds a new SIZEOF_ARRAY
to
common.h
and changes some code to use it.
apc_modbus
to support the APC
Modbus protocol over serial ports, TCP connections and USB ports.
For USB support to work it needs a [patched libmodbus
that has
support for the APC USB Modbus
encapsulation](https://github.com/EchterAgo/libmodbus/commits/rtu_usb).
If a libmodbus
without USB support is detected the driver will
build with just the serial and TCP/IP support.
$vendor
we can have duplicate entries.
upsid
setting [#2075]
Makefile.am
but it does not
do so relative to "$srcdir" so trying to do a configure outside of
the source directory will fail.
man nut.conf
for more info
conf/upsmon.conf.sample.in, docs/man/upsmon.conf.txt, docs/man/upsmon.txt, docs/nut.dict: upsmon(.conf) docs and samples
(top_)srcdir
and (top_)builddir
attributes, so
empty values are non-toxic
snmp_info_t
got updated to conform with pre 5d97d07 instant commands layout,
but got merged after it. Reverting 8bcf255 so that command values
are correctly in su_info_t->dfl
.
LISTEN *
handling to not fiddle with
optionality of require_IPV6_V6ONLY
for one use-case [#2013
review, #2012]
driver.state
#1767, driver reload command #1903, driver
inter-instance communications via socket #1922 and others. Also
convert remaining single-digit X.Y versions to X.<Y\+1>0
double-digits.
secLevel
is required to use non-trivial authentication [#734]
docs/new-drivers.txt
by name for
device status data definitions
docs/download.txt: update references to NUT client for VMWare ESXi
docs/download.txt: update references to NUT client for VMWare ESXi
upsd
would accept them and upscmd
can request them [#1903]
ups.conf
reloading in NUT
drivers [#1903]
(s)size_t
variables
upsdrvctl shutdown
. This
results in using that delay, instead of 1s. - Change shutdown delay
to 20s from 10s, because that seems more common, and 10s feels too
tight. - Add logging about shutdown. When run with -k
,
ups.delay.shutdown
has apparently not been initialized. Fall
back to 20, rather than 1, and log better.
allow_duplicates
flag for common
USB matching options [#1756]
./ci_build.sh inplace
operation
shortcut [#1714]
configure --enable-inplace-runtime
[#1714]
--enable-inplace-runtime
[#1714]
ifdef
HAVE_USB_H
(libusb-0.1 header)
ifdef
HAVE_USB_H
(libusb-0.1 header)
-x generic
suggestion apparently
became -x explore
later in this timeline (also -d1
to dump and
exit after one data collection loop, without requiring a valid
NUT_STATEPATH
).
PyNUTError("Always a string")
to file-heading changelog
cppnit
et al
time
! No time
: it outputs /\^sys/
- fatal
for powershell (or appveyor?) console scanner
common/common.c: get_libname(): prefer LD_LIBRARY_PATH first [#805]
make distcheck
should test installability of
NUT-Monitor and PyNUT (even if as a co-bundle)
make install
for
NUT-Monitor and/or PyNUT [#1462]
upsc ...
" to
runcmd()
waitbeforereconnect
keyword
clients/upsmon.c: Makes the call to "wall" function non blocking,
make check
at once on same host, they now have a
decent chance to not collide (not guaranteed though)
$(<F)
is not POSIX compliant, while $(@F)
is, go figure [#1362 follow-up]
--enable-maintainer-mode
test_nutclient.py
requires an
upsd
running
echo -n
with a more portable printf
extern pDesc
is defined in libhid.h which does not
seem to be used in/along-with hidparser.{c,h} currently - but this
collision may happen later (especially with code-copying around).
./ci_build.sh spellcheck
to be more useful
make
maintainer-clean
also removes .dirstamp files
expr
- if the maths result was "0"
expr
strcmp(mib,
"auto")
many times
char
su_scratch_buf[255]
(original static array moved to another file
in master branch), and bump DRIVER_VERSION
su_scratch_buf
instead of a local char[6]
buffer.
configure
example a bit friendlier for copy-pasting.
ulimit -n
(minus known overhead)
tools/nut-ddl-dump.sh
in the same manner (issue #1111)
make spellcheck
from top dir should be quieter
(fallout from touchfiles)
systemctl restart lxc-net
after edits of /etc/lxc/dnsmasq-hosts.conf
fightwarn.*89.*
regex branch name; do
not pollute logs and analysis of "usual fightwarn" builds
[D#]
prefix impact
experimental.*
namespace
disable_weak_ssl
(currently not getting in our way, but can
change later)
phoenixtec_command()
memchr()
later in
all cases.
//
comments same way as /*...
drivers/main.c: main.c: write upsdrv_initinfo/updateinfo() logs to syslog When a NUT driver is started (via upsdrvctl start), it runs the following sequence: 1. Run as a foreground process. 2. Do some basic initialization, log to stderr. 3. If not debugging: - fork()
pkg install libgd
explicitly (needs
sudo)
make
check
with the current test case
state_delinfo()
not deleting immutable variables, comment
this near the function and log for runtime hits to help
troubleshooting.
poll_interval
in
apcupsd-ups
This commit removes the hardcoded poll-interval of
60 seconds and instead only makes sure that the user-defined
interval is greater than a minimum-interval.
dstate_delinfo()
for LB-condition variables This commit fixes
the ignorelb
flag for the apcupsd-ups
driver. Previusly
"battery.charge" and "battery.runtime" was cleared before invoking
status_commit()
which caused the LB-condition to always be
false
.
ST_FLAG_IMMUTABLE
in dstate_delinfo()
output.current
LOAD_VA ⇒ ups.power
NOMAPNT ⇒
ups.power.nominal
Closes:
https://github.com/networkupstools/nut/pull/753
im
, which is passed to
autonomy_calc(), can be equal to 4, blindly incrementing it by one,
when it’s 4, leads to an index out of bounds.
Basic homebrew UUID v4 implementation * Prefer to use static
buffer for UUID * log actual result of instcmd / setvar * Fix
tracking ID reporting due to static memory changes * upsclient:
use unsigned int for timeouts Also, explicit that upscli_cleanup()
takes no argument. * upscmd/upsrw: use unsigned int for timeout \+
our str_to_uint() for it Also, slightly reword the help message
for -t
(timeout) option, in order to clarify which is the unit
(seconds) used for the provided value. * upscmd/upsrw: don’t sleep
after receiving a non-PENDING CMDSET_STATUS Also, remove some
nesting in do_cmd() and do_set(). * net-protocol: clarify the
format of GET CMDSET_STATUS \+ <status_id> <status_id> is not
optional to get the status of a command/setvar with CMDSET_STATUS,
so drop the [square brackets] from it. Also drop "quotes" in SET
CMDSET_STATUS’s <value>, since it’s expected to be a single word.
Plus, fix markup of INSTMCD’s <cmdparam> parameter. *
sock-protocol: align case and markup of command parameters *
dstate: fix handling of INSTCMD’s optional parameters We should
still support the old INSTCMD <cmdname> [<cmdparam>]
format, and
not only consider <cmdparam> when also STATUS_ID <id>
is
provided. Also, fix the format of our sock-protocol commands
mentioned in comments, and add function names to debug info. *
common: document the recently added things * upsd: in INSTCMD/SET
handlers, also accept NULL for status_id Plus: - use a simpler
approach to test if status_id is not empty, - align the way the SET
command is built to the one used for the INSTCMD command. * upsd:
drop unnecessary/unused global * upsd: move sanity checks of
cmdset_status_get() after declaration of vars Also, drop some
nesting in that function. * Move from CMDSET_STATUS / STATUS_ID to
TRACKING This is just a big, big rename, no code changes. * upsd:
refine the tracking API Add a couple of functions to change in a
predictable way the value of the general enablement of tracking and
make it visible only inside upsd.c. Also, move the tracking type
(tracking_t) and the list of items inside upsd.c. * net-protocol:
also return TRACKING between OK and <id>, for INSTCMD/SET VAR *
dstate: really fix handling of INSTCMD’s optional parameters
Erroring out on INSTCMD <cmdname>
doesn’t seem like a good
idea… * common: massage default timeouts Rename the default
timeout used in network operations by upsclient and nut-scanner to
be more specific: from DEFAULT_TIMEOUT to DEFAULT_NETWORK_TIMEOUT.
Plus, make the default timeout used when retrieving the result of
an INSTCMD/SET VAR with TRACKING enabled a common #define’d value
(DEFAULT_TRACKING_TIMEOUT), and use it also to publish the default
value of the -t option in the help messages of upscmd and upsrw.
As suggested by Charles Lepple. * upsd: ignore case of UUID4 in
tracking API Also, remove some nesting in tracking_del(). *
libupsclient: generate manpages for
upscli_{read,send}line_timeout() To keep things simple, at least
for now, only generate manpages and not html pages (and, as such,
don’t even think of using our linkman AsciiDoc macro with those
functions, to avoid dead links). * libupsclient: bump version as
per recent changes - addition of upscli_{read,send}line_timeout(),
DELRANGE <varname> <minvalue> <maxvalue>
, not
DELRANGE <varname> "<minvalue> <maxvalue>"
, as used in
dstate_delrange(). So, fix that unused (well, at least in NUT)
function to use the correct format. Also, remove an extraneous
additional space in the command used in dstate_addrange().
[
and ]
- no need for "
.
pollfreq
and USB interrupts Closes:
https://github.com/networkupstools/nut/issues/476
--with-usb
to choose the library
configure
appropriate
values for --with-usb-includes
and --with-usb-libs
(i.e. libusb
0.1/libusb-compat-only settings).
driver.version.usb
variable Reference:
https://github.com/networkupstools/nut/issues/300
libusb_set_interface_alt_setting (0,
{empty}0)
(equivalent to libusb_set_altinterface(0)
in libusb 0.1), as
was done in NUT 2.7.2 and earlier. However, the libusb 1.0
implementation was still missing the related code Reference:
https://github.com/networkupstools/nut/issues/300
docs/man/Makefile.am: Some systems detect man-pages as "ASCII text"
driver.version.usb
variable Reference:
https://github.com/networkupstools/nut/issues/300
libusb_set_interface_alt_setting (0,
{empty}0)
(equivalent to libusb_set_altinterface(0)
in libusb 0.1), as
was done in NUT 2.7.2 and earlier. However, the libusb 1.0
implementation was still missing the related code Reference:
https://github.com/networkupstools/nut/issues/300
driver.version.usb
variable Reference:
https://github.com/networkupstools/nut/issues/300
libusb_set_interface_alt_setting (0,
{empty}0)
(equivalent to libusb_set_altinterface(0)
in libusb 0.1), as
was done in NUT 2.7.2 and earlier. However, the libusb 1.0
implementation was still missing the related code Reference:
https://github.com/networkupstools/nut/issues/300
ASCIIDOC_VERBOSE=-v make distcheck-light
to pass. So let’s keep
it complaining but working.
--with-lib
references Credit: Paul Vermeer
docs/man/nutdrv_qx.txt, drivers/nutdrv_qx_bestups.c, drivers/nutdrv_qx_blazer-common.c, drivers/nutdrv_qx_blazer-common.h, drivers/nutdrv_qx_mecer.c, drivers/nutdrv_qx_megatec-old.c, drivers/nutdrv_qx_megatec.c, drivers/nutdrv_qx_mustek.c, drivers/nutdrv_qx_q1.c, drivers/nutdrv_qx_voltronic-qs-hex.c, drivers/nutdrv_qx_voltronic-qs.c, drivers/nutdrv_qx_zinto.c: nutdrv_qx: add ignoresab flag to support bogus devices Some UPSes incorrectly report the Shutdown Active bit (7th bit of the status byte) as always on (=1), consequently making the driver believe the UPS is nearing a shutdown (and, as a result, ups.status always contains FSD). To workaround this issue, add a new ignoresab flag that makes the driver do just what its name tells (IGNORE Status Active Bit) skipping the relative item in qx2nut tables. References: - http://lists.alioth.debian.org/pipermail/nut-upsdev/2015-March/006896.html
@
in port name Also reworded parts of the man page.
-lm
.
http://news.gmane.org/find-root.php?message_id=544515BA.4060804%40niksoggia.it
data/driver.list.in: HCL: add devices supported by nutdrv_qx - Fideltronik LUPUS 500 USB Protocol: megatec USB subdriver: fabula Reference: http://lists.alioth.debian.org/pipermail/nut-upsuser/2014-June/009059.html
MAINTAINERS, docs/man/.gitignore, docs/man/Makefile.am, docs/man/al175.txt, docs/man/index.txt, docs/man/nutupsdrv.txt, docs/new-drivers.txt, drivers/Makefile.am, drivers/al175.c: al175: updated driver, please restore it Back in 2005 I was young and idealistic, that’s why you finally marked al175 as broken, but now I understand your points (some) and that in NUT you need good portability. So this time I’ve checked that al175 compiles with CC="gcc -std=c89 -pedantic", and CC="gcc -std=c99 -pedantic" Also, I’ve tried to clean-up the driver based on feedback from 2009, but unfortunately I no longer have hardware to test and will not have any in foreseable future, so the driver was reworked to meet the project code quality criteria, without testing on real hardware. Some bugs may have crept in. Changes since last posting in 2009:
drivers/apcsmart.c: apcsmart: verify/setup fixups legacy_verify()
* scripts/java/jNut/src/main/java/org/networkupstools/jnut/Client.java, scripts/java/jNut/src/main/java/org/networkupstools/jnut/Command.java, scripts/java/jNut/src/main/java/org/networkupstools/jnut/Device.java, .../java/jNut/src/main/java/org/networkupstools/jnut/NutException.java, .../jNut/src/main/java/org/networkupstools/jnut/StringLineSocket.java, scripts/java/jNut/src/main/java/org/networkupstools/jnut/Variable.java: Fix mail address typo for javadoc.