I did debug the code below, line-by-line using some print statements.
class Timeout(Exception):
pass
def getSource(comm):
source = comm.split('@')
params = source[1].split(':')
debug = '--debug' in sys.argv
if source[0] == 'serial':
try:
return Serial(params[0], int(params[1]), flush=True, debug=debug)
except:
print ("ERROR: Unable to initialize a serial connection to", comm)
raise Exception
Everything looks OK until the line:
return Serial(params[0], int(params[1]), flush=True, debug=debug)
this line is supposed to be compiled since all the objects in the Serial
like params[0]
, etc are obtained. But it returns an error jumping to the except
and printing the statement "ERROR: Unable to initialize a serial connection to ..."
I am using Python 3.6.8 on a Docker container.
Any kind of help would be appreciated. I'm ready for any further info, if needed.