I'm trying to discover the connection parameters to a Java application. According to the status bar on the Java app, the connection values are: com1, 4800-baudrate, 8-eightbits, 1-stopbits, e-parity). However, when using pySerial to make a connection to the device (embedded Linux device -Ubuntu), I'm getting an access denied response. I feel that com1 is being used with a port number or something. At any rate, here is what I'm using:
import serial
import time
ser = serial.Serial(
port='COM1',
baudrate=4800,
parity=serial.PARITY_EVEN,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS)
ser.open()
ser.isOpen()
print ser.baudrate()
Error:
Traceback (most recent call last):
File "C:\Users\me\Desktop\file.py", line 12, in <module>
ser.open()
File "C:\Python27\lib\site-packages\serial\serialwin32.py", line 56, in open
raise SerialException("could not open port %s: %s" % (self.portstr, ctypes.WinError()))
SerialException: could not open port COM1: [Error 5] Access is denied.
I appreciate any help and/or direction given.