I'm trying to make a small program that receives messages from the serial port, and doing it periodically. Right now I'm not saving anything, I'm just trying to see if I get anything at all, so I tried this code:
def ReceiveRS():
global ser
while ser.inWaiting() > 0:
print(ser.read(1))
ser is the serial port, which is correctly initialized, as it has worked before and I can send stuff. After trying some different things I have found out that inWaiting() never seems to return anything but 0. Anyone have any ideas as to why and how to fix it?
Oh, and I'm using Python 3.2.3, with pySerial on a Raspberry PI.