Menu

Unable to open serial port

2019-09-05
2019-09-05
  • Eric Christensen

    I'm unable to open my /dev/ttyUSB0 serial port while trying to connect to my Kenwood TM-D700. I have run Xastir, previously, without trouble opening this port so my permissions should be okay (and I just confirmed that they are).

    I'm running an Intel processor but, following the instructions in the docs, I installed the extra package to see if that would help (it didn't). Any ideas?

     
  • Andrew Pavlin

    Andrew Pavlin - 2019-09-05

    It depends on the dialect of Linux you are using, but a common problem is that the rather old RXTX library needs write access to the /var/lock directory so it can create lock files for the serial ports in use. Typically, this means that:

    1. the /var/lock directory (or /run/lock directory if /var/lock is a symlink to it) is group lock;
    2. the /var/lock or /run/lock directory is group-writeable;
    3. the user account running YAAC is a member of the lock group.

    If the above conditions aren't met, the RXTX library will be unable to create lock files and therefore won't open the serial port files.

     
  • Eric Christensen

    Doh! I meant to mention that I'm running Fedora 30 (the latest version). The version of rxtx I installed is: rxtx.x86_64 2.2-0.24.20100211.fc30 so... 2010? Ouch. But, if the documentation is correct, I shouldn't need this package because I'm running an Intel processor, correct?

    /run/lock is owned by root, and only writable by user, not group.

    The user is now a member of the lock group. I wasn't before but following instructions I added myself to that group.

     
  • Andrew Pavlin

    Andrew Pavlin - 2019-09-05

    The problem is, since Fedora 15, the lock directory hasn't been writeable by lock group members, so you actually have to change the group and permissions on /run/lock to g+w so that lock group members can create lock files. The RXTX library is very old and still uses the concept that the actual user account that wants the lock will create a lock file directly, rather than having the operating system do it implicitly.

    Note this is actually mentioned in the YAAC help files.

     
  • Eric Christensen

    Ah ha! Thanks for pointing that out (my brain is Dorian-focused).

    So, I fixed this by doing a:

    $ sudo setfacl -m g:lock:rwx /run/lock/

    which yielded:

    $ getfacl /run/lock/
    getfacl: Removing leading '/' from absolute path names
    # file: run/lock/`
    # owner: root
    # group: root
    user::rwx
    group::r-x
    group:lock:rwx
    mask::rwx
    other::r-x
    

    After restarting YAAC everything seemed to just work! Thanks for your insight!

     

Anonymous
Anonymous

Add attachments
Cancel