Python - pySerials inWaiting() always return 0
pyserial, python-3.x, raspberry-pi
Solution
This was embarrassing. I had another older version running in the background (on autostart so I didn't remember it was running) that was taking all the received bytes and leaving none for the newer script. So, anyone know how to remove questions?
Problem
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.