Linux - "Could not open port. Please restart" --- worked befoer new Distro

  1. Operating System:
    “Andy’s Ham Radio Linux” 22.04.3 LTS (Jammy Jellyfish)
  2. Method of download attempted (from wfview.org, package manager, source code, etc):
    Installed from .sh script – Wfview 1.64
  3. Radio Model:
    Icom 7300
  4. Method of radio connectivity (USB, WiFi, Ethernet, etc):
    USB
  5. Did you check the FAQ and read the manual?
    Yes - all correct worked fine before newer distro of “Andy’s”

I have been using “Andy’s Ham Radio Linux” on my PC for a while and have had great results with Wfview. I recently cleared and installed the newest version “v25a” which has a few new things and updates.
Now I keep getting the “could not open port. Please restart” message. I can get the radio to connect, when turn on the 7300, move the usb to a different port and then the radio seems to connect. I still haven’t figured out the sequence since it will shut off / on remotely then (most of the time). Sometimes still won’t connect until I do it again.
I used to be able to reboot the computer an have it all work and connect fine with no problems. Just when I updated my OS I’ve had this problem now. Maybe I need to go back a version? But would like to use some of the new features installed.
It’s saying ttyUSB0 is the problem. I do try deleting the /dev/usbTTY0 (or the long file link in /dev/serial/by-id/…" and it comes back with the same thing.
I know that the “Brttly” software has taken the port in the past, but I learned from that and always remove that if install on any PC/Pi on the radio that I use.
LSUSB shows this:
lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
Bus 001 Device 003: ID 8087:0a2b Intel Corp. Bluetooth wireless interface
Bus 001 Device 006: ID 08bb:2901 Texas Instruments PCM2901 Audio Codec
Bus 001 Device 004: ID 10c4:ea60 Silicon Labs CP210x UART Bridge
Bus 001 Device 002: ID 0451:2046 Texas Instruments, Inc. TUSB2046 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

and this…
sudo dmesg | grep tty
[sudo] password for tegwilym:
[ 0.097783] printk: console [tty0] enabled
[ 0.481981] 00:01: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[ 15.641019] usb 1-7.1: cp210x converter now attached to ttyUSB0

Any ideas what I got screwed up?
Thanks!
73 ,KA7ViK

Hi Tom,

What port is wfview set to use?

Verify you have that port set correctly. Check permissions of the port as well.

Lastly, please send us a log file from when wfview does not work. Simply press “Log” in the GUI, and then press “send to termbin” and then paste the resulting URL into a message here.

–E
de W6EL

I have it set on “Auto” for the port. That worked great before. It would then connect to ttyUSB0 with never any issues. Just start Wfiew, click “power on” and all started fine. I did try manually setting to ttyUSB0 or even the /dev/serial/by-id/[long file name] with no changes.

 crw-rw---- 1 root dialout 188, 0 Sep 27 12:28 ttyUSB0
 lrwxrwxrwx 1 root root 13 Sep 27 12:27 usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_IC-7300_02043151-if00-port0 -> ../../ttyUSB0

I cleared the log, and tried it again so this should have fresh info – https://termbin.com/m85r

Tom

According to the log, wfview is unable to open /dev/ttyUSB0

There are a number of possible reasons for this:

  1. Port doesn’t exist
  2. Current user doesn’t have permission to access port (try sudo chown $USER /dev/ttyUSB*)
  3. Radio USB has crashed (try hard rebooting radio)
  4. Port is in use by some other application (close other app)

73 Phil M0VSE

Same conclusions I’ve come up with.
Updated port owner to me.
Not sure what else is using that port, when I unplug the radio it goes away.
I did get it working again, radio on, change USB ports then it’s going again. Strange!
Possibly something in bios how the computer configures the ports? I did have to change it from UEFI to Legacy to get my USB stick to boot for the install, did change it back, and also did a bios update.
Hmmm…I’ll poke around some more - or just manually have to nudge it to re-connect after reboot, but that’s a pain when I run it VNC from upstairs. :wink:

Grep the output of lsof and see if anything else is trying to use the port.

  • Radio was working fine after resetting the power, moving USB to new port.
  • Tried lsof (when connected) and saw the radio was using a lot of stuff.
  • Rebooted computer, once again it won’t connect. lsof | grep ttyUSB* shows nothing (same thing when radio connected, but turned off).

You are not in the dialout group?
(changing ownership is not a good idea with udev)
And the last thing - fix udev rules and no matter what port you put it in… Same device name

I checked “groups root” and wasn’t listed there (only in the root group), but my own username “tegwilym” showed up in a lot of them. I did add root to dialout, rebooted and same thing.
How do I fix the udev rules? More than a reboot and re-login?

image

You must be in dialout, as user. Not root.

Also somewhere there are docs how to fix udev rules.
(on my phone now)

I have both root and user in the dialout group now. I am logged in as me (tegwilym) and when I chown the ttyUSB0 to #USER, it shows up in the directory but log out and log back in and its back to ‘root dialout’ rather than ‘tegwilym dialout’

Because you as user must be in the dialout group. And do NOT change ownership of the port.

If you log in as user, you will see with the id command that you are not in the dialout group.

Hi Tom.

As Roeland said, changing ownership of a udev managed device is not a good idea, as udev will just change it back.

There are a number of howto’s online that cover this, but basically you need to add udev rules to change the permissions of the device.

73 Phil

changing udev rules to make it more permissable is not a good idea security wise. Don’t change it. (not even by udev rules)

Setup here:

device is root:root, like it should be.
Also the udev rules force the name of the device to be fixed
And as you see I am in the dialout group… (To be set by root once)

roeland@taplop:~> ls -l /dev/IC*
lrwxrwxrwx 1 root root 7 Sep 25 20:19 /dev/IC7851A → ttyUSB0
lrwxrwxrwx 1 root root 7 Sep 25 20:19 /dev/IC7851B → ttyUSB1

the rules below will force the name to be always consistent, it will NEVER EVER change no matter what USB port you push the cable in.

roeland@taplop:~> id
uid=1005(roeland) gid=100(users) groups=100(users),443(wireshark),490(dialout),1002(plugdev)

you see, user roeland is also in the dialout group. dialout: Full and direct access to serial ports.

roeland@taplop:~> cat /etc/udev/rules.d/99-usb-serial.rules
SUBSYSTEM==“tty”, ATTRS{idVendor}==“10c4”, ATTRS{idProduct}==“ea60”, ATTRS{serial}==“IC-7851 03001140 A”, SYMLINK+=“IC7851A”
SUBSYSTEM==“tty”, ATTRS{idVendor}==“10c4”, ATTRS{idProduct}==“ea60”, ATTRS{serial}==“IC-7851 03001140 B”, SYMLINK+=“IC7851B”
SUBSYSTEM==“tty”, ATTRS{idVendor}==“10c4”, ATTRS{idProduct}==“ea60”, ATTRS{serial}==“IC-7300 03001507”, SYMLINK+=“IC7300”
SUBSYSTEM==“tty”, ATTRS{idVendor}==“10c4”, ATTRS{idProduct}==“ea60”, ATTRS{serial}==“IC-9700 13001202 A”, SYMLINK+=“IC9700A”
SUBSYSTEM==“tty”, ATTRS{idVendor}==“10c4”, ATTRS{idProduct}==“ea60”, ATTRS{serial}==“IC-9700 13001202 B”, SYMLINK+=“IC9700B”

Phil’s method works too but may give too wide access to the USB devices here.

Here’s what I show. I don’t have a .rules file set up yet in /etc/udev/rules.d/ so it appears that is what I need there to set up. I can find the info in ‘lsusb -vvv’ it appears.

Also, see our manual for info on this topic.

https://wfview.org/wfview-user-manual/serial-port-management/#linux

–E
de W6EL

Ugh… Tried all that. Rebooted, unplugged the USB and plugged in again. Worked.
Rebooted machine. Didn’t work.
I show up with dialout now, and have a nice shortcut to IC7300 at least. Hmm…but should it be root root?
As seen now in /dev
lrwxrwxrwx 1 root root 7 Sep 27 19:04 IC7300 → ttyUSB0
crw-rw---- 1 tegwilym dialout 188, 0 Sep 27 19:05 ttyUSB0

Let’s see your UDEV rules.

–E
de W6EL

The /dev/serial/by-id/:
lrwxrwxrwx 1 root root 13 Sep 27 19:25 usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_IC-7300_02043151-if00-port0 → …/…/ttyUSB0

Then created this file:
/etc/udev/rules.d/90-persistent-usb.rules

Here’s the content:
SUBSYSTEM==“tty”, ATTRS{idVendor}==“10c4”, ATTRS{idProduct}==“ea60”, ATTRS{serial}==“IC-7300 02043151”, SYMLINK+=“IC7300”, OWNER=“tegwilym”

I’m probably missing something really dumb! :slight_smile:
Thanks for all the support to my questions.
Tom

Don’t edit the ownership. Keep it root:dialout

Quickly read the reply so did I miss that you are in the dialout group?