I’m working on the EC25 Mini PCIe module and I’m trying to read GPS data from the available UART port. I’m using the following python script:
portwrite = "/dev/ttyUSB3" print("Connecting Port..") try: ser = serial.Serial(portwrite, baudrate = 115200, timeout = 1,rtscts=True, dsrdtr=True) ser.write('AT+QGPSCFG="outport,uartdebug"\r'.encode()) sleep(1) ser.write('AT+QGPS=1\r'.encode()) ser.close() sleep(1) except Exception as e: print("Serial port connection failed.") print(e)
where I configure the outport as UART. However, I don’t read any data in UART. I do read if I run the second following script in python:
ser = serial.Serial(port, baudrate = 115200, timeout = 0.5,rtscts=True, dsrdtr=True) while True: data = ser.readline().decode('utf-8') print(data) sleep(2)
Not sure if I’m doing this correctly and so I would like to someone can help me with this.