So I'm having a bit of an issue with a usb to serial device, when my raspberry pi compute module boots up it enumerates this specific usb to serial device first which "bumps" the other usb to serial ports which are created later and represent multiple ports to a modem/gps.
So by default my ports look like this without this usb to serial device connected:
/dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2 /dev/ttyUSB3
When I connect this usb to serial device it gets added as follows:
/dev/ttyUSB4
If I reboot however or shutdown and then start back up the list appears identical except the usb to serial device I mentioned before that used to be ttyUSB4 is now at ttyUSB0. This is what I meant by the ports getting "bumped".
I have tried editing the udev local.rules file by adding the following line.
ACTION=="add", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", SYMLINK+="usbgps"
I also tried this line as well but this one didn't seem to work.
ACTION=="add", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", NAME+="usbgps"
The first line that creates the symlink works and it creates a new device/link located at /dev/usbgps.
This works but the original device still remains ie it creates the usbgps symlink but it also creates the /dev/ttyUSB4 device. On reboot it then shows up as /dev/ttyUSB0 and "bumps" up the other ports which messes up other pieces of software I have.
In the long run I will try to use specific static names for the devices that my software is accessing. The problem with this is that the ttyUSB0/1/2/3 ports get created by a special driver from the modem manufacturer. So I will likely need to modify the code to be able to have the four usb to serial ports show up with direct symlinks. ie ttyUSB2 is for pppd/cellular so I'd name it cellport and ttyUSB1 is for gps so I'd name that gpsport and so on.
If anyone knows how I could make the ttyUSB0/1/2/3 ports have direct symlinks without modifying the driver please do tell.
So the ultimate question that I'm asking is:
How do I make my usb device appear as usbgps without making it also appear as a ttyUSB4 or ttyUSB0 port name. I only want the device to show up as usbgps. If I can stop it from being added to the list of ttyUSB devices then I can stop it from bumping the ports and messing up the other applications that depend on the ports having a specific name.