I made simple custom arduino board using an atmega328p and the PL2303 serial to USB chip.
In my arduino program, I am in a loop that sends out a string continuously. I can read this in the Arduino serial monitor with a baudrate of 9600. However, in my python program using the pySerial library, the readline function doesn't return anything. I checked using PuTTY but it still doesn't do anything.
Now I tried messing with the serial settings and found out that these lines of code work (the readline returns the string) if I call it in the exact same order.
ser = serial.Serial(comm_port)
ser.xonxoff = True
ser.rtscts = True
ser.dsrdtr = True
ser.readline()
However, the code below doesn't work
ser = serial.Serial(comm_port, xonxoff=True, rtscts=True, dsrdtr=True)
ser.readline()
What could be causing this? My guess is somehow I've switched the datalines in my USB cable and that the arduino serial monitor handles this somehow.
Another thing to note is that I couldn't program the Arduino the normal way via USB. I always have to program it using the ICSP port and a USBasp programmer.