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