drivers: nhs_ser: do not force CRTSCTS (breaks CDC-ACM and 3-wire ser…#3511
drivers: nhs_ser: do not force CRTSCTS (breaks CDC-ACM and 3-wire ser…#3511jpastoreli wants to merge 1 commit into
Conversation
|
A ZIP file with standard source tarball and another tarball with pre-built docs for commit 58af3b7 is temporarily available: NUT-tarballs-PR-3511.zip. |
…ial)
Forcing CRTSCTS in openfd() blocks communication on NHS UPSes whose port
has no hardware flow-control lines: USB/CDC-ACM virtual ports (e.g.
/dev/ttyACM0) and the official NHS 3-wire RS-232 cable (DB9 pins 2/3/5
only, no RTS/CTS). The driver opens the port but never assembles a packet.
Disabling CRTSCTS restores communication.
Signed-off-by: Jonas Pastoreli <100150319+jpastoreli@users.noreply.github.com>
|
✅ Build nut 2.8.5.4900-master completed (commit 24cb2b67bf by @jpastoreli)
|
|
✅ Build nut 2.8.5.4901-master completed (commit d41946991b by @jpastoreli)
|
As expected, testing on 3 units that I know the problem appears fail on communication. |
|
Re-tested with other 2 units, same problem @jimklimov. I'll see that I can make something about these code and commit a more elegant solution. |
|
@jimklimov The current implementation keeps the existing driver behavior as the default, but makes the relevant serial communication settings configurable from Default behavior is intentionally preserved:
So existing installations should continue to behave as before, including the historical RTS/CTS default. For the NHS Mini Gamer / CDC-ACM case described in this issue, the fix is now simply: serial_flow_control = noneI also changed the implementation to use the standard NUT serial helpers instead of keeping direct serial I/O paths in the driver:
The driver now only keeps local I deliberately reduced the scope after testing the first approach. The earlier version exposed too many low-level
I also removed the Linux-specific All new options are registered with The NHS packet protocol handling itself is unchanged: DATA/HWINFO framing, checksums, packet decoding, status handling and reconnect logic remain the same. I have built the updated driver successfully. My next step is to test it on the affected NHS Mini Gamer device with: serial_flow_control = noneand also verify that the default configuration still behaves the same on devices which worked with the previous hardcoded RTS/CTS behavior. |
|
@Challado @jpastoreli : was the updated fix pushed anywhere and posted as a PR? |
|
Hi Jim,
Yes, I pushed the updated implementation to my fork:
https://github.com/Challado/nut
The latest commit contains the corrected and simplified implementation:
Challado@eb0465d
The preceding commit (`ae8fc51`) was the first implementation and
contained unnecessary complexity; it is corrected by the latest
commit. The final branch state is the intended version.
The change preserves the historical `nhs_ser` serial defaults, but
allows devices which do not use RTS/CTS to configure:
serial_flow_control = none
It also migrates the serial-port lifecycle and data transfer to the
standard NUT serial helper functions.
I have not opened a separate Pull Request for this implementation yet.
The current comparison against the upstream master branch is available
here:
master...Challado:master
I will be away on vacation for a few days, but I will review any
additional feedback or necessary adjustments when I return.
Best regards,
Lucas
…On Fri, 17 Jul 2026 08:37:49 -0700, Jim Klimov ***@***.***> wrote:
jimklimov left a comment [(networkupstools/nut#3511)](#3511 (comment))
***@***.***(https://github.com/Challado) ***@***.***(https://github.com/jpastoreli) : was the updated fix pushed anywhere and posted as a PR?
—
Reply to this email directly, [view it on GitHub](#3511?email_source=notifications&email_token=AFQ3CA3SOIF6N7OHJHKV2FT5FJB43A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKMBQGQ4TAMBZGQ3KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-5004900946), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AFQ3CA34RPUCYITMXWTPN2T5FJB43AVCNFSNUABDKJSXA33TNF2G64TZHM4DCMRZGI2TOO2JONZXKZJ3GQ3TMMZZGIZTIMRTUF3AE).
You are receiving this because you were mentioned.
|
|
Thanks, i'll take a look - and gave a good vacation! |
Disables the hardcoded CRTSCTS in nhs_ser openfd(), which blocks
communication on NHS UPSes with no RTS/CTS lines (USB/CDC-ACM and the
official 3-wire serial cable).
Full diagnosis, raw packet captures and device details: Refs #3510