GeezerVison is showing github.com — Linux serial PTT: show full open error and permission fix instructions; do not report failed ports as Open · Issue #6972 · aethersdr/AetherSDR
Linux serial PTT: show full open error and permission fix instructions; do not report failed ports as Open #6972DescriptionProblem
On Linux, a user configuring a serial PTT foot switch can click Open, see Open in Radio Setup, and find that the switch does nothing because the process lacks permission to open the device. No error dialog or actionable permission guidance is displayed.
This is especially confusing with default /dev permissions when the desktop user is not a member of the device's serial-access group.
Evidence / root cause
Source traced on main at 147142635; this report is based on code inspection, not a live Linux reproduction.
- SerialPortController::open() logs the port and
m_port.errorString(), emits errorOccurred, and returns false on open failure.
- The serial controller's
errorOccurred signal has no UI receiver in MainWindow_Controllers.cpp.
- loadSettings() discards the return value of
open().
- The Open button/status code saves
SerialPortOpen=True and displays Open before the worker attempts to open the port. The status reflects the saved request rather than the actual result.
Reproduction
- On Linux, connect a serial PTT interface whose device node is not accessible to the current user (e.g. a root:dialout device with mode 0660, with the user outside dialout and no ACL granting access).
- In Radio Setup → Serial & Controllers, select the device and configure its PTT input.
- Click Open.
- Observe that the UI displays Open, no error dialog appears, and the switch cannot work. The failure is only in the log.
- Also check the equivalent failure with Auto-open serial port on startup enabled.
Requested behavior
Show a visible error dialog for a failed serial-port open, preserving the complete underlying Unix/Qt error text and the full attempted device path. Include the native error code when available; do not replace the actual error with a generic "could not connect."
Example for a device owned by dialout:
Permission denied: Can't open /dev/ttyUSB0. Add your user to the dialout group to access serial ports.
Include copyable instructions, for example:
sudo usermod -aG dialout "$USER"
For Debian/Ubuntu, an alternative is:
sudo adduser "$USER" dialout
Explain that the user must log out of the desktop session and log back in, then relaunch AetherSDR and retry.
Determine the appropriate group from the device and platform where possible (e.g. dialout or uucp), rather than assuming every distribution uses dialout or telling users to join tty indiscriminately. Recommend membership only when the device's permissions make that a relevant remedy. If the appropriate remedy cannot be determined, retain the full error and explain how to inspect device ownership/permissions. Display instructions for the user to run; do not execute administrative changes automatically.
Use the underlying error to distinguish permission failures from missing/unplugged devices, port-in-use/lock failures, and other failures. Do not show group-membership advice for every open error.
Reflect the actual result in the connection status and controls: a failed open must remain Closed or show an explicit error, and Open must remain available for retry. Keep auto-open intent separate from observed connection state. Apply error reporting to both manual and startup opens, without repeated dialog spam.
Acceptance / verification
- Reproduce permission denial on Linux and verify a visible, accessible dialog includes the complete error and full device path.
- Verify appropriate group guidance, a copyable command, and logout/login instructions for the default serial-device permission case.
- Verify the UI never claims Open after failure and the user can retry successfully after permissions are corrected.
- Verify another failure type retains its specific error without misleading dialout advice.
- Verify a successful open still behaves normally.
- Update the existing Linux/serial user documentation.
- Exercise the GUI through the agent automation bridge and include screenshots of the error and corrected connection state in the fix PR. Check radio availability/locks first; this error path should be provable without transmitting.
- Consider exposing serial connection state and last open error through the bridge if existing verbs cannot verify them.
Command references: Debian adduser(8), usermod(8). Activityaethersdr-agent commented on Nov 2, 2026 Triage: confirmed by reading the code on main (1471426)
I checked each point in the report against the source and they all hold. I did not reproduce this on Linux.
Root cause
- The status shows what was requested, not what happened.
RadioSetupDialog.cpp:8610-8638: updatePortStatus() reads only AppSettings["SerialPortOpen"]. The Open handler writes True, sets the label to Open, and then emits serialSettingsChanged. That signal goes to MainWindow.cpp:3713, which queues m_serialPort->loadSettings() on the external-controller thread. Nothing ever sends the real open result back to the dialog.
- The open result is thrown away.
SerialPortController.cpp:729-731: loadSettings() calls open(...) and ignores the bool it returns.
- Nothing listens to
errorOccurred. The signal is declared at SerialPortController.h:97 and emitted at SerialPortController.cpp:392 (and on Windows at :120 / :131). None of the connects in MainWindow_Controllers.cpp:2753-2780 handle it. A failed open only produces an aether.devices warning in the log.
- The message lacks detail. Line 392 emits only
m_port.errorString(), without the device path, QSerialPort::error(), or errno.
A related bug the fix needs to handle
SerialPortController.cpp:671-672 treats SerialAutoOpen || SerialPortOpen as one flag, shouldOpen. Two consequences:
- With Auto-open checked, clicking Close sets
SerialPortOpen=False, but shouldOpen is still true. The port stays open (or is opened again) even though the button switches to Closed.
SerialPortOpen=True is saved, so the app tries to open the port on every launch even with Auto-open unchecked.
This is the "keep auto-open intent separate from observed connection state" item in the request.
Proposed fix
SerialPortController (core):
- Add a status signal, for example
connectionStateChanged(bool open, QString port, QString error, int errorKind), and emit it after every open() and close(). Keep errorOccurred for compatibility, or drop it.
- On a non-Windows open failure, capture all of the following before the next call changes errno:
errno and strerror(errno)
m_port.error() and m_port.errorString()
- the full system location (
QSerialPortInfo(...).systemLocation(), i.e. /dev/ttyUSB0)
- Classify the failure from errno and the device's file status (
stat()), not from QSerialPort::error() alone. Qt reports a lock-file failure ("device is already locked") as PermissionError, so the Qt enum can't tell "no group access" apart from "another program has the port":
- ENOENT/ENODEV → device missing or unplugged
- EBUSY, or a lock failure → port in use
- EACCES/EPERM → permission denied. Show group advice only if all of these are true: the device's group has rw permission (
st_mode & 060), the user's write access is denied (access(path, R_OK|W_OK) fails), and the process's group list (getgroups()) doesn't include st_gid. Name the group via getgrgid(st_gid) (dialout, uucp, ...) rather than hardcoding it.
- Anything else → show the error text as-is, plus how to inspect the device:
ls -l /dev/ttyUSB0, getfacl, id.
- Split the two settings:
SerialPortOpen means "open for this session", and SerialAutoOpen alone controls opening at startup. Make Close override Auto-open for the current session.
GUI:
MainWindow_Controllers.cpp: connect the new signal on the GUI thread. Track the last state and error in MainWindow and show a QMessageBox once per distinct failure (same port and same errno). That avoids repeated dialogs at startup and on reconnect.
- For permission failures: selectable/copyable text showing
sudo usermod -aG <group> "$USER" (Debian/Ubuntu alternative: sudo adduser "$USER" <group>), and a note to log out of the desktop session and back in, then relaunch.
- Display the commands only; never run them.
- The project has no existing in-app
dialout handling, so this is new code.
RadioSetupDialog.cpp:8610: base updatePortStatus on the controller's reported state, not the saved setting. On failure, show Closed — with the error tone, and leave Open enabled so the user can retry.
- Windows: also send the
GetLastError() code from :117-120 through the same classifier (5 = access denied / in use, 2 = not found), using the Windows wording.
Bridge / docs:
- Expose serial state and the last open error through the automation bridge so the GUI screenshots and acceptance checks in the issue can be produced without transmitting.
- Update
docs/user/docs/linux.md:62 (it already mentions uucp/dialout) and flexcontrol-tuning-knob.md:120 (Debian only; add the logout/login step), plus the versioned_docs copies.
Handoff
The cause is known and the fix is contained: SerialPortController gains an observed-state signal and errno-based classification, MainWindow shows a dialog once per distinct failure, and the Radio Setup status shows the real result. Separating SerialAutoOpen from SerialPortOpen is part of making the status accurate. Otherwise Close stays broken whenever Auto-open is on.
FlexControl has the same Open-button pattern (FlexControlOpen). It is out of scope here, but the new classifier could be reused for it later.
🤖 aethersdr-agent · cost: $0.4128 · model: claude-opus-5-5
📍 Citation health check (Foundry Constitution Principle I): 1 resolved, 9 unresolved against /Users/aetherclaude/workspace/AetherSDR at origin/main.
Unresolved citations (9)
| Citation |
Reason |
MainWindow.cpp:3713 |
file not found in workspace |
MainWindow_Controllers.cpp:2753-2780 |
file not found in workspace |
RadioSetupDialog.cpp:8610 |
file not found in workspace |
RadioSetupDialog.cpp:8610-8638 |
file not found in workspace |
SerialPortController.cpp:392 |
file not found in workspace |
SerialPortController.cpp:671-672 |
file not found in workspace |
SerialPortController.cpp:729-731 |
file not found in workspace |
SerialPortController.h:97 |
file not found in workspace |
flexcontrol-tuning-knob.md:120 |
file not found in workspace |
jensenpat commented on Nov 2, 2026 CollaboratorAuthor More actions added a commit that references this issue on Nov 12, 2026This issue will close once commit 0d2d160 is merged into the 'main' branch.0d2d160 aethersdr-agent commented on Nov 13, 2026 Claude here — fix applied in PR #7241: #7241
What was changed: fix(serial): show the real open error with permission advice; never report a failed port as Open (#6972). Principle VIII.
Files touched:
CMakeLists.txt
docs/automation-bridge.md
docs/user/docs/flexcontrol-tuning-knob.md
docs/user/docs/linux.md
docs/user/docs/radio-setup.md
src/core/AutomationServer.cpp
src/core/AutomationServer.h
src/core/SerialOpenError.cpp
src/core/SerialOpenError.h
src/core/SerialPortController.cpp
src/core/SerialPortController.h
src/gui/MainWindow.cpp
src/gui/MainWindow.h
src/gui/MainWindow_Controllers.cpp
src/gui/MainWindow_Session.cpp
src/gui/RadioSetupDialog.cpp
src/gui/RadioSetupDialog.h
tests/serial_open_error_test.cpp
tests/tests.cmake
— AetherClaude (automated agent for AetherSDR)
🤖 aethersdr-agent · cost: $0.7385 · model: claude-opus-5-5
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|