Unfortunately it seems that it is not just a matter of selecting a different file name. Even after doing this QSerial refuses to use it.
Can’t think of any reason for this, but it’s like that from 2013:
So I added a command line argument for the camera USB serial number.
If the argument is not used everything is as before.
When an argument is passed, only that camera is shown.
Then it is easy to have several launchers ttyACM safe.
Not really nice, but is the best I could do.
It could be helpful to me and other if you could add this feature to the main code base. Even better would be to rewrite this part with a Posix compliant library, but I understand it is a big task.
This is what I did, tested only on Linux:
/* Alberto Garlassi 14-04-21
Added USB camera filtering based on serial number identifier.
It is passed as a command line argument and allows to deploy several launchers
each one controlling a predefined camera.
This is because QTSerial can’t use symlinks to devices
see QSerialPort and port naming on Linux (Centos) | Qt Forum
and relies on the native device names, wich can change after USB disconnect.
Udev rules can’t rename the devices, can only create stable symlinks to them.
USB serial identifier:
/bin/udevadm info --name=/dev/ttyACM0 | grep SERIAL_SHORT
Tested on Ubuntu 2004.
foreach(QSerialPortInfo port, QSerialPortInfo::availablePorts())
if((port.hasVendorIdentifier() && ((port.vendorIdentifier() == OPENMVCAM_VID) || (port.vendorIdentifier() == ARDUINOCAM_VID))
&& port.hasProductIdentifier() && ((port.productIdentifier() == OPENMVCAM_PID) || ((port.productIdentifier() & ARDUINOCAM_PID_MASK) == ARDUINOCAM_PID)))
&& (port.serialNumber() == camera_serial || camera_serial == QStringLiteral(“NO_USB_SERIAL_FILTER”)))