Solved QSerialPortInfo::availablePorts() freeze for ~30s
-
Hello Charlie, thanks for your quick answer.
Yes, when I do not have permission, it is really fast, and it fails as expected.
It's when I have the permission that I encounter the issue.
What's interesting though is that after all the wait, I have the correct devices returned.It's really that
QSerialPortInfo::availablePorts()
line that is the issue.
It also happens when I compile and run the "Enumerator example". -
Hi
Have you tested with non Qt serial app, how it reacts to scanning for ports? -
It sounds that you have some issues with your new computer's port configuration. Which platform are you using?
Anyway about the device that you want to connect by Serial... what is it?
-
@mrjj I have tried
python -m serial.tools.list_ports
but the output is wrong though immediate.
Do you have an application in mind I could try?@Charlie_Hdz It's a Manjaro linux on x86_64. I would tend to agree with you, but I have no idea where to start looking.
It's a ftdi. -
@Hallot
well i always use minicom as its so simple
moserial is also cool. (X11)
I dont know Manjaro so maybe there is another installed already -
Hum, I'm not exactly sure how I can list all serial devices using minicom, but I have used libftdi and one of their example, and it lists my ftdi devices immediately.
-
@Hallot
Oh, my bad, you actually type it so bad app for test.
Sorry.
so libftdi can enum all ports and not hang?
I wonder if it touches non ftdi ones. ( those not usb based)
if time permits you can try
https://stackoverflow.com/questions/2530096/how-to-find-all-serial-devices-ttys-ttyusb-on-linux-without-opening-them
(Søren Holm post)Anyway, its most likely something under /dev that makes it hang.
I tried QSerialPortInfo on wm linux but i cant make it hang even when i remove
the serial ports so they are missing. -
@mrjj said in QSerialPortInfo::availablePorts() freeze for ~30s:
I tried QSerialPortInfo on wm linux but i cant make it hang even when i remove
the serial ports so they are missing.Sure, actually SerialPort tend to send "unknow" error messages instead of hanging functions.
-
QSerialPortInfo does not use the open() system call if you do not call a deprecated isBusy() method (do not use it then). QSerialPortInfo use udev, sysfs and simple enumeration in /dev, in case previous methods were failed. You need to debug the QSerialPortInfo, or, at least try to strace a calls, where the stuck is happens.
PS: It is interest to know in what of 'backend' this happens: with udev, sysfs or simple enumeration by a masks from /dev directory to localise an issue.
PS2: From my expirience, the FTDI should work perfectly.
-
I'm pretty sure I use udev.
However, it looks there was a bug somewhere that got fixed because after the latest system update from Manjaro, the issue has disappeared.
No kernel or udev update though, so I am not sure what was at cause or what fixed it.Anyway, I guess this can be considered solved, thanks a lot for the support.