Closed drowe67 closed 1 year ago
I think it's useful to know what physical ports are actually available :+1: BTW there are many variations in Linux serial port names, does #136 capture them all in the list?
:thinking: However I think the port not appearing (when a user knows it's there and connected to the PTT device) might be confusing to a user. Like the current situation, it would require a note in the documentation to explain, so is a sideways step/variation on this issue, rather than a solution.
The behavior above in OP above would be ideal - let the computer take the user straight to the problem.
I'm not too familiar with serial ports in Linux but my understanding is that /dev/ttyS and /dev/ttyUSB should cover the vast majority (if not all) of the common ones. Those are definitely covered by /sys, IIRC.
Anyway, I tweaked the OK/Apply actions to test chosen ports and display a message: https://github.com/drowe67/freedv-gui/pull/136/commits/113c366dffb70640d10c5c99e5933426c9255d2e. The message right now is "Couldn't open serial port ___. This is likely due to not having permission to access the chosen port." but I'm open to suggestions.
Hi @timw, thanks for working on this. I took a look at https://github.com/drowe67/freedv-gui/commit/113c366dffb70640d10c5c99e5933426c9255d2e:
@timw - it's actually OK not to solve this issue right now, it's just a minor one, we've documented it, and might be tricky to solve. If you're really keen, maybe address it in a future PR, and just use https://github.com/drowe67/freedv-gui/pull/136 to address the PTT in feature?
@drowe67, works for me. Just reverted for the time being.
Hi all
Can I note that @timw != @tmiw - getting a lot of tags for projects I'm not involved in as a result :)
Hi all
Can I note that @timw != @tmiw - getting a lot of tags for projects I'm not involved in as a result :)
Oops so sorry - that's probably me! Will be more careful in future .....
@drowe67 et al, is this something that would still be useful to add? Doing some cleanup of the currently open GitHub issues at the moment.
Yes I've been caught by it several times (forgetting to add the dialout
group thing). So if we could detect this it would be great.
Yes I've been caught by it several times (forgetting to add the
dialout
group thing). So if we could detect this it would be great.
👍
I noticed that USB serial devices seem to be chmod 666 (-rw-rw-rw) on macOS whenever I plug them in. Additionally, permissions issues on Windows for serial ports seem to mostly be due to something else having access to the port and not necessarily that one isn't e.g. Administrator. This may impact what we show to the user (see below).
Anyways, this basically should be a dialog box that could display for the following scenarios:
* Checks will be performed prior to opening a connection to the radio using the Hamlib library (i.e. no changes to the Hamlib library itself will be required).
The check itself will basically be something like the following:
FILE* fp = fopen("/dev/ttyUSBx", "r+");
if (fp == nullptr)
{
// Logic to display the dialog box
}
Considering the behavior above, there should probably be multiple different messages. I propose the following:
Linux: "Could not open serial port /dev/ttyUSBx. Please ensure that you have permission to access the port. Adding yourself to the dialout group (and logging out/back in) will typically ensure this." macOS/other Unix: "Could not open serial port /dev/tty.usbserialxxxxx. Please ensure that you have permission to access the port." Windows: "Could not open serial port COMx. Please ensure that no other applications are accessing the port."
Does the above sound reasonable?
@drowe67, I haven't had a chance to try #348 yet. Does that seem to correctly detect permissions issues for you? I can test too when I get the time.
A common trap for PTT using a serial port (HamLib or Serial PTT) is lack of permissions. This fix is usually adding your user to the
dialout
group. It would be nice to automatically detect permissions issues and report by a pop up window during serial port configuration/testing.