On Sun, 8 Jul 2018 20:19:05 -0700 (PDT), Tomas Medina
> declaimed the following:
>I close the serial port at the beginning of the program to make sure the
>port is clean before I start reading from it.
Closing the receiving end doesn't do anything for flushing data that
might be buffered on the sending side (and does even less if the receiving
end wasn't open to begin with). Granted, there is little use of
flow-control on these devices so the sending side probably doesn't even
pause before sending data.
>I tried specifying the port, baudrate, and set a time out at instantiation
>(ser = serial.Serial("/dev/ttyO1", 115200, timeout=1)) but the same thing
>happens. The only difference is that, because of the timeout, I get an
>empty line every second.
So probably not a problem on your code at least. That leaves either the
device is not sending data, or the wiring is not correct (have you tried
swapping Tx and Rx? In ancient practice, the meaning of those lines was
reversed between DCE ["modem"] and DTE ["terminal"], hence the need for
"null-modems" when connecting two DTE or two DCE devices).
On a 5V system, I'd probably try a low-current LED on the lines to
monitor, but 3.3V may be more difficult to avoid loading down the circuit.
Oscilloscope time -- make sure the device is sending data.