Skip to content

Commit

Permalink
Update SerialCommunication.py
Browse files Browse the repository at this point in the history
move the modifications in SerialCommunication.py to ardserial.py
  • Loading branch information
borntoleave committed Feb 18, 2024
1 parent 7c24b58 commit a4c6fb3
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions serialMaster/SerialCommunication.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
# modified from https://blog.csdn.net/u013541325/article/details/113062191

import binascii
import glob
import os
import serial # need to install pyserial first
import serial.tools.list_ports
import sys

# global variables
# whether the serial port is created successfully or not
Expand Down Expand Up @@ -100,15 +97,6 @@ def Print_Used_Com():
port_list_number.append(each_port[0])
port_list_name.append(each_port[1])

# 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
# https://github.com/pyserial/pyserial/issues/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 port_list_number:
port_list_number.append(port)
# print(port_list_number)
# print(port_list_name)
return port_list_number
Expand Down

0 comments on commit a4c6fb3

Please sign in to comment.