Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ardSerial.py suggestion #88

Open
gravesreid opened this issue Jun 25, 2024 · 1 comment
Open

ardSerial.py suggestion #88

gravesreid opened this issue Jun 25, 2024 · 1 comment

Comments

@gravesreid
Copy link

From lines 673 to 699 in ardserial.py:

def showSerialPorts(allPorts):
# currently an issue in pyserial where for newer raspiberry pi os
# (Kernel version: 6.1, Debian version: 12 (bookworm)) or ubuntus (22.04)
# it classifies the /dev/ttyS0 port as a platform port and therefore won't be queried
# pyserial/pyserial#489
if os.name == 'posix' and sys.platform.lower()[:5] == 'linux':
extra_ports = glob.glob('/dev/ttyS*')
for port in extra_ports:
if port not in allPorts:
allPorts.append(port)
for item in allPorts:
if 'AMA0' in item:
allPorts.remove(item)

allPorts = deleteDuplicatedUsbSerial(allPorts)
for index in range(len(allPorts)):
    logger.debug(f"port[{index}] is {allPorts[index]} ")
print("\n*** Available serial ports: ***")
print(*allPorts, sep = "\n")
if platform.system() != "Windows":
    for p in allPorts:
         if 'cu.usb' in p:
            print('\n* Manually connect to the following port if it fail to connect automatically\n')
            if config.useMindPlus:
                print(p.replace('/dev/',''),end='\n\n')
            else:
                print(p, end='\n\n')

I suggest removing:
for item in allPorts:
if 'AMA0' in item:
allPorts.remove(item)

I had to remove this to get ardserial to work, as port /dev/ttyS0 doesn't work for me, however, ttyAMA0 is available, but this line loop removes the possibility of connecting to it

@borntoleave
Copy link
Collaborator

borntoleave commented Jun 28, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants