Skip to content

Conversation

@jimklimov
Copy link
Member

Bump the copy of 42ity fork contents to minimize difference with the master. Follows up from previous resync in PR #2275 (made before NUT v2.8.2 was released, including some features backported from the FTY branch), and related to #1316 generally.

Regarding parts that originated in 42ITy and were upstreamed earlier, the nutconf effort got largely updated in the upstream during the past few months.

ntd and others added 30 commits May 21, 2024 22:44
Add a new driver for Bicker DC UPS systems based on the PSZ-1063
extension module. This includes UPSIC-1205, UPSIC-2403 and
DC2412-UPS(LD) models.

Signed-off-by: Nicola Fontana <ntd@entidi.it>
The protocol supports shutdown after a custom delay settable between 0
and 255 seconds. Unfortunately the real device (UPSIC-2403D) seems to
always enforce a 2 seconds delay.

Signed-off-by: Nicola Fontana <ntd@entidi.it>
Signed-off-by: Nicola Fontana <ntd@entidi.it>
Signed-off-by: Nicola Fontana <ntd@entidi.it>
Signed-off-by: Nicola Fontana <ntd@entidi.it>
Signed-off-by: Nicola Fontana <ntd@entidi.it>
Signed-off-by: Nicola Fontana <ntd@entidi.it>
Bicker told me to refer to the UPS Gen software's user manual for more
details on their protocol, and in fact that manual contains much more
info. Added a summary of available commands to the comments, as a quick
reference for feature implementation.

Signed-off-by: Nicola Fontana <ntd@entidi.it>
In the previous implementation the command index was always '\x03', as
stated by the UPSIC manual. After new evidence has been found (UPS-Gen2
software user manual), it came out there are much more commands grouped
in different indexes.

Signed-off-by: Nicola Fontana <ntd@entidi.it>
I'm planning to add functions for reading strings, i.e. without knowing
beforehand the size of the response packets. This required some
refactoring of the receiving functions.

Also, while at it, added docblocks to many Bicker functions, hopefully
easing the maintenance in the future.

Signed-off-by: Nicola Fontana <ntd@entidi.it>
Identification fields are now queried from the device. Also
"battery.charge" is now set properly.

Signed-off-by: Nicola Fontana <ntd@entidi.it>
Signed-off-by: Nicola Fontana <ntd@entidi.it>
Added the needed infrastructure for getting and setting parameters.
Actually the only parameter that is surely working is "ups.delay.start".

Signed-off-by: Nicola Fontana <ntd@entidi.it>
When a command is unsupported, the "\x01\x03\xEE\x07\x04" response
packet is returned. This is different from a response packet with a
wrong command index.

WARNING: the "unsupported" packet has been found sperimentally and it is
an undocumented feature.

Signed-off-by: Nicola Fontana <ntd@entidi.it>
User provided strings could contain printf special sequences and as such
they should never be used in the format argument of dstate_setinfo().

Signed-off-by: Nicola Fontana <ntd@entidi.it>
Accessing an uint16_t on odd addresses is not portable. Avoid having to
deal with that issue by always constructing words mathematically from
single bytes. This also solves any endianness difference.

Signed-off-by: Nicola Fontana <ntd@entidi.it>
Signed-off-by: Nicola Fontana <ntd@entidi.it>
`char` is by default signed and (as the name implies) designed to access
string characters. For accessing bytes, the `uint8_t` type is more
appropriate.

Signed-off-by: Nicola Fontana <ntd@entidi.it>
Ensure the format string in logging messages is the correct one without
subcasting. Furthermore, due to the promotion rules of the C language
(where any given type, even unsigned, is promoted to int when possible),
explicitly cast to unsigned where required.

Signed-off-by: Nicola Fontana <ntd@entidi.it>
Change BICKER_PACKET from a constant value to a macro that depends on
the data length. This should make clear that the packet size depends
directly from the data size.

Refactored some code here and there trying to minimize the presence of
magic numbers and clarify the intentions.

Signed-off-by: Nicola Fontana <ntd@entidi.it>
Using an in/out struct and making some specific field mandatory is
cumbersome and error prone. Now the data needed for setting or getting
parameters is explicitly required by the arguments.

Signed-off-by: Nicola Fontana <ntd@entidi.it>
These devices seem to be picky on what you use to set parameters.

Signed-off-by: Nicola Fontana <ntd@entidi.it>
Every Bicker parameter that has a correspondence in nut-names.txt has
been mapped. If the parameter is disabled on the device, no NUT variable
is created. If the NUT variable is set to an empty string, the parameter
is reset and disabled on the device and that NUT variable is removed.

Signed-off-by: Nicola Fontana <ntd@entidi.it>
…" normally [networkupstools#2446]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…tart/stop" wrappings [networkupstools#2455]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… prepare Windows Firewall for upsd [networkupstools#2446, networkupstools#2455]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Add `net start/stop` docs and practical support to `nut.exe`
jimklimov added 13 commits June 20, 2024 15:02
…has launched

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
… O_NDELAY means EOF (the other side closed socket) [networkupstools#2484]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…s of these guards

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…around it [networkupstools#2484]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Make sure NUT driver daemons close their Unix sockets when their counterparts do
Combine several small PRs for issue networkupstools#1316 and their NEWS entries
…lenstest

Define an `auglenstestsdir` to install the augeas `test_nut.aug` file
…al-nutscan.la to simplify nut-scanner recipes

Initiated in DMF branch by commit 4fec99a

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…d of defining them at first assignment

Would help later when merging DMF/FTY branches; for now just
a bit of syntactic sugar and reduction of diffs against them.

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ave libserial-nutscan.la

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…n_la_LDFLAGS

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ase after recent recipe changes

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov added 12 commits June 25, 2024 08:57
…e (is flag now)

Lingered in FTY branch, long gone in master.

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…mmonstr.la

Initially that embedding was done to help libnutscan builds with libcommonstr.la
helper, but then a separate link with libnutwincompat.la was back-ported - so
this line removal helps both to constrain the helper size/scope, and against a
build-time conflict.

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…serial-nutscan

Port recipe for `libserial-nutscan.la` from DMF/FTY branch and clean up nut-scanner makefile
…wincompat-nutscan

Revise `libwincompat.la` vs. `libcommonstr.la` helpers in `libnutscan` build recipe
clients/upsclient.h: include sys/types.h
…ge-20240615

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ge-20240615

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov jimklimov merged commit 033ba47 into networkupstools:FTY Jun 26, 2024
@jimklimov jimklimov deleted the FTY-remerge-20240615 branch June 26, 2024 20:45
@jimklimov jimklimov restored the FTY-remerge-20240615 branch April 15, 2025 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DMF NUT Data/Dynamic Mapping File/Format/Functionality feature impacts-release-2.8.2 Issues reported against NUT release 2.8.2 (maybe vanilla or with minor packaging tweaks) nutconf NUT configuration library and tool

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants