Bug #4461

The sort order of discovered ports is annoying

Added by Aaron P 8 months ago. Updated 6 months ago.

Status:Rejected Start date:01/25/2017
Priority:Low Due date:
Assignee:Aaron P % Done:

0%

Category:-
Target version:0.4.1
Chirp Version:daily Platform:Linux
Model affected:(All models)

Description

At least on Ubuntu, there are lots of /dev/ttyS* ports that show up at all times. When selecting a port to transfer to/from a radio it would be nice if these weren't in the way, making me scroll to the end of the list every time to select /dev/USB*

I propose to sort the discovered ports with /dev/ttyS* at the end rather than the middle.

History

Updated by Aaron P 6 months ago

  • Status changed from New to Rejected

Closing this.

The issue I had, which appears to be unique to me, at least at the moment, is I have several radios that enumerate as different devices. Every time I use chirp I have to change the selected device and that means scrolling all the way to the end of the list for /dev/ttyU*

There was some chat on IRC about this. We couldn't agree on an elegant solution. I have the following patched in platform.py and it works for me, but the concern is that a broken sort order might confuse users.

def list_serial_ports(self):
"""Return a list of OS files matching known patterns.

Each pattern is expanded and sorted, then appended
to the result. The primary point being to show ttyUSB*
before the huge list of ttyS*
"""
ports = [
"/dev/ttyACM*",
"/dev/ttyAMA*",
"/dev/cu.*",
"/dev/cua0*",
"/dev/cuaU*",
"/dev/term/*",
"/dev/tty.KeySerial*",
"/dev/ttyUSB*",
"/dev/ttyS*"]

available_ports = []
for port_pattern in ports:
for port in natural_sorted(glob.glob(port_pattern)):
available_ports.append(port)
return available_ports

Also available in: Atom PDF