Re: USB lock


David Ranch
 


If you're needs are simpler and your devices identify themselves uniquely (not always a for-sure thing), you can use the "by-id" naming system already available on your system.  For example on my machine:

$ ls -la /dev/serial/by-id/
total 0
drwxr-xr-x 2 root root 200 Jan 20 14:16 .
drwxr-xr-x 4 root root  80 Jan 16 20:58 ..
lrwxrwxrwx 1 root root  13 Jan 16 20:58 usb-FTDI_Navigator__CAT___2nd_PTT__00000000-if00-port0 -> ../../ttyUSB0
lrwxrwxrwx 1 root root  13 Jan 16 20:58 usb-FTDI_Navigator__CAT___2nd_PTT__00000000-if01-port0 -> ../../ttyUSB1
lrwxrwxrwx 1 root root  13 Jan 16 20:58 usb-FTDI_Navigator__RS232___Config__00000002-if00-port0 -> ../../ttyUSB4
lrwxrwxrwx 1 root root  13 Jan 16 20:58 usb-FTDI_Navigator__RS232___Config__00000002-if01-port0 -> ../../ttyUSB5
lrwxrwxrwx 1 root root  13 Jan 16 20:58 usb-FTDI_Navigator__WKey___FSK__00000001-if00-port0 -> ../../ttyUSB2
lrwxrwxrwx 1 root root  13 Jan 16 20:58 usb-FTDI_Navigator__WKey___FSK__00000001-if01-port0 -> ../../ttyUSB3
lrwxrwxrwx 1 root root  13 Jan 20 14:16 usb-FTDI_usb_serial_converter_FTCAWZIA-if00-port0 -> ../../ttyUSB6
lrwxrwxrwx 1 root root  13 Jan 20 14:16 usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0 -> ../../ttyUSB7


In an application, I would just configure my serial port as /dev/seria/by-id/usb-FTDI_usb_serial_converter_FTCAWZIA-if00-port0 and I'm done!

--David
KI6ZHD



On 01/19/2021 09:02 AM, John D Hays - K7VE wrote:
You can create a udev rule which will make sure the IC-7300 always has a /dev file name that is consistent.  Udev rules files go in /etc/udev/rules.d

See example file content at: 
https://gist.github.com/peteonrails/fa99d57b58315a57631956c7e68f4d00

This should create a file /dev/ic7300 when you plug in your radio.  You can then use this instead of /dev/ttyUSBx and will be consistent between invocations.  /dev/ic7300 will be a dynamically assigned link to whichever /dev/ttyUSBx is assigned to the radio.



On Tue, Jan 19, 2021 at 8:21 AM Jay Lijoi <lijoi@...> wrote:
Good day,

I usually have to go to settings and pick my serial port, usually USB0 in my case, every time I start WSJT-X. Is there a way to have it connect to my ic-7300 consistently, or I'd this just the nature of Linux dynamic allocation of serial devices?

Jay
WB2QQJ
_,_


--
John D. Hays
Kingston, WA
K7VE

 


Join RaspberryPi-4-HamRadio@groups.io to automatically receive all group messages.