-
-
Notifications
You must be signed in to change notification settings - Fork 436
nutdrv_qx (Megatec) errors out after reading UPS data on Windows over USB CDC/COM #3452
Copy link
Copy link
Open
Labels
AIFor good or bad, machine tools are upon us. Humans are still the responsible ones.For good or bad, machine tools are upon us. Humans are still the responsible ones.Connection stability issuesIssues about driver<->device and/or networked connections (upsd<->upsmon...) going AWOL over timeIssues about driver<->device and/or networked connections (upsd<->upsmon...) going AWOL over timeQx protocol driverDriver based on Megatec Q<number> such as new nutdrv_qx, or obsoleted blazer and some othersDriver based on Megatec Q<number> such as new nutdrv_qx, or obsoleted blazer and some othersWindowsWindows-not-on-par-with-POSIXAspect of Windows builds known to be dysfunctional compared to POSIX builds; fix needed to be on parAspect of Windows builds known to be dysfunctional compared to POSIX builds; fix needed to be on parimpacts-release-2.8.5Issues reported against NUT release 2.8.5 (maybe vanilla or with minor packaging tweaks)Issues reported against NUT release 2.8.5 (maybe vanilla or with minor packaging tweaks)serial port
Milestone
Metadata
Metadata
Assignees
Labels
AIFor good or bad, machine tools are upon us. Humans are still the responsible ones.For good or bad, machine tools are upon us. Humans are still the responsible ones.Connection stability issuesIssues about driver<->device and/or networked connections (upsd<->upsmon...) going AWOL over timeIssues about driver<->device and/or networked connections (upsd<->upsmon...) going AWOL over timeQx protocol driverDriver based on Megatec Q<number> such as new nutdrv_qx, or obsoleted blazer and some othersDriver based on Megatec Q<number> such as new nutdrv_qx, or obsoleted blazer and some othersWindowsWindows-not-on-par-with-POSIXAspect of Windows builds known to be dysfunctional compared to POSIX builds; fix needed to be on parAspect of Windows builds known to be dysfunctional compared to POSIX builds; fix needed to be on parimpacts-release-2.8.5Issues reported against NUT release 2.8.5 (maybe vanilla or with minor packaging tweaks)Issues reported against NUT release 2.8.5 (maybe vanilla or with minor packaging tweaks)serial port
Type
Fields
Give feedbackNo fields configured for issues without a type.
When using the
nutdrv_qxdriver with themegatecprotocol on Windows (via a USB CDC/COM serial connection), the driver successfully reads exactly 47 bytes of data sent by the UPS in response toQ1. However, immediately after reading the 47th byte, it hangs for exactly 1 second, resulting in an I/O error (err 0) and a failure to preprocess the answer.My hypothesis is that the Win32 serial wrapper (
w32_serial_read) might be failing to correctly catch the\rterminator to close the read operation early, or there is an issue with the buffer/timeout configurations on Windows compared to Linux.To Reproduce
Steps to reproduce the behavior:
.\nutdrv_qx -a tsshara -DDDDExpected behavior
The read operation should complete successfully upon receiving the
\rterminator (the 47th byte) and pass the buffer toqx_processwithout hitting the 1-second timeout.Logs
Environment / Desktop
\\.\COM3)nutdrv_qx/megatecAdditional context
COM3and sendingQ1\r, the UPS responds immediately with:(231.0 231.0 116.0 011 60.0 27.2 41.0 00001000. This string length is exactly 46 characters +\r(47 bytes). The driver log clearly shows it successfully reading byte by byte up to that exact 47th byte (at1.643s), at which point it halts and times out exactly 1.000 second later (at2.643s).Disclaimer: I have used AI to help me write this issue, since is my ever first issue and english is not my main language.