0

I'm trying to test writing messages to serial port using pyserial and reading it again using two usb to serial adapters connected back to vack "USB-Serial --> Serial-USB" to verify it is writing to the serial port as it is meant for communication with hardware, so I have open console witch is reading all the time

import serial

port = 'COM6'
read_ser = serial.Serial(port)

while True:
  x=read_ser.read()
  print(x)

and for writing I use

import serial

port = 'COM5'
ser = serial.Serial(port)
# ser.write(str.encode('$GPRMC,081117.24,A,5042.988302,N,1058.376556,E,14.7,,230813,0.0,E*74'))
ser.write('$GPRMC,081117.24,A,5042.988302,N,1058.376556,E,14.7,,230813,0.0,E*74'.encode())

And nothing is shown in the reading console I tried both adapters and read from external serial hardware successfully.

I'm using python 3.7 on windows 10

Aly Hosny
  • 827
  • 5
  • 13

1 Answers1

0

I figured it out The problem was with the pin layout as I used gender changer to connect the two serial adapters using serial cable instead solved the problem.

Aly Hosny
  • 827
  • 5
  • 13