Skip to content

Comments

drivers/tripplitesu.c: add 1s delay in command_send#3273

Merged
jimklimov merged 3 commits intonetworkupstools:masterfrom
TomZanna:tripplite
Feb 2, 2026
Merged

drivers/tripplitesu.c: add 1s delay in command_send#3273
jimklimov merged 3 commits intonetworkupstools:masterfrom
TomZanna:tripplite

Conversation

@TomZanna
Copy link
Contributor

@TomZanna TomZanna commented Jan 20, 2026

Important

This PR is currently a draft. I am looking for feedback on the best implementation strategy (see below).

Intermittent communication timeouts were observed when multiple commands were sent in rapid succession. Specifically, when running the driver manually with maximum debug verbosity, a timeout occurs consistently at the second AVL message within the init_comm function.
Adding a 1-second delay at the beginning of do_command() ensures the hardware buffer is ready and prevents these "read timeout" errors.

Should we consider making this a configurable parameter in ups.conf (e.g., command_delay)? I'd appreciate the maintainers' insight on whether this hardware quirk is universal enough to justify a global delay for this driver.

@jimklimov
Copy link
Member

Thanks, the proposal looks reasonable. Hard to say if the problem is "universal", given that this is a driver aimed at certain models of UPSes by one vendor, so there are just so many devices impacted by any change here in any case.

I usually lean in favour of toggles, probably as a numeric value for that usleep argument, which would be e.g. -1 by default to disable it, and maybe flip to 1E6 in case the device saw an I/O timeout. This would allow the problem to be probably fixed out of the box, with end users free to set a specific value or disable the feature by setting 0 depending on how the fix behaves in their particular case.

@TomZanna
Copy link
Contributor Author

TomZanna commented Jan 25, 2026

First of all, I apologize for the radio silence! I’ve been a bit buried lately preparing for a university exam and managing a house move at the same time.

In the meantime, I’ve done some further testing and found a couple of interesting things:

  • It turns out the TSU_SHUTDOWN_RESTART command can actually power on a UPS that is currently off. I’ll need to update the documentation to reflect this behavior.
  • I’ve been sniffing the serial traffic from the official PowerAlert software and noticed it’s possible to specify custom delays for shutdown and reboot. I’m planning to integrate this into upscmd so we have better control over the timing.

Intermittent communication timeouts were observed when multiple commands
were sent in rapid succession.

Adding a 1-second delay at the beginning of command_send() ensures the
hardware buffer is ready and prevents the "read timeout" errors.

Signed-off-by: TomZanna <git@tomzanna.com>
@TomZanna TomZanna marked this pull request as ready for review January 29, 2026 17:49
@AppVeyorBot
Copy link

@jimklimov jimklimov added Tripp Lite Connection stability issues Issues about driver<->device and/or networked connections (upsd<->upsmon...) going AWOL over time labels Jan 31, 2026
@jimklimov jimklimov added this to the 2.8.5 milestone Jan 31, 2026
@jimklimov jimklimov merged commit 046334a into networkupstools:master Feb 2, 2026
33 of 35 checks passed
jimklimov added a commit that referenced this pull request Feb 2, 2026
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@TomZanna TomZanna deleted the tripplite branch February 3, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Connection stability issues Issues about driver<->device and/or networked connections (upsd<->upsmon...) going AWOL over time Tripp Lite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants