Re: F38 adding user to dialout group without reboot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 4, 2023 at 5:38 PM Robert Moskowitz <rgm@xxxxxxxxxxxxxxx> wrote:
>
> Working!
>
> Got port busy at first, then remembered that I improperly terminated
> screen run from sudo.  So actually screen still was running and keeping
> the port busy.  Easiest fix was pulling the usb cable to the esp32 and
> reinserting.
>
> Code now downloading.

Be careful if you want exclusive access to the serial port. You have
to take extra steps to ensure others, like ModemManager and other
users, do not open and probe the serial port while you are using it.

Your C code it will look something like this on an open file descriptor:

    fd = open(device_path, O_RDWR | O_NOCTTY | O_SYNC);
    if (fd == -1) {
        log_error("Failed to open device %s: %s\n", device_path,
strerror(errno));
        ret = errno;
        goto finished;
    }

    /* Verify the modem is a terminal we can configure and control */
    if (!isatty(fd))
    {
        log_error("Device %s is not a tty\n", device_path);
        close(fd); fd = 0;
        ret = ENOTTY;
        goto finished;
    }

    /* NetworkManager and ModemManager will try to open our device */
    /* on occasion. Set TIOCEXCL to ensure we get exclusive access */
    if (ioctl(fd, TIOCEXCL, NULL) == -1) {
        log_warn("Failed to set TIOCEXCL on device: %s\n", strerror(errno));
    }

Jeff
--
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux