Handeling Multiple Serial Channels on a Single USB on Linux
I was plugging my Icom IC-705 into my laptop in the field and I sometimes find
that the devices doesn’t always land on /dev/ttyACM0
. which means
configuring other tools like WSJTX and direwolf will need to point the next
dev of /tty/ACM02
. This can be a little tedious and it isn’t always convenient
to debug technical issues in the middle of field.
To try and make this a little more painless I have setup a udev rule to pick
out the IC-705 and give it a symbolic name such as /dev/ic705CAT
.
So under /etc/udev/rules.d/98-icom705.rules
I put the following lines:
ATTRS{idVendor}=="0c26",ATTRS{idProduct}=="0036", ENV{ID_USB_INTERFACE_NUM}=="00", SYMLINK+="ic705CAT"
ATTRS{idVendor}=="0c26",ATTRS{idProduct}=="0036", ENV{ID_USB_INTERFACE_NUM}=="02", SYMLINK+="ic705GPS"
The permissions are set under group dialout
. so add your current user with:
sudo usermod -a -G dialout $USER
.
To make matters a little harder, the IC-705 has two serial devices on a single cable. One is for CAT control, the other I will need the GPS data. It is important that when I rename them, that they are labelled correctly!
So the trick I found here was the ENV{ID_USB_INTERFACE_NUM}=="00"
bit, as I
originally had it as: ATTRS{bInterfaceNumber}
. The reason is that this
attrivute doesn’t exist with idProduct
or idVendor
. As the udev system
goes through each parent of the device.
This output can be seen by:
user@box:~$ udevadm info -a -p $(udevadm info -q path -n /dev/ttyACM0)
and you will see that as it iterates through the parent of the device level. They don’t co exist.
However a way around, I don’t fully understand is that environment variables get set. Presumable for shell/bash scripts to run and read. The environment vars that presumable are set can be seen with:
user@box:~$ sudo udevadm test $(udevadm info -q path -n /det/ttyACM0)
Finally, the IC-705 neesd to output the GPS on serial B. Go to:
Menu
-> Set
-> Connectors
-> USB (B) Function
-> GPS Out
-> On
As soon as you set that you will see the serial stream NMEA data out. This can be seen via:
user@box:~$ screen /dev/ic705GPS 9600
Now that is all done, need to setup gpsd
. And that can serve GPS data to
various software. And I will look into setting system clock for accurate
time reference in FT8 etc…
I currently run Linux Mint 21.