Repository navigation
Conversation
Add the optional 'value' argument to the upscmd man page synopsis and describe both the 'command' and 'value' parameters. Signed-off-by: TomZanna <git@tomzanna.com>
Document and implement command_delay automatic timeout handling, plus offdelay and startdelay parameters, and expose outlet.count and ups.watchdog.status variables. Signed-off-by: TomZanna <git@tomzanna.com>
|
A ZIP file with standard source tarball and another tarball with pre-built docs for commit e0eaba0 is temporarily available: NUT-tarballs-PR-3722.zip. |
…ings Add read-only input.transfer.reason variable from the device's recorded bypass code, refreshed each poll and cleared by clear.fault.record. Stop publishing device settings (outlet.delay.start, ups.start.auto, ups.watchdog.status, input.eco.switchable, ups.beeper.status) with assumed defaults; expose them only once the device reports them, retaining last known values with a warning when the device stops responding.
…ools#3722] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
jimklimov
left a comment
There was a problem hiding this comment.
Generally looks quite solid, thanks! One group of comments I have is about terminology (see concerns about "outlet bank" below), another is about readability of logged messages - many places where I think there should be a space between %s tokens... or maybe I missed something as I read the code. There may also be some de-duplication possible with existing common code.
…y in man page Improve tripplitesu driver error handling to exit upon intermediate errors rather than continuing. Update the man page to consistently use "outlet" terminology instead of "outlet bank", and expand documentation of the watchdog setting and command failure behavior for clarity. Signed-off-by: TomZanna <git@tomzanna.com>
jimklimov
left a comment
There was a problem hiding this comment.
Even better, thanks for the previous changes. Got a comment/suggestion on watchdog feature, see below.
|
I found something I'd like your opinion on before changing it. The This might be fine for I'd like to gate the final So: for the automatic shutdown, would you rather have it abort when the return cannot be guaranteed, or threat the whole sequence as "best-effort" (attempt ARB/SDR, log a warning if they fail, but still issue SDA)? |
|
That's quite a loaded question :) A loud log at this stage would likely not be seen (unless someone is actively troubleshooting at that moment), nor recorded (if this happens in Maybe add a driver configuration toggle for this situation, with whichever default, so it would act according to that. |
Expose the watchdog timeout and restart-alarm fields as the read/write ups.watchdog.timeout and ups.watchdog.alarm variables, add a reset.watchdog instant command, and disarm an armed watchdog when the driver exits on purpose so that a restart (e.g. during a package upgrade) does not power cycle the load. Watchdogs the driver never enabled or that are already disabled are left untouched, and a crash or SIGKILL does not disarm them. Make shutdown.default always turn auto-reboot on so every outlet comes back when mains returns, and add the shutdown_mode setting to choose between stopping at the first failed or unanswered operation (abort) and continuing (best effort, default). It no longer sets a return delay of its own, so startdelay only seeds ups.delay.start. The load.off/load.on multi-frame commands now also stop at the first rejected or unanswered frame. Signed-off-by: TomZanna <git@tomzanna.com>
Rework the tripplitesu manual to match the driver's current behavior: document the accepted ranges for command_delay, offdelay and startdelay, clarify which instant commands use each delay, and drop the removed -1 automatic mode of command_delay along with the historical shutdown delay default that no longer applies. Signed-off-by: TomZanna <git@tomzanna.com>
Extend the auto-reboot reader into a generic helper driven by a table of protocol command, variable name, log description and on/off names. Use it for auto-reboot, ECO mode and buzzer settings, removing the duplicated polling, parsing and warning code from each getter. Signed-off-by: TomZanna <git@tomzanna.com>
Replace the separate low/high transfer voltage getters and setters with table-driven, index-based helpers backed by a transfer_voltage_id enum. Each entry carries the dstate variable name and its field in the TXV reply, so field parsing, comparison and the combined device write share one code path instead of duplicated logic. Store reported transfer limits per voltage in arrays keyed by the same enum, replacing the four min/max globals. Signed-off-by: TomZanna <git@tomzanna.com>
Move the shutdown command lookup to the top of instcmd() so these commands are matched before the outlet and simple command paths. Guard the outlet command walk and the shutdown lookup with a case-insensitive prefix check, so commands that cannot match skip those loops entirely. Also shorten several header and function comments and drop the verbose restore hint from the ups.start.auto change log line, keeping only the old and new setting names. Signed-off-by: TomZanna <git@tomzanna.com>
The tripplitesu device restarts its watchdog timer on every command, not only on an explicit kick, so the driver's periodic polls usually keep an armed watchdog quiet. However, a watchdog that trips, power cycles the load and comes back disabled could previously go unnoticed, leaving stale values in `ups.watchdog.status`, `ups.watchdog.timeout` and `ups.watchdog.alarm`. - Re-read the watchdog setting on every update cycle while the watchdog is believed to be armed, so a trip is published even when the driver keeps running across the restart (e.g. host not powered by the UPS). - Log repeated failed reads at debug level to avoid flooding the log, and log other failed setting reads instead of silently using defaults. - Document that polls restart the timer as an implementation detail, why an explicit `reset.watchdog` is still recommended, and that `reset.watchdog` fails after a trip until the watchdog is re-armed. - Add corresponding `NEWS.adoc` entries for the upcoming release. Signed-off-by: TomZanna <git@tomzanna.com>
Add a `ups.start` instant command so a device that has been switched off can be started again. It enables the auto-reboot setting and writes the restart delay, which is what makes the firmware start its outputs. The delay is passed as the command value in whole minutes (0-60) and defaults to the `startdelay` setting when no value is given. A device that is already running is not switched off; only the delay is stored, and a scheduled shutdown is left untouched. The command fails when the device does not confirm the auto-reboot setting, before anything that could change the power state is sent. Document the command in the tripplitesu(8) man page, add its entry to `data/cmdvartab`, and note it in NEWS.adoc. Signed-off-by: TomZanna <git@tomzanna.com>
|
✅ Build nut 2.8.5.5909-master completed (commit b05c3d7c90 by @TomZanna)
|
Added the
offdelayandstartdelaysettings toups.conf(in seconds and minutes, respectively, matching the units used by the corresponding device commands). Also added support for an optional delay (in seconds) passed through thevalueargument of theshutdown.return,shutdown.reboot, andshutdown.reboot.gracefulinstant commands. This allows the delay to be selected per invocation without restarting the driver or changing its configuration.Added control of individual outlet banks through the
outlet.n.load.offandoutlet.n.load.oninstant commands, along with the correspondingoutlet.count,outlet.n.status, andoutlet.n.switchablevariables.Added the
shutdown.stayoffinstant command and aligned the shutdown-related commands with their intended return-delay behavior:shutdown.rebootandshutdown.reboot.gracefulrequest the load to return immediately after shutdown. The device will only restart the load when the restart delay is longer than the shutdown delay.shutdown.returnandshutdown.stayoffclear the return delay, so the load returns only when mains is (re)applied, or remains off, respectively.Added the following variables and instant commands:
ups.beeper.status,ups.delay.start,ups.start.auto,ups.watchdog.status,outlet.delay.start, andinput.eco.switchablebattery.datebeeper.muteandclear.fault.recordinput.transfer.lowandinput.transfer.highagainst the ranges reported by the device, exposed throughinput.transfer.low.min/.maxandinput.transfer.high.min/.max.Instant commands and variable writes now report failures when the device rejects an operation or does not respond, instead of unconditionally reporting success.
Added the
command_delaysetting toups.confto enforce a minimum interval, in milliseconds, between commands sent to the UPS. This works around devices that fail to respond when commands are sent too soon after one another. The interval is measured from the previous command, so an idle connection is not penalized. The special value-1starts the driver without an initial delay and enables one-second command pacing only after a command times out. See [PR drivers/tripplitesu.c: add 1s delay in command_send #3273].